Rev. 1.20 130 January 23, 2015 Rev. 1.20 131 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
NotethattheUSRregisterflagsarereadonlyandcannotbeclearedorsetbytheapplication
program,neitherwilltheybeclearedwhentheprogramjumpstothecorrespondinginterrupt
servicingroutine,asisthecaseforsomeoftheotherinterrupts.Theflagswillbecleared
automaticallywhencertainactionsaretakenbytheUART,thedetailsofwhicharegiveninthe
UARTregistersection.TheoverallUARTinterruptcanbedisabledorenabledbytherelated
interruptenablecontrolbitsintheinterruptcontrolregistersofthemicrocontrollertodecidewhether
theinterruptrequestedbytheUARTmoduleismaskedoutorallowed.
Transmitter Empty
Flag TXIF
USR Register
Transmitter Idle
Flag TIDLE
Receiver Overrun
Flag OERR
Receiver Data
Available RXIF
ADDEN
RX Pin
Wake-up
WAKE
0
1
0
1
0
1
RX7 if BNO=0
RX8 if BNO=1
UCR2 Register
OR
RIE
0
1
TIIE
0
1
TEIE
0
1
UART Interrupt
Request Flag
UARTF
UCR2 Register
UARTE
INTC2
Register
EMI
INTC0
Register
UART Interrupt Scheme
Address Detect Mode
SettingtheAddressDetectModebit,ADDEN,intheUCR2register,enablesthisspecialmode.
IfthisbitisenabledthenanadditionalqualifierwillbeplacedonthegenerationofaReceiver
DataAvailableinterrupt,whichisrequestedbytheRXIFag.IftheADDENbitis"1",thenwhen
dataisavailable,aninterruptwillonlybegenerated,ifthehighestreceivedbithasahighvalue.
NotethattherelatedinterruptenablecontrolbitandtheEMIbitmustalsobeenabledforcorrect
interruptgeneration.Thishighestaddressbitisthe9thbitifBNObitis"1"orthe8thbitifBNO
bitis"0".Ifthisbitishigh,thenthereceivedwordwillbedenedasanaddressratherthandata.A
DataAvailableinterruptwillbegeneratedeverytimethelastbitofthereceivedwordisset.Ifthe
ADDENbitis"0",thenaReceiverDataAvailableinterruptwillbegeneratedeachtimetheRXIF
flagisset,irrespectiveofthedatalastbitstatus.Theaddressdetectmodeandparityenableare
mutuallyexclusivefunctions.Thereforeiftheaddressdetectmodeisenabled,thentoensurecorrect
operation,theparityfunctionshouldbedisabledbyresettingtheparityenablebitPRENtozero.
ADDEN Bit 9 if BNO=1, Bit 8 if BNO=0 UART Interrupt Generated
0
0 √
1 √
1
0 ×
1 √
ADDEN Bit Function