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 AMitsubishi microcomputers<strong>M16C</strong> / <strong>62</strong> <strong>Group</strong>SINGLE-CHIP 16-BIT CMOS MICROCOMPUTERTimer AFigure 1.17.3 shows the block diagram of timer A. Figures 1.17.4 to 1.17.6 show the timer A-relatedregisters.Except in event counter mode, timers A0 through A4 all have the same function. Use the timer Ai moderegister (i = 0 to 4) bits 0 and 1 to choose the desired mode.Timer A has the four 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 over flow.• One-shot timer mode: The timer stops counting when the count reaches “000016”.• Pulse width modulation (PWM) mode: The timer outputs pulses of a given width.f1f8f32fC32Clock sourceselectionPolarityselectionTAiIN(i = 0 to 4)• Timer• One shot• PWM• Timer(gate function)• Event counterClock selectionTB2 overflowExternalTAj overflowtrigger(j = i – 1. Note, however, that j = 4 when i = 0)TAk overflow(k = i + 1. Note, however, that k = 0 when i = 4)Count start flag(Address 038016)Down countUp/down flag(Address 038416)Data bus high-order bitsData bus low-order bitsLow-order8 bitsReload register (16)High-order8 bitsCounter (16)Up count/down countAlways down count exceptin event counter modeTAi Addresses TAj TAkTimer A0 038716 038616 Timer A4 Timer A1Timer A1 038916 038816 Timer A0 Timer A2Timer A2 038B16 038A16 Timer A1 Timer A3Timer A3 038D16 038C16 Timer A2 Timer A4Timer A4 038F16 038E16 Timer A3 Timer A0TAiOUT(i = 0 to 4)Pulse outputToggle flip-flopFigure 1.17.3. Block diagram of timer ATimer Ai mode registerb7 b6 b5 b4 b3 b2 b1 b0Symbol Address When resetTAiMR(i=0 to 4) 039616 to 039A16 0016Bit symbolTMOD0TMOD1MR0MR1MR2MR3TCK0TCK1Bit nameOperation mode select bitFunctionb1 b00 0 : Timer mode0 1 : Event counter mode1 0 : One-shot timer mode1 1 : Pulse width modulation(PWM) modeFunction varies with each operation modeCount source select bit(Function varies with each operation mode)R WFigure 1.17.4. Timer A-related registers (1)84

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

Saved successfully!

Ooh no, something went wrong!