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 BMitsubishi microcomputers<strong>M16C</strong> / 62 GroupSINGLE-CHIP 16-BIT CMOS MICROCOMPUTERTimer BFigure 1.17.14 shows the block diagram of timer B. Figures 1.17.15 and 1.17.16 show the timer B-relatedregisters.Use the timer Bi mode register (i = 0 to 5) bits 0 and 1 to choose the desired mode.Timer B has three operation modes listed as follows:• Timer mode: The timer counts an internal count source.• Event counter mode: The timer counts pulses from an external source or a timer overflow.• Pulse period/pulse width measuring mode: The timer measures an external signal's pulse period orpulse width.Data bus high-order bitsClock source selectionf1f8f32fC32• Timer• Pulse period/pulse width measurement• Event counterData bus low-order bitsLow-order 8 bitsReload register (16)Counter (16)High-order 8 bitsTBiIN(i = 0 to 5)Polarity switchingand edge pulseCan be selected in onlyevent counter modeTBj overflow(j = i – 1. Note, however,j = 2 when i = 0,j = 5 when i = 3)Count start flag(address 038016)Counter reset circuitTBi Address TBjTimer B0 039116 039016 Timer B2Timer B1 039316 039216 Timer B0Timer B2 039516 039416 Timer B1Timer B3 035116 035016 Timer B5Timer B4 035316 035216 Timer B3Timer B5 035516 035416 Timer B4Figure 1.17.14. Block diagram of timer BTimer Bi mode registerb7 b6 b5 b4 b3 b2 b1 b0Symbol Address When resetTBiMR(i = 0 to 5) 039B16 to 039D16 00XX00002035B16 to 035D16 00XX00002Bit symbolTMOD0TMOD1MR0MR1MR2Bit nameOperation mode select bitFunction varies with each operation modeFunctionb1 b00 0 : Timer mode0 1 : Event counter mode1 0 : Pulse period/pulse widthmeasurement mode1 1 : InhibitedR W(Note 1) MR3TCK0TCK1Count source select bit(Function varies with each operation mode)Note 1: Timer B0, timer B3.Note 2: Timer B1, timer B2, timer B4, timer B5.(Note 2) Figure 1.17.15. Timer B-related registers (1)95

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

Saved successfully!

Ooh no, something went wrong!