46
Data Sheet
FlashFlex51 MCU
SST89E52RD2/RD / SST89E54RD2/RD / SST89E58RD2/RD
SST89V52RD2/RD / SST89V54RD2/RD / SST89V58RD2/RD
2006 Silicon Storage Technology, Inc.
S71255-05-000
5/06
8.0 PROGRAMMABLE COUNTER ARRAY
The Programmable Counter Array (PCA) present on the
SST89E/V5xRD2/RD is a special 16-bit timer that has five
16-bit capture/compare modules. Each of the modules can
be programmed to operate in one of four modes: rising
and/or falling edge capture, software timer, high-speed out-
put, or pulse width modulator. The 5th module can be pro-
grammed as a Watchdog Timer in addition to the other four
modes. Each module has a pin associated with it in port 1.
Module 0 is connected to P1.3 (CEX0), module 1 to P1[4]
(CEX1), module 2 to P1[5] (CEX2), module 3 to P1[6]
(CEX3), and module 4 to P1[7] (CEX4). PCA configuration
8.1 PCA Overview
PCA provides more timing capabilities with less CPU inter-
vention than the standard timer/counter. Its advantages
include reduced software overhead and improved accuracy.
The PCA consists of a dedicated timer/counter which
serves as the time base for an array of five compare/cap-
ture modules.
Figure 8-1 shows a block diagram of the
PCA. External events associated with modules are shared
with corresponding Port 1 pins. Modules not using the port
pins can still be used for standard I/O.
Each of the five modules can be programmed in any of the
following modes:
Rising and/or falling edge capture
Software timer
High speed output
Watchdog Timer (Module 4 only)
Pulse Width Modulator (PWM)
8.2 PCA Timer/Counter
The PCA timer is a free-running 16-bit timer consisting of
registers CH and CL (the high and low bytes of the count
values). The PCA timer is common time base for all five
modules and can be programmed to run at: 1/6 the oscilla-
tor frequency, 1/2 the oscillator frequency, Timer 0 overflow,
or the input on the ECI pin (P1.2). The timer/counter source
is determined from the CPS1 and CPS0 bits in the CMOD
FIGURE
8-1: PCA Timer/Counter and Compare/Capture Modules
TABLE
8-1: PCA Timer/Counter Source
CPS1
CPS0
12 Clock Mode
6 Clock Mode
00
fOSC /12
fOSC /6
01
fOSC /4
fOSC /2
1
0
Timer 0 overflow
1
External clock at ECI pin
(maximum rate = fOSC /8)
External clock at ECI pin
(maximum rate = fOSC /4)
T8-1.0 1255
Module 0
Module 1
Module 2
Module 3
Module 4
PCA Timer/Counter
1255 F23.0
P1.7/CEX4
P1.6/CEX3
P1.5/CEX2
P1.4/CEX1
P1.3/CEX0
16 Bits
16 Bits Each