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 BMitsubishi microcomputers<strong>M16C</strong> / 62 GroupSINGLE-CHIP 16-BIT CMOS MICROCOMPUTER2.3.3 Operation of Timer B (event counter mode)In event counter mode, choose functions from those listed in Table 2.3.2. Operations of the circled items aredescribed below. Figure 2.3.6 shows the operation timing, and Figure 2.3.7 shows the set-up procedure.Table 2.3.2. Choosed functionsItemSet-upCount source O Input signal to the TBiIN pin (counting falling edges)Input signal to the TBiIN pin (counting rising edges)Input signal to the TBiIN pin (counting rising edges and falling edges)Timer overflow(TBj overflow)Note: j = i – 1, but j = 2 when i = 0,j = 5 when i = 3Operation(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 Bi interrupt request bit goes to “1”.(3) Setting the count start flag to “0” causes the counter to hold its value and to stop.n = reload register contentFFFF16(1) Start count (2) Underflow (3) Stop countnStart count again000016Set to “1” by softwareCleared to “0” bysoftwareTimeSet to “1” by softwarCount start flagTimer Bi interruptrequest bit“1”“0”“1”“0”Cleared to “0” when interrupt request is accepted, or cleared by softwareFigure 2.3.6. Operation timing of event counter mode318

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

Saved successfully!

Ooh no, something went wrong!