
rej05b0069_m16cap| Application Note
APPLICATION NOTE M16C/62A Group
Variable-Period Variable-Duty PWM Output
1.0 Abstract
In this process, Timer A0 and A1 are used to generate variable-period, variable-duty PWM output. Use the following peripheral function: Timer mode of timer A One-shot timer mode of timer A
2.0 Introduction
Specifications (1) Set timer A0 in timer mode, and set timer A1 in one-shot timer mode with pulse-output function. (2) Set 1 ms, the PWM period, to timer A0. Set 500 us, the width of PWM "H" pulse, to timer A1. Both timer A0 and timer A1 use f1 for the count source. (3) Connect a 16-MHz oscillator to XIN. Operation (1) Setting the count start flag to "1" causes the counter of timer A0 to begin counting. The counter of timer A0 performs a down count on count source f1. (2) If the counter of timer A0 underflows, the counter reloads the content of the reload register and continues counting. At this time, the timer A0 interrupt request bit goes to "1". (3) An underflow in timer A0 triggers the counter of timer A1 and causes it to begin counting. When the counter of timer A1 begins counting, the output level of the TA1OUT pin goes to "H". (4) As soon as the count of the counter of timer A1 becomes "000016", the output level of TA1OUT pin goes to "L", and the counter reloads the content of the reload register and
stops counting. At the same time, the timer A1 interrupt request bit goes to "1".
REJ05B0069-0100Z
May 2003
Page 1 of 7
rej05b0069_m16cap Application Note renesas Download PDF
Add this permalink to your bookmarks for future download of rej05b0069_m16cap ApplicationNote
Permalink: http://application.emcelettronica.com/renesas/rej05b0069_m16cap