MC97F2664
168
April 11, 2014 Ver. 1.4
11.10.4 Data format
A serial frame is defined to be one character of data bits with synchronization bits (start and stop bits), and
optionally a parity bit for error detection.
The UART2/3/4 supports all 30 combinations of the following as valid frame formats.
- 1 start bit
- 5, 6, 7, 8 or 9 data bits
- no, even or odd parity bit
- 1 or 2 stop bits
A frame starts with the start bit followed by the least significant data bit (LSB). Then the next data bits, up to nine,
are succeeding, ending with the most significant bit (MSB). If parity function is enabled, the parity bit is inserted
between the last data bit and the stop bit. A high-to-low transition on data pin is considered as start bit.
When a
complete frame is transmitted, it can be directly followed by a new frame, or the communication line can be set to
an idle state. The idle means high state of data pin. The following figure shows the possible combinations of the
frame formats. Bits inside brackets are optional.
Figure 11.36 Frame Format
1 data frame consists of the following bits
•
Idle No communication on communication line (TxD/RxD)
•
St Start bit (Low)
•
Dn Data bits (0~8)
•
Parity bit ------------ Even parity, Odd parity, No parity
•
Stop bit(s) ---------- 1 bit or 2 bits
The frame format used by the UART2/3/4 is set by the UnSIZE[2:0], UnPM[1:0] and USBSn bits in UARTnCR1
and UARTnCR3 register. The Transmitter and Receiver use the same setting.
11.10.5 Parity bit
The parity bit is calculated by doing an exclusive-OR of all the data bits. If odd parity is used, the result of the
exclusive-or is inverted. The parity bit is located between the MSB and first stop bit of a serial frame.
P
even
= D
n-1
^ … ^ D
3
^ D
2
^ D
1
^ D
0
^ 0
P
odd
= D
n-1
^ … ^ D
3
^ D
2
^ D
1
^ D
0
^ 1
P
even
: Parity bit using even parity
P
odd
: Parity bit using odd parity
D
n
: Data bit n of the character
[D7]
[D6]
[D5]
D4
D3
D2
D1
D0
[D8]
[P]
Idle
St
Sp1
Sp2
Idle / St
1 data frame
Character
bits
Содержание MC97F2664
Страница 20: ...MC97F2664 20 April 11 2014 Ver 1 4 4 Package Diagram Figure 4 1 64 Pin LQFP 1010 Package...
Страница 21: ...MC97F2664 April 11 2014 Ver 1 4 21 Figure 4 2 64 Pin LQFP 1414 Package...
Страница 22: ...MC97F2664 22 April 11 2014 Ver 1 4 Figure 4 3 64 Pin QFN Package...
Страница 23: ...MC97F2664 April 11 2014 Ver 1 4 23 Figure 4 4 44 Pin MQFP 1010 Package...