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.10 Operation of Timer A (one-shot timer mode, external trigger selected)In one-shot timer mode, choose functions from those listed in Table 2.2.10. Operations of the circleditems are described below. Figure 2.2.22 shows the operation timing, and Figure 2.2.23 shows the set-upprocedure.Table 2.2.10. Choosed functionsItemSet-upCount source O Internal count source (f1 / f8 / f32 / fc32)Pulse output function No pulses outputO Pulses outputCount start condition External trigger input (falling edge of input signal to the TAiIN pin)O External trigger input (rising edge of input signal to the TAiIN pin)Timer overflow (TB2/TAj/TAk overflow)Writing “1” to the one-shot start flagNote: j = i – 1, but j = 4 when i = 0; k = i + 1, but k = 0 when i = 4.Operation(1) If the TAiIN pin input level changes from “L” to “H” with the count start flag set to “1”, thecounter performs a down count on the count source. At this time, the TAiOUT pin output levelgoes to “H” level.(2) If the value of the counter becomes “000016”, the TAiOUT pin outputs an “L” level, and thecounter reloads the content of the reload register and stops counting. At this time, the timer Aiinterrupt request bit goes to “1”.(3) If a trigger occurs while a count is in progress, the counter reloads the value of the reloadregister again and continues counting. The reload timing is in step with the next count sourceinput after the trigger.(4) Setting the count start flag to “0” causes the counter to stop and to reload the content of thereload register. Also, the TAiOUT pin outputs an “L” level. At this time, the timer Ai interruptrequest bit goes to “1”.FFFF16nn = reload register content(2) Stop count(1) Start count (3) Start countStart count(4) Stop countReloadReloadReload000116Set to “1” by softwareCleared to “0” by softwareTimeCount start flag“1”“0”Trigger during countTAiIN pininput signalOne-shot pulse outputfrom TAiOUT pin“H”“L”“H”“L”1 / fi X (n)1 / fi X (n+1)Timer Ai interruptrequest bit“1”“0”Cleared to “0” when interrupt request is accepted, or cleared by softwareFigure 2.2.22. Operation timing of one-shot mode, external trigger selected302

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

Saved successfully!

Ooh no, something went wrong!