| 数据搜索系统,热门电子元器件搜索 |
|
PM0222 数据表(PDF) 23 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
PM0222 数据表(HTML) 23 Page - STMicroelectronics |
|
23 / 33 page ![]() DocID025476 Rev 1 23/33 PM0222 UART 33 9 UART All UART registers are described in a structure defined in the Brain header file (.h) provided by STMicroelectronics. Brain has one UART available at the following address in the memory map: UART APB base address: 0xA200_0000 9.1 FIFO management The transmit and receive paths are buffered with internal FIFO memory enabling up to 32 bytes to be stored independently in both transmit and receive modes. 9.2 Baud rate calculation example To define the UART baud rate generation there are two registers to configure, UARTIBRD and UARTFBRD. Those two registers contain respectively the decimal and the fractional part of the BAUDDIV data. We can calculate this data using the following formula: BAUDDIV = ( FUARTCLK / (16 x Baud rate) ) With: FUARTCLK is the UART reference clock frequency. It corresponds to the processor clock divided by a programmable value from 2 to 127 (see Brain reference manual, Clock and reset management unit chapter for more details). Baud rate is the Baud rate required by the user’s program The UARTFBRD field value is calculated as follows: integer(fractional part of BAUDDIV * 64 + 0.5) Example: calculating the divisor value If the requested baud rate is 230400 and FUARTCLK = 4 MHz then: BAUDDIV = ( 4 x 106 ) / ( 16 x 230400 ) = 1.085 This means that the decimal part BDRI = 1 and the fractional part BDRF = 0.085. UART->UARTIBRD = 0x1; // configure the integer part of BAUDDIV UART->UARTFBRD = 0x5; // configure the fractional part of BAUDDIV See Brain reference manual, UART chapter, UARTFBRD register description for more details. |
|
链接网址 |
| 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 |