English
Language : 

SH7050 Datasheet, PDF (370/841 Pages) Renesas Technology Corp – 32-Bit RISC Microcomputer SuperH RISC engine Family/
Section 11 Advanced Pulse Controller (APC)
11.3.2 Advanced Pulse Controller Output Operation
Example of Setting Procedure for Advanced Pulse Controller Output Operation: Figure 11.3
shows an example of the setting procedure for advanced pulse controller output operation.
1. Set general registers GR2A and GR2B as output compare registers with the timer I/O control
register (TIOR).
2. Set the pulse rise point with GR2A and the pulse fall point with GR2B.
3. Select the timer counter 2 (TCNT2) counter clock with the timer prescale register (PSCR).
TCNT2 can only be cleared by an overflow.
4. Enable the respective interrupts with the timer interrupt enable register (TIER).
5. Set the pins for 1 output and 0 output with POPCR.
6. Set the control register for the port to be used by the APC to the APC output pin function.
7. Set the STR bit to 1 in the timer start register (TSTR) to start timer counter 2 (TCNT2).
8. Each time a compare-match interrupt is generated, update the GR value and set the next pulse
output time.
9. Each time a compare-match interrupt is generated, update the POPCR value and set the next
pin for pulse output.
Rev. 5.00 Jan 06, 2006 page 350 of 818
REJ09B0273-0500