1999 Oct 28
18
Philips Semiconductors
Product specification
8-bit microcontrollers with DTMF generator
and 128 bytes EEPROM
PCA3351C; 52C; 53C;
PCD3351A; 52A; 53A
7.5.5
E
RASE PAGE
The EEPROM flags are set as described in Section 7.5.1.
The corresponding page bytes are erased.
The last instruction also starts Timer 2. Erasure takes
5 ms.Asingle-byteeraseissimplyaspecialcaseof‘erase
page’.
Note that ADDR does not auto-increment after an erase
cycle.
Table 23
Erase page
7.6
Timer 2
Timer 2 is a 8-bit down-counter decremented at a rate of
1
480
×
f
xtal
. It may be used either for EEPROM timing or as
a general purpose timer. Conflicts between the two
applications should be carefully avoided.
7.6.1
T
IMER
2
FOR
EEPROM
TIMING
When used for EEPROM timing, Timer 2 serves to
generate the 5 ms intervals needed for erasing or writing
the EEPROM. At the decrement rate of
1
480
×
f
xtal
, the
reload value for a 5 ms interval is a function of f
xtal
.
Table 24 summarizes the required reload values for a
number of oscillator frequencies.
Timer 2 is started by setting bit EWP in the EPCR.
The TimerRegister T2isloadedwith thereload valuefrom
RELR. T2 decrements to zero.
For an erase/write cycle, underflow of T2 indicates the end
of the erase operation. Therefore, Timer Register T2 is
reloaded from RELR for another 5 ms interval during
which the flagged EEPROM latches are copied to the
corresponding bytes in the page addressed by ADDR.
INSTRUCTION
RESULT
MOVA, #EWP + MC3 + MC2 + MC1
‘erase page’
control word
start ‘erase
page’ cycle
MOV EPCR, A
The second underflow of an erase/write cycle and the first
underflow of write page and erase page conclude the
corresponding EEPROM cycle. Timer 2 is stopped, T2F is
set whereas EWP and MC1 to MC3 are cleared.
Table 24
Reload values as a function of f
xtal
Note
1.
The reload value is (5
×
10
3
×
1
480
×
f
xtal
)
1;
f
xtal
in MHz.
7.6.2
T
IMER
2
AS A GENERAL PURPOSE TIMER
When used for purposes other than EEPROM timing,
Timer 2 is started by setting STT2. The Timer Register T2
(see Table 27) is loaded with the reload value from RELR.
T2 decrements to zero. On underflow, T2 is reloaded from
RELR, T2F is set and T2 continues to decrement.
Timer 2 can be stopped at any time by clearing STT2.
The value of T2 is then held and can be read out. After
setting STT2 again, Timer 2 decrements from the reload
value. Alternatively, it is possible to read T2 ‘on the fly’ i.e.
while Timer 2 is operating.
f
xtal
(MHz)
RELOAD VALUE
(1)
(HEX)
1
2
0A
14
25
3E
68
A6
3.58
6
10
16