20.07.2015 Views

M16C/62 Group DATASHEET

M16C/62 Group DATASHEET

M16C/62 Group DATASHEET

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> / <strong>62</strong> <strong>Group</strong>SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER(2) Event counter modeIn this mode, the timer counts an external signal or an internal timer's overflow. (See Table 1.17.7.)Figure 1.17.18 shows the timer Bi mode register in event counter mode.Table 1.17.7. Timer specifications in event counter modeItemSpecificationCount source• External signals input to TBiIN pin• Effective edge of count source can be a rising edge, a falling edge, or fallingand rising edges as selected by softwareCount operation• Counts down• When the timer underflows, it reloads the reload register contents beforecontinuing countingDivide ratio 1/(n+1) n : Set valueCount start condition Count start flag is set (= 1)Count stop condition Count start flag is reset (= 0)Interrupt request generation timing The timer underflowsTBiIN pin function Count source inputRead from timerCount value can be read out by reading timer Bi registerWrite to timer• When counting stoppedWhen a value is written to timer Bi register, it is written to both reload register and counter• When counting in progressWhen a value is written to timer Bi register, it is written to only reload register(Transferred to counter at next reload time)Timer Bi mode registerb7 b6 b5 b4 b3 b2 b1 b00 1Symbol Address When resetTBiMR(i=0 to 5) 039B16 to 039D16 00XX00002035B16 to 035D16 00XX00002Bit symbolTMOD0TMOD1MR0MR1MR2MR3TCK0TCK1Bit nameOperation mode select bitCount polarity selectbit (Note 1)Functionb1 b00 1 : Event counter modeb3 b20 0 : Counts external signal'sfalling edges0 1 : Counts external signal'srising edges1 0 : Counts external signal'sfalling and rising edges1 1 : Inhibited0 (Fixed to “0” in event counter mode; i = 0, 3)Nothing is assigned (i = 1, 2, 4, 5).In an attempt to write to this bit, write “0”. The value, if read,turns out to be indeterminate.Invalid in event counter mode.In an attempt to write to this bit, write “0”. The value, if read inevent counter mode, turns out to be indeterminate.Invalid in event counter mode.Can be “0” or “1”.Event clock select 0 : Input from TBiIN pin (Note 4)1 : TBj overflow(j = i – 1; however, j = 2 when i = 0,j = 5 when i = 3)Note 1: Valid only when input from the TBiIN pin is selected as the event clock.If timer's overflow is selected, this bit can be “0” or “1”.Note 2: Timer B0, timer B3.Note 3: Timer B1, timer B2, timer B4, timer B5.Note 4: Set the corresponding port direction register to “0”.R(Note 3)W(Note 2)Figure 1.17.18. Timer Bi mode register in event counter mode97

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

Saved successfully!

Ooh no, something went wrong!