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.

Counter content (hex)Timer AMitsubishi microcomputers<strong>M16C</strong> / 62 GroupSINGLE-CHIP 16-BIT CMOS MICROCOMPUTER2.2.5 Operation of Timer A (event counter mode, reload type selected)In event counter mode, choose functions from those listed in Table 2.2.4. Operations of the circled itemsare described below. Figure 2.2.12 shows the operation timing, and Figure 2.2.13 shows the set-upprocedure.Table 2.2.4. Choosed functionsItemSet-upItemSet-upCount sourceOInput signal to TAiIN(counting falling edges)Pulse output functionONo pulses outputPulses outputInput signal to TAiIN(counting rising edges)Count operation typeOReload typeFree-run typeTimer overflow(TB2/TAj overflow)Factor for switchingbetween up anddownOContent of up/down flagInput signal to TAiOUTNote: j = i – 1, but j = 4 when i = 0.Operation(1) Setting the count start flag to “1” causes the counter to count the falling edges of the countsource.(2) If an underflow occurs, the content of the reload register is reloaded, and the count continues.At this time, the timer Ai interrupt request bit goes to “1”.(3) If switching from an up count to a down count or vice versa while a count is in progress, theswitch takes effect from the next effective edge of the count source.(4) Setting the count start flag to “0” causes the counter to hold its value and to stop.(5) If an overflow occurs, the content of the reload register is reloaded, and the count continues.At this time, the timer Ai interrupt request bit goes to “1”.FFFF16nn = reload register content(1) Start count(3) Switch count(2) Underflow (5) Overflow(4) Stop countStart count againCount start flagUp/down flag000016“1”“0”“1”“0”Set to “1” by softwareSet to “1” by softwareCleared to “0” bysoftwareSet to “1” by softwareTimeCleared to “0” when interrupt request is accepted, or cleared by softwareTimer Ai interruptrequest bit“1”“0”Figure 2.2.12. Operation timing of event counter mode, reload type selected292

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

Saved successfully!

Ooh no, something went wrong!