Rev. 1.20 4 January 23, 2015 Rev. 1.20 5 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
TM External Pins ................................................................................................................... 70
TM Input/Output Pin Control Register ................................................................................... 70
Programming Considerations ................................................................................................ 73
Compact Type TM – CTM0 ............................................................................ 74
Compact TM Operation ......................................................................................................... 74
Compact Type TM Register Description................................................................................ 75
Compact Type TM Operating Modes .................................................................................... 79
Compare Match Output Mode ............................................................................................... 79
Timer/Counter Mode ............................................................................................................. 82
PWM Output Mode ................................................................................................................ 82
Periodic Type TM – PTM0 .............................................................................. 85
Periodic TM Operation .......................................................................................................... 85
Periodic Type TM Register Description ................................................................................. 86
Periodic Type TM Operating Modes ...................................................................................... 90
Compare Match Output Mode ............................................................................................... 90
Timer/Counter Mode ............................................................................................................. 93
PWM Output Mode ................................................................................................................ 93
Single Pulse Mode ................................................................................................................ 95
Capture Input Mode .............................................................................................................. 97
Touch Key Function ...................................................................................... 99
Touch Key Structure .............................................................................................................. 99
Touch Key Register Denition
............................................................................................... 99
Touch Key Operation ........................................................................................................... 104
Touch Key Interrupt ............................................................................................................. 107
Programming Considerations .............................................................................................. 107
I
2
C Interface ................................................................................................. 108
I
2
C Interface Operation ....................................................................................................... 108
I
2
C Registers ....................................................................................................................... 109
I
2
C Bus Communication ......................................................................................................112
I
2
C Bus Start Signal .............................................................................................................113
Slave Address .....................................................................................................................113
I
2
C Bus Read/Write Signal ..................................................................................................114
I
2
C Bus Slave Address Acknowledge Signal .......................................................................114
I
2
C Bus Data and Acknowledge Signal ...............................................................................114
I
2
C Time-out Control .............................................................................................................116
UART Interface .............................................................................................117
UART External Pin Interfacing .............................................................................................117
UART Data Transfer Scheme...............................................................................................118
UART Status and Control Registers.....................................................................................118
Baud Rate Generator .......................................................................................................... 124
Calculating the Baud Rate and Error Values ....................................................................... 125
UART Setup and Control..................................................................................................... 125
UART Transmitter................................................................................................................ 127
UART Receiver ................................................................................................................... 128