| 数据搜索系统,热门电子元器件搜索 |
|
ZLP12840 数据表(PDF) 58 Page - Zilog, Inc. |
|
|
|||||||||||||||||||||||||||||
ZLP12840 数据表(HTML) 58 Page - Zilog, Inc. |
|
58 / 58 page ![]() PS024406-0106 P R E L I M I N A R Y Operation ZLP12840 OTP MCU Product Specification 47 Receiving Data Using the Polled Method Follow these steps to configure the UART for polled data reception: 1. Write to the BCNST register to set the appropriate baud rate. 2. Write to the UART control register (UCTL) to: a. Set the receive enable bit (UCTL[6]) to enable the UART for data reception b. Enable parity, if appropriate and select either even or odd parity 3. Check the receive status bit in the UART Status register, bit UST[7], to determine if the Receive Data register contains a valid data byte (indicated by a 1). If UST[7] is set to 1 to indicate available data, continue to Step 4. If the Receive Data register is empty (indicated by a 0), continue to monitor the UST[7] bit awaiting reception of the valid data. 4. Read data from the UART Receive Data register. 5. Return to Step 3 to receive additional data. Receiving Data Using the Interrupt-Driven Method The UART Receiver interrupt indicates the availability of new data (as well as error condi- tions). Follow these steps to configure the UART receiver for interrupt-driven operation: 1. Write to the UART BRG Constant registers to set the appropriate baud rate. 2. Execute a DI instruction to disable interrupts. 3. Write to the interrupt control registers to enable the UART receiver interrupt and set the appropriate priority. 4. Clear the UART Receiver interrupt in the applicable Interrupt Request register. 5. Write to the UART Control register (UCTL) to: a. Set the receive enable bit (UCTL[6]) to enable the UART for data reception b. Enable parity, if appropriate, and select either even or odd parity 6. Execute an EI instruction to enable interrupts. The UART is now configured for interrupt-driven data reception. When the UART Receiver interrupt is detected, the associated interrupt service routine (ISR) performs the following: 1. Checks the UART Status register to determine the source of the interrupt, whether it is an error, break, or received data. 2. Reads the data from the UART Receive Data register if the interrupt was caused by data available. 3. Clears the UART receiver interrupt in the applicable Interrupt Request register. |
|
链接网址 |
| 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 |