Rev. 1.20 124 January 23, 2015 Rev. 1.20 125 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
TXR_RXR register
TheTXR_RXRnregisteristhedataregisterwhichisusedtostorethedatatobetransmittedonthe
TXnpinorbeingreceivedfromtheRXnpin.
Bit 7 6 5 4 3 2 1 0
Name TXRX7 TXRX6
TXRX5 TXRX4 TXRX3 TXRX2 TXRX1 TXRX0
R/W R/W R/W R/W R/W R/W R/W R/W R/W
POR x x x x x x x x
"x
" unknown
Bit7~0 TXRX7~TXRX0:UARTTransmit/ReceiveDatabit7~bit0
Baud Rate Generator
Tosetupthespeedoftheserialdatacommunication,theUARTfunctioncontainsitsowndedicated
baudrategenerator.Thebaudrateiscontrolledbyitsowninternalfreerunning8-bittimer,theperiod
ofwhichisdeterminedbytwofactors.Therstoftheseisthevalueplacedinthebaudrateregister
BRGandthesecondisthevalueoftheBRGHbitwiththecontrolregisterUCR2.TheBRGHbit
decidesifthebaudrategeneratoristobeusedinahighspeedmodeorlowspeedmode,whichin
turndeterminestheformulathatisusedtocalculatethebaudrate.ThevalueintheBRGregister,N,
whichisusedinthefollowingbaudratecalculationformuladeterminesthedivisionfactor.Notethat
NisthedecimalvalueplacedintheBRGregisterandhasarangeofbetween0and255.
UCR2 BRGH Bit 0 1
Baud Rate (BR) f
SYS
/ [64 (N+1)] f
SYS
/ [16 (N+1)]
ByprogrammingtheBRGHbitwhichallowsselectionoftherelatedformulaandprogrammingthe
requiredvalueintheBRGregister,therequiredbaudratecanbesetup.Notethatbecausetheactual
baudrateisdeterminedusingadiscretevalue,N,placedintheBRGregister,therewillbeanerror
associatedbetweentheactualandrequestedvalue.ThefollowingexampleshowshowtheBRG
registervalueNandtheerrorvaluecanbecalculated.
BRG Register
Bit 7 6 5 4 3 2 1 0
Name BRG7 BRG6
BRG5 BRG4 BRG3 BRG2 BRG1 BRG0
R/W R/W R/W R/W R/W R/W R/W R/W R/W
POR x x x x x x x x
"x
" unknown
Bit7~0 BRG7~BRG0:BaudRatevalues
ByprogrammingtheBRGHbitinUCR2Registerwhichallowsselectionofthe
relatedformuladescribedaboveandprogrammingtherequiredvalueintheBRG
register,therequiredbaudratecanbesetup.