| 전자부품 데이터시트 검색엔진 |
|
AN1753 데이터시트(PDF) 10 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN1753 데이터시트(HTML) 10 Page - STMicroelectronics |
|
10 / 22 page ![]() UART implementation AN1753 10/22 DocID9986 Rev 2 4.3 Status handling To keep track of the status during a program execution, the software uses the “sci_status” variable. Bits 0-4 of this variable are used to hold the system status. Definition of each flag: SP: Reception mode sampling phase BR: Byte Received flag RE: Reception Enable BS: Byte Sent flag TE: Transmission Enable 4.4 Transmit and receive implementation The transmission mode gets executed after power on. To transmit data, the program uses port pin PA3 in output mode with the “Output Compare” interrupt. One bit is transmitted during each interrupt, generated after a bit delay when the 12-bit upcounter (CNTR) reaches the value (=1 bit delay) stored in the DCR0H and DCR0L registers. For a duty cycle register (DCR0L/DCR0H), the value depends on the required baud rate and clock frequency. For receive mode, the program uses port pin PA7 in input mode along with its interrupt and output compare functions. To sense the start bit, the “ei1” interrupt is used and configured as “Falling edge only”. In this interrupt routine, the program sets the ATR - the output compare value for a half bit delay(a) - and disables the “ei1” interrupt to use PA7 in normal input mode, in order to receive the entire frame. This half bit delay is used to sample a bit in the middle of it. After receiving a start bit in an output compare interrupt, the same interrupt routine gets executed each time a bit must be received. To receive each bit correctly, the majority-voting system is implemented in this interrupt routine. The interrupt strategy used in the software to transmit and receive allows other applications to work at the same time. Note: Error handling: This program does not handle communication errors (e.g. Frame Errors). No handshaking is implemented. For better performance at high baud rates, it is recommended to use character transmission rather than string transmission. SP BR RE BS TE a. The user can adjust this value depending on the baud rate. |
|
|
링크 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 |