20.07.2015 Views

M16C/62 Group DATASHEET

M16C/62 Group DATASHEET

M16C/62 Group DATASHEET

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Timer AMitsubishi microcomputers<strong>M16C</strong> / <strong>62</strong> <strong>Group</strong>SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER(4) Pulse width modulation (PWM) modeIn this mode, the timer outputs pulses of a given width in succession. (See Table 1.17.5.) In this mode, thecounter functions as either a 16-bit pulse width modulator or an 8-bit pulse width modulator. Figure1.17.11 shows the timer Ai mode register in pulse width modulation mode. Figure 1.17.12 shows theexample of how a 16-bit pulse width modulator operates. Figure 1.17.13 shows the example of how an 8-bit pulse width modulator operates.Table 1.17.5. Timer specifications in pulse width modulation modeItemSpecificationCount sourcef1, f8, f32, fC32Count operation • The timer counts down (operating as an 8-bit or a 16-bit pulse width modulator)• The timer reloads a new count at a rising edge of PWM pulse and continues counting• The timer is not affected by a trigger that occurs when counting16-bit PWM • High level width n / fi n : Set value• Cycle time (2 16 -1) / fi fixed8-bit PWM • High level width n (m+1) / fi n : values set to timer Ai register’s high-order address• Cycle time (2 8 -1) (m+1) / fi m : values set to timer Ai register’s low-order addressCount start condition • External trigger is input• The timer overflows• The count start flag is set (= 1)Count stop condition • The count start flag is reset (= 0)Interrupt request generation timing PWM pulse goes “L”TAiIN pin function Programmable I/O port or trigger inputTAiOUT pin function Pulse outputRead from timer When timer Ai register is read, it indicates an indeterminate valueWrite to timer• When counting stoppedWhen a value is written to timer Ai register, it is written to both reloadregister and counter• When counting in progressWhen a value is written to timer Ai register, it is written to only reload register(Transferred to counter at next reload time)Timer Ai mode registerb7 b6 b5 b4 b3 b2 b1 b011 1Symbol Address When resetTAiMR(i=0 to 4) 039616 to 039A16 0016Bit symbol Bit nameTMOD0 Operation modeTMOD1 select bitMR0MR1MR2MR3TCK0TCK1Count source select bitb1 b01 1 : PWM mode0 0 : f10 1 : f81 0 : f321 1 : fC32Function1 (Must always be “1” in PWM mode)External trigger select 0: Falling edge of TAiIN pin's input signal (Note 2)bit (Note 1)1: Rising edge of TAiIN pin's input signal (Note 2)Trigger select bit16/8-bit PWM modeselect bit0: Count start flag is valid1: Selected by event/trigger select register0: Functions as a 16-bit pulse width modulator1: Functions as an 8-bit pulse width modulatorFigure 1.17.11. Timer Ai mode register in pulse width modulation modeb7 b6R WNote 1: Valid only when the TAiIN pin is selected by the event/trigger select bit(addresses 038216 and 038316). If timer overflow is selected, this bit can be “1” or “0”.Note 2: Set the corresponding port direction register to “0”.92

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

Saved successfully!

Ooh no, something went wrong!