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 A ApplicationsMitsubishi microcomputers<strong>M16C</strong> / 62 GroupSINGLE-CHIP 16-BIT CMOS MICROCOMPUTERInitialization of timer A0b7b00 0 0 0 0 0 0 1Timer A0 mode registerTA0MR [Address 039616 ]Selection of event counter modePulse output function select bit0 : Pulse is not output (TA0out 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 bit0 : Reload type0 (Must always be “0” in event counter mode)b15 b8 b7 b00016 0016b7b0Timer A0 registerTA0 [Address 038716, 038616]b7b70 0b00b0Up/down flag [Address 038416]UDFTimer A0 up/down flag0 : Down countOne shot start flag [Address 038216]ONSFTimer A0 event/trigger select flagb7 b60 0 : Input on TA0IN is selectedb7b01Count start flag [Address 038016]TABSRTimer A0 count start flag1 : Starts countingSetting interrupt priority levels in timer A0b7b0Timer A0 interrupt control register [Address 005516]TA0ICInterrupt control level (set a value 1 to 7)Initialization of port P7 direction registerb70b0Port P7 direction register [Address 03EF16]PD7Port P71 direction register0 : Input modeSetting interrupt enable flag (I flag)Figure 3.5.1. Set-up procedure of solution for a shortage of external interrupt pins471

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

Saved successfully!

Ooh no, something went wrong!