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 AMitsubishi microcomputers<strong>M16C</strong> / 62 GroupSINGLE-CHIP 16-BIT CMOS MICROCOMPUTER(2) Count sourceThe internal count source can be selected from f1, f8, f32, and fC32. Clocks f1, f8, and f32 are derivedby dividing the CPU's main clock by 1, 8, and 32 respectively. Clock fC32 is derived by dividing theCPU's secondary clock by 32.(3) Frequency division ratioIn timer mode or pulse width modulation mode, [the value set in the timer register + 1] becomes thefrequency division ratio. In event counter mode, [the set value + 1] becomes the frequency divisionratio when a down count is performed, or [FFFF16 - the set value + 1] becomes the frequency divisionratio when an up count is performed. In one-shot timer mode, the value set in the timer register becomesthe frequency division ratio.The counter overflows (or underflows) when a count source equal to a frequency division ratio is input,and an interrupt occurs. For the pulse output function, the output from the port varies (the value in theport register does not vary).(4) Reading the timerEither in timer mode or in event counter mode, reading the timer register takes out the count at thatmoment. Read it in 16-bit units. The data either in one-shot timer mode or in pulse width modulationmode is indeterminate.(5) Writing to the timerTo write to the timer register when a count is in progress, the value is written only to the reload register.When writing to the timer register when a count is stopped, the value is written both to the reloadregister and to the counter. Write a value in 16-bit units.(6) Relation between the input/output to/from the timer and the direction registerWith the output function of the timer, pulses are output regardless of the direction register of therelevant port. To input an external signal to the timer, set the direction register of the relevant port toinput.(7) Pins related to timer A(a) TA0IN, TA1IN, TA2IN, TA3IN, TA4IN Input pins to timer A.(b) TA0OUT, TA1OUT, TA2OUT, TA3OUT, TA4OUT Output pins from timer A. They become input pins totimer A when event counter mode is active.(8) Registers related to timer AFigure 2.2.1 shows the memory map of timer A-related registers. Figures 2.2.2 through 2.2.5 showtimer A-related registers.281

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

Saved successfully!

Ooh no, something went wrong!