English
Language : 

C509-L_97 Datasheet, PDF (140/290 Pages) Siemens Semiconductor Group – 8-Bit CMOS Microcontroller
On-Chip Peripheral Components
C509-L
Summary of the TOC loading capability :
– The CMx registers are - when assigned to the compare timer - protected from direct loading
by the CPU. A register latch couple provides a defined load time at timer overflow.
– Thus, the CPU has a full timer period to load a new compare value: there is no danger of
overwriting compare values which are still needed in the current timer period.
– When writing a 16-bit compare value, the high byte should be written first since the write-to-
low-byte instruction enables a 16-bit wide TOC loading at next timer overflow.
– lf there was no write access to a CMx low byte then no TOC loading will take place.
– Because of the TOC loading, all compare values written to CMx registers are only activated
in the next timer period.
Initializing the Compare Register/Compare Latch Circuit
Normally when the compare function is desired the initialization program would just write to the
compare register (called ’register latch’). The compare latch itself cannot be accessed directly by a
move instruction, it is exclusively loaded by the timer overflow signal.
In some very special cases, however, an initial loading of the compare latch could be desirable. lf
the following sequence is observed during initialization then latches, the register and the compare
latch, can be loaded before the compare mode is enabled.
Action:
Comment:
Select compare mode 1 (CMSEL.x = 0).
This is also the default value after reset.
Move the compare value for the first timer
period to the compare register CMx (high
byte first).
In compare mode 1 latch is loaded directly
after a write-to-CMLx. Thus the value slips
directly into the compare latch.
Switch on compare mode 0 (CMSEL.x = 1).
Now select the right compare mode.
Move the compare value for the second
timer period to the compare register.
The register latch is loaded. This value is
used after the first timer overflow.
Enable the compare function
(CMEN.x = 1)
Set up the prescaler for the compare timer.
Set specific compare output to low level
(CLR P4.x)
The compare output is switched to low level.
Start the compare timer with a desired value
(write-to-CTREL)
Compare function is initialized.
The output will oscillate.
Semiconductor Group
6-62
1997-10-01