21.07.2015 Views

M16C User Manual.pdf

M16C User Manual.pdf

M16C User Manual.pdf

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> / 62 GroupSINGLE-CHIP 16-BIT CMOS MICROCOMPUTERSelecting PWM mode and functionsb7011 1b0Timer Ai mode register (i=0 to 4) [Address 039616 to 039A16]1 1TAiMR (i=0 to 4)Selection of PWM mode1 (Must always be “1” in PWM mode)External trigger select bit1 : Rising edge of TAiIN pin's input signal (Note 1)Trigger select bit1 : Selected by event/trigger select register16/8-bit PWM mode select bit0 : Functions as a 16-bit pulse width modulatorCount source select bitb7 b60 0 : f10 1 : f81 0 : f3211 : fC32b7 b6 Countsource0 00 11 01 1f1f8f32fC32Note 1: Set the corresponding port directionregister to “0”.Count source periodf(XIN) : 16MHZ f(XcIN) : 32.768kHZ62.5ns500ns2µs976.56µsClearing timer Ai interrupt request bitb70b0Timer Ai interrupt control register [Address 005516 to 005916]TAiIC (i=0 to 4)Interrupt request bitRefer to 'Precaution for Timer A (pulse width modulation mode)'Setting event/trigger select bitb7 b0 b7 b0One-shot start flag [Address 038216]ONSFTimer A0 event/trigger select bitb7 b60 0 : Input on TA0IN is selected (Note 2)Note 2: Set the corresponding port direction register to “0”.Trigger select register [Address 038316]TRGSRTimer A1 event/trigger select bitb1 b00 0 : Input on TA1IN is selected (Note 2)Timer A2 event/trigger select bitb3 b20 0 : Input on TA2IN is selected (Note 2)Timer A3 event/trigger select bitb5 b40 0 : Input on TA3IN is selected (Note 2)Timer A4 event/trigger select bitb7 b60 0 : Input on TA4IN is selected (Note 2)Setting PWM pulse's “H” level width(b15)(b8)b7b0 b7b0Timer A0 register [Address 038716, 038616] TA0Timer A1 register [Address 038916, 038816] TA1Timer A2 register [Address 038B16, 038A16] TA2Timer A3 register [Address 038D16, 038C16]TA3Timer A4 register [Address 038F16, 038E16] TA4Can be set to 000016 to FFFE16Setting clock prescaler reset flag(This function is effective when fC32 is selected as the count source. Reset the prescaler for generating fC32 by dividing the XCIN by 32.)Clock prescaler reset flag [Address 038116]CPSRFb7b0Clock prescaler reset flag0 : No effect1 : Prescaler is reset (When read, the value is “0”)Setting count starts flagb7b0Count start flag [Address 038016]TABSRTimer A0 count start flagTimer A1 count start flagTimer A2 count start flagTimer A3 count start flagTimer A4 count start flagStart countFigure 2.2.25. Set-up procedure of pulse width modulation mode, 16-bit PWM mode selected305

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

Saved successfully!

Ooh no, something went wrong!