| データシートサーチシステム |
|
STM8S データシート(PDF) 352 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
STM8S データシート(HTML) 352 Page - STMicroelectronics |
|
352 / 467 page ![]() Universal asynchronous receiver transmitter (UART) RM0016 352/467 DocID14587 Rev 14 22.4.2 Slave mode with automatic resynchronization disabled Note: This feature is only available in UART2, UART3 and UART4. UART initialization Procedure: 1. Select the desired baudrate by programming UART_BRR2 and UART_BRR1 registers, 2. Enable transmitter and receiver by setting TEN and REN bits in UART_CR2 register, 3. Enable LSLV bit in UART_CR6 register, 4. Enable LIN mode by setting LINEN bit in UART_CR3 register, LIN Header reception According to the LIN protocol, a slave node must wait for a valid header, coming from the master node. Then application has to take following action, depending on the header Identifier value: • Receive the response • Transmit the response • Ignore the response and wait for next header When a LIN Header is received: • The LHDF flag in the UART_CR6 register indicates that a LIN Header has been detected. • An interrupt is generated if the LHDIEN bit in the UART_CR6 register is set. • The LIN Identifier is available in the UART_DR register. Note: It is recommended to put UART in mute mode by setting RWU bit. This mode allows detection of headers only and prevents the reception of any other characters. Setting the PCEN bit in the UART_CR2 register while LIN is in slave mode enables the Identifier parity check. The PE flag in the UART_CR6 register is set together with the LHDF flag in the UART_CR6 register if the Identifier parity is not correct. Response transmission (slave is the publisher of the response) In order to send n data bytes, the application must repeat following sequence n times: 1. Write data in the UART_DR register 2. Wait for the RXNE flag in the UART_SR register 3. Check for readback value by reading the UART_DR register Once response transmission is completed, software can set the RWU bit. Response reception (slave is the subscriber of the response) In order to receive n data bytes, the application must repeat following sequence n times: 1. Wait for the RXNE flag in the UART_SR register 2. Read the UART_DR register Once response reception is completed, software can set the RWU bit. |
|
リンク URL |
| 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 |