LCD Type MCU
Data, Parity and Stop Bit Selection
The format of the data to be transferred, is composed of various factors such as data bit length, par-
ity on/off, parity type, address bits and the number of stop bits. These factors are determined by
the setup of various bits within the UCR1 register. The BNO bit controls the number of data bits
which can be set to either 8 or 9, the PRT bit controls the choice of odd or even parity, the PREN bit
controls the parity on/off function and the STOPS bit decides whether one or two stop bits are to be
used. The following table shows various formats for data transmission. The address bit identifies
the frame as an address character. The number of stop bits, which can be either one or two, is inde-
pendent of the data length.
Start Bit
1
1
1
Data Bits
8
7
7
Address Bits
0
0
1
Parity Bits
0
1
0
Stops Bit
1
1
1
Example of 8-bit Data Formats
Example of 9-bit Data Formats
1
1
1
9
8
8
0
0
1
0
1
0
1
1
1
Transmitter Receiver Data Format
The following diagram shows the transmit and receive waveforms for both 8-bit and 9-bit data formats.
P a r ity B it
S ta r t B it
B it 0
B it 1
B it 2
B it 3
B it 4
B it 5
B it 6
B it 7
S to p B it
N e x t
S ta rt
B it
8 -B it D a ta F o r m a t
P a r ity B it
S ta r t B it
B it 0
B it 1
B it 2
B it 3
B it 4
B it 5
B it 6
B it 7
B it 8
S to p B it
N e x t
S ta rt
B it
9 -B it D a ta F o r m a t
UART Transmitter
Data word lengths of either 8 or 9 bits, can be selected by programming the BNO bit in the UCR1
register. When BNO bit is set, the word length will be set to 9 bits. In this case the 9th bit, which is
the MSB, needs to be stored in the TX8 bit in the UCR1 register. At the transmitter core lies the
Transmitter Shift Register, more commonly known as the TSR, whose data is obtained from the
transmit data register, which is known as the TXR register. The data to be transmitted is loaded
into this TXR register by the application program. The TSR register is not written to with new data
until the stop bit from the previous transmission has been sent out. As soon as this stop bit has
been transmitted, the TSR can then be loaded with new data from the TXR register, if it is avail-
able. It should be noted that the TSR register, unlike many other registers, is not directly mapped
into the Data Memory area and as such is not available to the application program for direct
read/write operations. An actual transmission of data will normally be enabled when the TXEN bit
is set, but the data will not be transmitted until the TXR register has been loaded with data and the
baud rate generator has defined a shift clock source. However, the transmission can also be initi-
ated by first loading data into the TXR register, after which the TXEN bit can be set. When a trans-
94
Home Index Bookmark Pages Text
Previous Next
Pages: Home Index