Rev. 1.20 118 January 23, 2015 Rev. 1.20 119 January 23, 2015
BS82B12A-3/BS82C16A-3/BS82D20A-3
Touch Key 8-Bit Flash MCU with LED/LCD Driver
BS82B12A-3/BS82C16A-3/BS82D20A-3
Touch Key 8-Bit Flash MCU with LED/LCD Driver
UART Data Transfer Scheme
TheblockdiagramshowstheoveralldatatransferstructurearrangementfortheUARTinterface.
TheactualdatatobetransmittedfromtheMCUisfirsttransferredtotheTXRregisterbythe
applicationprogram.ThedatawillthenbetransferredtotheTransmitShiftRegisterfromwhereit
willbeshiftedout,LSBrst,ontotheTXpinataratecontrolledbytheBaudRateGenerator.Only
theTXRregisterismappedontotheMCUDataMemory,theTransmitShiftRegisterisnotmapped
andisthereforeinaccessibletotheapplicationprogram.
DatatobereceivedbytheUARTisacceptedontheexternalRXpin,fromwhereitisshiftedin,
LSBfirst,totheReceiverShiftRegisterataratecontrolledbytheBaudRateGenerator.When
theshiftregisterisfull,thedatawillthenbetransferredfromtheshiftregistertotheinternalRXR
register,whereitisbufferedandcanbemanipulatedbytheapplicationprogram.OnlytheRXR
registerismappedontotheMCUDataMemory,theReceiverShiftRegisterisnotmappedandis
thereforeinaccessibletotheapplicationprogram.
Itshouldbenotedthattheactualregisterfordatatransmissionandreception,althoughreferredto
inthetext,andinapplicationprograms,asseparateTXRandRXRregisters,onlyexistsasasingle
sharedregisterintheDataMemory.ThissharedregisterknownastheTXR_RXRregisterisused
forbothdatatransmissionanddatareception.
MSB LSB
…………………………
Transmitter Shift Register
MSB
LSB
…………………………
Receiver Shift Register
TX Pin RX Pin
Baud Rate
Generator
TXR Register
RXR Register
Buffer
MCU Data Bus
CLK CLK
UART Data Transfer Scheme
UART Status and Control Registers
TherearevecontrolregistersassociatedwiththeUARTfunction.TheUSR,UCR1andUCR2
registerscontroltheoverallfunctionoftheUART,whiletheBRGregistercontrolstheBaudrate.
TheactualdatatobetransmittedandreceivedontheserialinterfaceismanagedthroughtheTXR_
RXRdataregister.
Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
USR PERR NF FERR OERR RIDLE RXIF TIDLE TXIF
UCR1 UARTEN BNO PREN PRT STOPS TXBRK RX8 TX8
UCR2 TXEN RXEN BRGH ADDEN WAKE RIE TIIE TEIE
TXR_RXR TXRX7 TXRX6
TXRX5 TXRX4 TXRX3 TXRX2 TXRX1 TXRX0
BRG BRG7 BRG6 BRG5 BRG4 BRG3 BRG2 BRG1 BRG0
UART Register List