21.07.2015 Views

M16C User Manual.pdf

M16C User Manual.pdf

M16C User Manual.pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Timer AMitsubishi microcomputers<strong>M16C</strong> / 62 GroupSINGLE-CHIP 16-BIT CMOS MICROCOMPUTER2.2.12 Operation of Timer A (pulse width modulation mode, 8-bit PWM mode selected)In pulse width modulation mode, choose functions from those listed in Table 2.2.12. Operations of thecircled items are described below. Figure 2.2.26 shows the operation timing, and Figure 2.2.27 shows theset-up procedure.Table 2.2.12. Choosed functionsItemSet-upCount sourcePWM modeCount start conditionOOOInternal count source (f1 / f8 / f32 / fc32)16-bit PWM8-bit PWMExternal trigger input (falling edge of input signal to the TAiIN pin)External trigger input (rising edge of input signal to the TAiIN pin)Timer overflow (TB2/TAj/TAk overflow)Note: j = i – 1, but j = 4 when i = 0; k = i + 1, but k = 0 when i = 4.OperationNote(1) If the TAiIN pin input level changes from “H” to “L” with the count start flag set to “1”, the counterperforms a down count on the count source. Also, the TAiOUT pin outputs an “H” level.(2) The TAiOUT pin output level changes from “H” to “L” when a set time period elapses. At thistime, the timer Ai interrupt request bit goes to “1”.(3) The counter reloads the content of the reload register every time PWM pulses are output forone cycle, and continues counting.(4) Setting the count start flag to “0” causes the counter to hold its value and to stop. Also, theTAiOUT pin outputs an “L” level.• The period of PWM pulses becomes (m + 1) X (2 8 – 1) / fi, and the “H” level pulse widthbecomes n X (m + 1) / fi. If “0016” is set in the eight higher-order bits of the timer Ai register, thepulse width modulator does not work, and the the TAiOUT pin output level remains at “L”.(fi : frequency of the count source f1, f8, f32, fc32; n : value of the timer)• When a trigger is generated, the TAiout pin outputs “L” level of same amplitude as “H” level ofthe set PWM pulse, after which it starts PWM pulse output.Conditions:Reload register high-order 8 bits = 0216Reload register low-order 8 bits = 0216External trigger (falling edge of TAiIN pin input signal) is selected81 / fi X (m + 1) X (2 – 1)(4) Stop countCount source (Note 1)Count start flagTAiIN pin inputUnderflow signal of 8-bitprescaler (Note 2)PWM pulse output fromTAiOUT pinTimer Ai interruptrequest bit“1”“0”“H”“L”1 / fi X (m+1)“H”“L”“H”“L”“1”“0”(1) Start count (2) Output level “H” to “L”1 / fi X (m + 1) X nCleared to “0” when interrupt requestis accepted, or cleared by softwareNote 1: The 8-bit prescaler counts the count source.Note 2: The 8-bit pulse width modulator counts the 8-bit prescaler's underflow signal.Note 3: m = 0016 to FE16; n = 0016 to FE16.(3) One period iscompleteFigure 2.2.26. Operation timing of pulse width modulation mode, with 8-bit PWM mode selected306

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!