| 数据搜索系统,热门电子元器件搜索 |
|
AN3259 数据表(PDF) 9 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN3259 数据表(HTML) 9 Page - STMicroelectronics |
|
9 / 25 page ![]() AN3259 Software description Doc ID 17835 Rev 1 9/25 4 Software description 4.1 STM8S peripherals used by the application This application example uses the STM8S standard firmware library to control general purpose functions. It makes use of the following STM8S peripherals: UART2 UART2 is used to communicate with the terminal window running on the PC. It must be configured as follows: ● Baud rate = 9600 baud ● Word length = 8 bits ● One stop bit ● No parity ● Receive and transmit enabled ● UART2 clock disabled The communications are managed by polling each receive and transmit operation. Note: The terminal window and the STM8S UART peripheral must be configured with the same baud rate, word length, number of stop bits, and parity. Timer 3 (TIM3) TIM3 timer is configured as a timebase with interrupt enabled to control LD1 blinking speed. GPIOs The GPIOs are used to interface the MCU with external hardware. Port PD0 is configured as output push-pull low to drive LD1. BEEPER To drive the buzzer, the BEEPER peripheral outputs a signal of 1, 2, or 4 KHz on the BEEP output pin. 4.2 Configuring STM8S standard firmware library The stm8s_conf.h file of the STM8S standard firmware library allows to configure the library by enabling the peripheral functions used by the application. The following define statements must be present: #define _GPIO 1 enables the GPIOs #define _TIM3 1 enables TIM3 #define _BEEPER 1 enables the BEEPER #define _UART2 1 enables UART2 |
|
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |