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 event counter mode and functionsb710 0 0 0b00 1Timer Ai mode register (i=0 to 4) [Address 039616 to 039A16]TAiMR (i=0 to 4)Selection of event counter modePulse output function select bit0 : Pulse is not output (TAiOUT pin is a normal port pin)Count polarity select bit0 : Counts external signal's falling edgeUp/down switching cause select bit0 : Up/down flag's content0 (Must always be “0” in event counter mode)Count operation type select bit1 : Free-run typeInvalid in event counter mode (i = 0, 1)Invalid when not using two-phase pulse signal processing(i = 2 to 4)Setting up/down flagb7b00 0 0Up/down flag [Address 038416]UDFTimer A0 up/down flag0 : Down countTimer A1 up/down flag0 : Down countTimer A2 up/down flag0 : Down countTimer A3 up/down flag0 : Down countTimer A4 up/down flag0 : Down countWhen not using the 2-phase pulse signal processing function, be sure to set the select bit to “0”.Setting one-shot start flag and trigger select registerb7b0One-shot start flag [Address 038216]ONSFTimer A0 event/trigger select bitb7 b60 0 : Input on TA0IN is selected (Note)b7b0Trigger select register [Address 038316]TRGSRTimer A1 event/trigger select bitb1 b00 0 : Input on TA1IN is selected (Note)Timer A2 event/trigger select bitb3 b20 0 : Input on TA2IN is selected (Note)Timer A3 event/trigger select bitb5 b40 0 : Input on TA3IN is selected (Note)Note: Set the corresponding port direction register to “0”.Timer A4 event/trigger select bitb7 b60 0 : Input on TA4IN is selected (Note)Setting divide ratio(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 FFFF16Setting count start 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.15. Set-up procedure of event counter mode, free run type selected295

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

Saved successfully!

Ooh no, something went wrong!