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(3) Pulse period/pulse width measurement modeIn this mode, the timer measures the pulse period or pulse width of an external signal. (See Table 1.17.8.)Figure 1.17.19 shows the timer Bi mode register in pulse period/pulse width measurement mode. Figure1.17.20 shows the operation timing when measuring a pulse period. Figure 1.17.21 shows the operationtiming when measuring a pulse width.Table 1.17.8. Timer specifications in pulse period/pulse width measurement modeItemSpecificationCount sourcef1, f8, f32, fC32Count operation• Up count• Counter value “000016” is transferred to reload register at measurementpulse's effective edge and the timer continues countingCount start condition Count start flag is set (= 1)Count stop condition Count start flag is reset (= 0)Interrupt request generation timing • When measurement pulse's effective edge is input (Note 1)• When an overflow occurs. (Simultaneously, the timer Bi overflow flagchanges to “1”. The timer Bi overflow flag changes to “0” when the countstart flag is “1” and a value is written to the timer Bi mode register.)TBiIN pin function Measurement pulse inputRead from timerWhen timer Bi register is read, it indicates the reload register’s content(measurement result) (Note 2)Write to timerCannot be written toNote 1: An interrupt request is not generated when the first effective edge is input after the timer has started counting.Note 2: The value read out from the timer Bi register is indeterminate until the second effective edge is input after the timer.Timer Bi mode registerb7 b6 b5 b4 b3 b2 b1 b01 0Symbol Address When resetTBiMR(i=0 to 5) 039B16 to 039D16 00XX00002035B16 to 035D16 00XX00002Bit symbolTMOD0TMOD1MR0MR1MR2MR3TCK0TCK1Bit nameOperation modeselect bitMeasurement modeselect bitFunctionb1 b01 0 : Pulse period / pulse widthmeasurement mode0 0 : Pulse period measurement (Interval betweenmeasurement pulse's falling edge to falling edge)0 1 : Pulse period measurement (Interval betweenmeasurement pulse's rising edge to rising edge)1 0 : Pulse width measurement (Interval betweenmeasurement pulse's falling edge to rising edge,and between rising edge to falling edge)1 1 : InhibitedFigure 1.17.19. Timer Bi mode register in pulse period/pulse width measurement modeb3 b20 (Fixed to “0” in pulse period/pulse width measurement 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 beindeterminate.Timer Bi overflowflag ( Note 1)Count sourceselect bit0 : Timer did not overflow1 : Timer has overflowedb7 b60 0 : f10 1 : f81 0 : f321 1 : fC32Note 1: The timer Bi overflow flag changes to “0” when the count start flag is “1” and a value is written to thetimer Bi mode register. This flag cannot be set to “1” by software.Note 2: Timer B0, timer B3.Note 3: Timer B1, timer B2, timer B4, timer B5.R(Note 2)(Note 3)W 98

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

Saved successfully!

Ooh no, something went wrong!