MCU Serial Communications Interface (SCI)
MC1321x Reference Manual, Rev. 1.6
Freescale Semiconductor
18-7
When a program detects that the receive data register is full (RDRF = 1), it gets the data from the receive
data register by reading SCIxD. The RDRF flag is cleared by reading SCIxS1 while RDRF = 1 and then
reading SCIxD. If the SCI is configured to operate in 9-bit Mode, an additional read to the SCIxC3 register
is required to clear RDRF
When polling is used, this sequence is naturally satisfied in the normal course of the user program. If
hardware interrupts are used, SCIxS1 must be read in the interrupt service routine (ISR). Normally, this is
done in the ISR anyway to check for receive errors, so the sequence is automatically satisfied.
The IDLE status flag includes logic that prevents it from getting set repeatedly when the RxD1 line
remains idle for an extended period of time. IDLE is cleared by reading SCIxS1 while IDLE = 1 and then
reading SCIxD. After IDLE has been cleared, it cannot become set again until the receiver has received at
least one new character and has set RDRF.
If the associated error was detected in the received character that caused RDRF to be set, the error flags
— noise flag (NF), framing error (FE), and parity error flag (PF) — get set at the same time as RDRF.
These flags are not set in overrun cases.
If RDRF was already set when a new character is ready to be transferred from the receive shifter to the
receive data buffer, the overrun (OR) flag gets set instead and the data and any associated NF, FE, or PF
condition is lost.
18.7
Additional SCI Functions
The following sections describe additional SCI functions.
18.7.1
8-Bit and 9-Bit Data Modes
The SCI system (transmitter and receiver) can be configured to operate in 9-bit Mode by setting the M
control bit in SCIxC1. In 9-bit Mode, there is a ninth data bit to the left of the MSB of the SCI data register.
For the transmit data buffer, this bit is stored in T8 in SCIxC3. For the receiver, the ninth bit is held in R8
in SCIxC3.
When transmitting 9-bit data, write to the T8 bit before writing to SCIxD for coherent writes to the transmit
data buffer. If the bit value to be transmitted as the ninth bit of a new character is the same as for the
previous character, it is not necessary to write to T8 again. When data is transferred from the transmit data
buffer to the transmit shifter, the value in T8 is copied at the same time data is transferred from SCIxD to
the shifter.
When receiving 9-bit data, clear the RDRF bit by reading both R8 and SCIxD. R8 and SCIxD can be read
in either order.
9-bit Mode typically is used in conjunction with parity to allow eight bits of data plus the parity in the ninth
bit. Or it is used with address-mark wakeup so the ninth data bit can serve as the wakeup bit. In custom
protocols, the ninth bit can also serve as a software-controlled marker.
Содержание freescale semiconductor MC13211
Страница 40: ...MC1321x Pins and Connections MC1321x Reference Manual Rev 1 6 2 6 Freescale Semiconductor...
Страница 100: ...MC1321x Serial Peripheral Interface SPI MC1321x Reference Manual Rev 1 6 4 24 Freescale Semiconductor...
Страница 166: ...Modem Modes of Operation MC1321x Reference Manual Rev 1 6 7 22 Freescale Semiconductor...
Страница 172: ...Modem Interrupt Description MC1321x Reference Manual Rev 1 6 8 6 Freescale Semiconductor...
Страница 186: ...MCU Modes of Operation MC1321x Reference Manual Rev 1 6 10 8 Freescale Semiconductor...
Страница 208: ...MCU Memory MC1321x Reference Manual Rev 1 6 11 22 Freescale Semiconductor...
Страница 244: ...MCU Parallel Input Output MC1321x Reference Manual Rev 1 6 13 20 Freescale Semiconductor...
Страница 288: ...MCU Central Processor Unit CPU MC1321x Reference Manual Rev 1 6 15 20 Freescale Semiconductor...
Страница 308: ...MCU Timer PWM TPM Module MC1321x Reference Manual Rev 1 6 17 16 Freescale Semiconductor...
Страница 338: ...Inter Integrated Circuit IIC MC1321x Reference Manual Rev 1 6 19 14 Freescale Semiconductor...
Страница 372: ...Development Support MC1321x Reference Manual Rev 1 6 21 20 Freescale Semiconductor...