
Rev. 1.10
60
March 02, 2020
Rev. 1.10
61
March 02, 2020
BS83A02L/BS83B04L
Ultra-Low Power Touch Key Flash MCU
BS83A02L/BS83B04L
Ultra-Low Power Touch Key Flash MCU
Port A has the additional capability of providing wake-up functions. When the devices are in the
SLEEP or IDLE Mode, various methods are available to wake the devices up. One of these is a high
to low transition of any of the Port A pins. Single or multiple pins on Port A can be setup to have this
function.
Timer/Event Counter – BS83A02L
The provision of the Timer/Event Counter forms an important part of any microcontroller, giving
the designer a means of carrying out time related functions. The BS83A02L contains an 8-bit Timer/
Event Counter, which contains an 8-bit programmable count-up counter and the clock may come
from an external or internal clock source. As the timer has three different operating modes, it can
be configured to operate as a general timer, an external event counter or a pulse width measurement
device.
TM1
TM0
TC
TEG
Pulse Width
Measurement
Mode Control
TM1
TM0
TON
Overflow to interrupt
Reload
8-bit Timer/Event Counter
Preload Register
8-bit Timer/Event
Counter
Data bus
TPSC2~TPSC0
f
PSC
/2
0
~f
PSC
/2
7
Note: The Timer/Event Counter internal clocks are sourced from a prescaler, which is the f
PSC
clock divided by a
ratio of 2
0
to 2
7
. Refer to the Time Base Interrupt section for details on the f
PSC
clock
.
8-bit Timer/Event Counter
Timer/Event Counter Input Clock Source
The Timer/Event Counter clock source can originate from various sources, an internal clock or an
external pin. The internal clock source is used when the timer is in the Timer Mode and Pulse Width
Measurement Mode. For the Timer/Event Counter, this internal clock source is the divided version
of f
PSC,
which is selected by the TPSC2~TPSC0 bits in the TMRC Timer/Event Control Register.
An external clock source is used when the Timer/Event Counter is in the Event Counter Mode, the
clock source is provided on the external TC pin. Depending upon the condition of the TEG bit, each
high to low or low to high transition on the external timer pin will increase the counter by one.
Timer/Event Counter Registers
There are two registers related to the Timer/Event Counter. The first is the TMR register that
contains the actual value of the timer and into which an initial value can be preloaded. Writing to the
TMR register will transfer the specified data to the Timer/Event Counter. Reading the TMR register
will read the contents of the Timer/Event Counter. The second is the TMRC control register, which
is used to define the operating mode, control the counting enable or disable and select the active
edge.
Register
Name
Bit
7
6
5
4
3
2
1
0
TMRC
TM1
TM0
—
TON
TEG
TPSC2
TPSC1
TPSC0
TMR
D7
D6
D5
D4
D3
D2
D1
D0
Timer/Event Counter Register List