HD643303x Hitachi, HD643303x Datasheet - Page 235

no-image

HD643303x

Manufacturer Part Number
HD643303x
Description
Hitachi Microcomputer
Manufacturer
Hitachi
Datasheet
8.4.3 Synchronization
The synchronization function enables two or more timer counters to be synchronized by writing
the same data to them simultaneously (synchronous preset). With appropriate TCR settings, two or
more timer counters can also be cleared simultaneously (synchronous clear). Synchronization
enables additional general registers to be associated with a single time base. Synchronization can
be selected for all channels (0 to 4).
Sample Setup Procedure for Synchronization: Figure 8-26 shows a sample procedure for
setting up synchronization.
1.
2.
3.
4.
5.
Set the SYNC bits to 1 in TSNC for the channels to be synchronized.
When a value is written in TCNT in one of the synchronized channels, the same value is
simultaneously written in TCNT in the other channels (synchronized preset).
Set the CCLR1 or CCLR0 bit in TCR to have the counter cleared by compare match or input capture.
Set the CCLR1 and CCLR0 bits in TCR to have the counter cleared synchronously.
Set the STR bits in TSTR to 1 to start the synchronized counters.
Setup for synchronization
Select synchronization
Synchronous preset
Synchronous preset
Write to TCNT
Figure 8-26 Setup Procedure for Synchronization (Example)
1
2
Select counter clear source
synchronized to this
Synchronous clear
Counter clear
Start counter
Clearing
channel?
220
Yes
3
5
No
Select counter clear source
Synchronous clear
Start counter
4
5

Related parts for HD643303x