0% found this document useful (0 votes)
39 views17 pages

STM8 Introducao

This document provides information about the STM8 microcontroller including development tools, compilers, hardware options, firmware examples, and a serial communication library. It discusses the STM8S105 microcontroller chip and the STM8S-Discovery evaluation board. It provides code examples for blinking an LED, GPIO configuration, and UART serial communication. Circuit diagrams are shown for connecting the discovery board to a computer via a serial TX/RX interface.

Uploaded by

Enzo Trentini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views17 pages

STM8 Introducao

This document provides information about the STM8 microcontroller including development tools, compilers, hardware options, firmware examples, and a serial communication library. It discusses the STM8S105 microcontroller chip and the STM8S-Discovery evaluation board. It provides code examples for blinking an LED, GPIO configuration, and UART serial communication. Circuit diagrams are shown for connecting the discovery board to a computer via a serial TX/RX interface.

Uploaded by

Enzo Trentini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

STM8

Professor: Ricardo Leal Costi


[email protected]
Programação
Software
◦ STVD - http://www.st.com/en/development-tools/stvd-stm8.html

Compilador
◦ Cosmic Compilador - http://www.cosmic-software.com/download.php

11/09/2020 22:50:36 2
Hardware – STM8S105

11/09/2020 22:50:36 3
Hardware – STM8S105

11/09/2020 22:50:36 4
Hardware – STM8S105
Placa Padrao – SMT8S-Discovery

https://www.st.com/en/evaluation-tools/stm8s-discovery.html

11/09/2020 22:50:36 5
Hardware – STM8S105

11/09/2020 22:50:36 6
Hardware
Conexões

11/09/2020 22:50:36 7
Firmware

11/09/2020 22:50:36 8
Firmware
Firmware Padrao

https://www.st.com/en/evaluation-tools/stm8s-discovery.html#tools-software

11/09/2020 22:50:36 9
Firmware
void main(void)
{
unsigned long TempoAux;
/* Configures clocks */
CLK_Configuration();

/* Configures GPIOs */
GPIO_Configuration();

do
{
GPIO_WriteHigh(GPIOD, GPIO_PIN_0);
for (TempoAux=0;TempoAux<0xFFFF;TempoAux++) continue;
GPIO_WriteLow(GPIOD, GPIO_PIN_0);
for (TempoAux=0;TempoAux<0xFFFF;TempoAux++) continue;
}while(1);
}

11/09/2020 22:50:36 10
Firmware – Pisca Led
void GPIO_Configuration(void)
{
/* GPIOD reset */
GPIO_DeInit(GPIOD);

/* Configure PD0 (LED1) as output push-pull low (led switched on) */


GPIO_Init(GPIOD, GPIO_PIN_0, GPIO_MODE_OUT_PP_LOW_FAST);

11/09/2020 22:50:36 11
Firmware - Serial
void main(void)
{
unsigned long TempoAux;
/* Configures clocks */
CLK_Configuration();

/* Configures GPIOs */
GPIO_Configuration();
UART2_Init(9600,UART2_WORDLENGTH_8D,UART2_STOPBITS_1,UART2_PARITY_NO,UART2
_SYNCMODE_CLOCK_DISABLE,UART2_MODE_TXRX_ENABLE);
do
{
UART2_SendData8(0X30);
GPIO_WriteHigh(GPIOD, GPIO_PIN_0);
for (TempoAux=0;TempoAux<0xFFFF;TempoAux++) continue;
GPIO_WriteLow(GPIOD, GPIO_PIN_0);
for (TempoAux=0;TempoAux<0xFFFF;TempoAux++) continue;
}while(1);
}
11/09/2020 22:50:36 12
Firmware – Biblioteca UART2

11/09/2020 22:50:36 13
Hardware- Serial

11/09/2020 22:50:36 14
Hardware- Serial
3.3V
U10
C6
100nF 1 2 C22
3 1 2 16 100nF
3 16
4 6
C24 5 4 6 15
100nF 5 15 C23
100nF
TXD R52 100 11 14
10 T1IN T1OUT 7 TX-232
RXD R54 100 12 T2IN T2OUT 13 RX-232
9 R1OUT R1IN 8
R2OUT R2IN
MAX3232
P1
1
6
2 TX3_232
7
3 RX3_232
8
4
9
5 GND3_232

CONNECTOR DB9

11/09/2020 22:50:36 15
Erro DataBase Windows 10
Executar COMMAND como Admin
C:\Program Files (x86)\Common Files\Microsoft Shared\DAO\
Executar
Regsvr32 /u DAO350.DLL
Regsvr32 DAO350.DLL

11/09/2020 22:50:36 16
Perguntas?

11/09/2020 22:50:36 17

You might also like