
Rev. 1.00
146
October 26, 2018
Rev. 1.00
147
October 26, 2018
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
BS86DH12C
High Voltage Touch A/D Flash MCU with HVIO
and status flags with bits TXEN, RXEN, TXBRK, RXIF, OERR, FERR, PERR and NF being cleared
while bits TIDLE, TXIF and RIDLE will be set. The remaining control bits in the UCR1, UCR2
and BRG registers will remain unaffected. If the UARTEN bit in the UCR1 register is cleared while
the UART is active, then all pending transmissions and receptions will be immediately suspended
and the UART will be reset to a condition as defined above. If the UART is then subsequently re-
enabled, it will restart again in the same configuration.
Data, Parity and Stop Bit Selection
The format of the data to be transferred is composed of various factors such as data bit length,
parity 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 PRTn 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, which is
the MSB of the data byte, identifies the frame as an address character or data if the address detect
function is enabled. The number of stop bits, which can be either one or two, is independent of the
data length and is only used for the transmitter. There is only one stop bit for the receiver.
Start Bit
Data Bits
Address Bit Parity Bit
Stop Bit
Example of 8-bit Data Formats
1
8
0
0
1
1
7
0
1
1
1
7
1
0
1
Example of 9-bit Data Formats
1
9
0
0
1
1
8
0
1
1
1
8
1
0
1
Transmitter Receiver Data Format
The following diagram shows the transmit and receive waveforms for both 8-bit and 9-bit data
formats.
Bit 0
8-bit Data Format
Bit 1
Stop
Bit
Next
Start
Bit
Start
Bit
Parity Bit
Bit 2
Bit 3
Bit 4
Bit 5
Bit 6
Bit 7
Bit 0
9-bit Data Format
Bit 1
Start
Bit
Bit 2
Bit 3
Bit 4
Bit 5
Bit 6
Stop
Bit
Next
Start
Bit
Parity Bit
Bit 8
Bit 7
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_RXR register. The data to be transmitted
is loaded into this TXR_RXR 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_RXR
register, if it is available. 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