Rev. 1.0, 09/02, page 275 of 568
12.4.4
Example of Normal Pulse Output (Example of Five-Phase Pulse Output)
Figure 12.5 shows an example in which pulse output is used for cyclic five-phase pulse output.
TCNT value
TCNT
TGRA
H'0000
NDRH
00
80
C0
40
60
20
30
10
18
08
88
PODRH
PO15
PO14
PO13
PO12
PO11
Time
Compare match
C0
80
C0
80
40
60
20
30
10
18
08
88
80
C0
40
Figure 12.5 Normal Pulse Output Example (Five-Phase Pulse Output)
1. Set up TGRA of the TPU that is used as the output trigger to be an output compare register.
Set a frequency in TGRA so the counter will be cleared on compare match A. Set the TGIEA
bit of TIER to 1 to enable the compare match/input capture A (TGIA) interrupt.
2. Write H
′
F8 in P1DDR and NDERH, and set the G3CMS0, G3CMS1, G2CMS0, and G2CMS1
bits in PCR to select compare match in the TPU channel set up in the previous step to be the
output trigger. Write output data H
′
80 in NDRH.
3. When compare match A occurs, the NDRH contents are transferred to PODRH and output.
The TGIA interrupt handling routine writes the next output data (H
′
C0) in NDRH.
4. Five-phase overlapping pulse output (one or two phases active at a time) can be obtained
subsequently by writing H
′
40, H
′
60, H
′
20, H
′
30. H
′
10, H
′
18, H
′
08, H
′
88... at successive TGIA
interrupts. If the DTC is set for activation by this interrupt, pulse output can be obtained
without imposing a load on the CPU.
Содержание H8S/2627
Страница 22: ...Rev 1 0 09 02 page xx of xxxvi Index 565 ...
Страница 30: ...Rev 1 0 09 02 page xxviii of xxxiv ...
Страница 36: ...Rev 1 0 09 02 page xxxiv of xxxiv Table 23 9 Flash Memory Characteristics 561 ...
Страница 82: ...Rev 1 0 09 02 page 46 of 568 ...
Страница 88: ...Rev 1 0 09 02 page 52 of 568 ...
Страница 98: ...Rev 1 0 09 02 page 62 of 568 ...
Страница 156: ...Rev 1 0 09 02 page 120 of 568 ...
Страница 390: ...Rev 1 0 09 02 page 354 of 568 ...
Страница 480: ...Rev 1 0 09 02 page 444 of 568 ...
Страница 512: ...Rev 1 0 09 02 page 476 of 568 ...
Страница 527: ...Rev 1 0 09 02 page 491 of 568 21 8 5 Writing to MSTPCR MSTPCR should only be written to by the CPU ...
Страница 528: ...Rev 1 0 09 02 page 492 of 568 ...
Страница 580: ...Rev 1 0 09 02 page 544 of 568 ...