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.

Counter content (hex)Timer AMitsubishi microcomputers<strong>M16C</strong> / 62 GroupSINGLE-CHIP 16-BIT CMOS MICROCOMPUTER2.2.6 Operation of Timer A (event counter mode, free run type selected)In event counter mode, choose functions from those listed in Table 2.2.5. Operations of the circled itemsare described below. Figure 2.2.14 shows the operation timing, and Figure 2.2.15 shows the set-upprocedure.Table 2.2.5. 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 = 0Operation(1) Setting the count start flag to “1” causes the counter to count the falling edges of the countsource.(2) Even if an underflow occurs, the content of the reload register is not reloaded, but the countcontinues. 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) Even if an overflow occurs, the content of the reload register is not reloaded, but the countcontinues. At this time, the timer Ai interrupt request bit goes to “1”.n = reload register content(2) Underflow(3) Switch count(4) OverflowFFFF16(1) Start countn000016TimeCount start flagUp/down flagTimer Ai interruptrequest bit“1”“0”“1”“0”“1”“0”Set to “1” by softwareSet to “1” by softwareCleared to “0” when interrupt request is accepted, or cleared by softwareFigure 2.2.14. Operation timing of event counter mode, free run type selected294

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

Saved successfully!

Ooh no, something went wrong!