English
Language : 

3069RF-ZTAT Datasheet, PDF (454/1003 Pages) Renesas Technology Corp – RENESAS 16-BIT SINGLE-CHIP MICROCOMPUTER
11.3.3 Normal TPC Output
Sample Setup Procedure for Normal TPC Output: Figure 11.4 shows a sample procedure for
setting up normal TPC output.
16-bit timer
setup
Port and
TPC setup
16-bit timer
setup
Normal TPC output
Select GR functions
Set GRA value
Select counting operation
Select interrupt request
Set initial output data
Select port output
Enable TPC output
Select TPC output trigger
Set next TPC output data
Start counter
[1] [1] Set TIOR to make GRA an output compare
register (with output inhibited).
[2] [2] Set the TPC output trigger period.
[3] Select the counter clock source with bits
TPSC2 to TPSC0 in TCR. Select the counter
[3]
clear source with bits CCLR1 and CCLR0.
[4] Enable the IMFA interrupt in TISRA.
[4]
The DMAC can also be set up to transfer
data to the next data register.
[5] Set the initial output values in the DR bits
[5]
of the input/output port pins to be used for
TPC output.
[6] [6] Set the DDR bits of the input/output port
pins to be used for TPC output to 1.
[7] [7] Set the NDER bits of the pins to be used for
TPC output to 1.
[8] Select the 16-bit timer compare match event
[8]
to be used as the TPC output trigger in TPCR.
[9] Set the next TPC output values in the NDR bits.
[9] [10] Set the STR bit to 1 in TSTR to start the
timer counter.
[11] At each IMFA interrupt, set the next output
[10]
values in the NDR bits.
No
Compare match?
Yes
Set next TPC output data
[11]
Figure 11.4 Setup Procedure for Normal TPC Output (Example)
Rev. 5.0, 09/04, page 432 of 978