21.07.2015 Views

M16C User Manual.pdf

M16C User Manual.pdf

M16C User Manual.pdf

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Timer AMitsubishi microcomputers<strong>M16C</strong> / 62 GroupSINGLE-CHIP 16-BIT CMOS MICROCOMPUTER(3) One-shot timer modeIn this mode, the timer operates only once. (See Table 1.17.4.) When a trigger occurs, the timer starts upand continues operating for a given period. Figure 1.17.10 shows the timer Ai mode register in one-shottimer mode.Table 1.17.4. Timer specifications in one-shot timer modeItemCount sourceCount operationf1, f8, f32, fC32• The timer counts downSpecification• When the count reaches 000016, the timer stops counting after reloading a new count• If a trigger occurs when counting, the timer reloads a new count and restarts countingDivide ratio 1/n n : Set valueCount start condition • An external trigger is input• The timer overflows• The one-shot start flag is set (= 1)Count stop condition • A new count is reloaded after the count has reached 000016• The count start flag is reset (= 0)Interrupt request generation timing The count reaches 000016TAiIN pin function Programmable I/O port or trigger inputTAiOUT pin function Programmable I/O port or pulse outputRead from timer When timer Ai register is read, it indicates an indeterminate valueWrite to timer • When counting stoppedWhen a value is written to timer Ai register, it is written to both reloadregister and counter• When counting in progressWhen a value is written to timer Ai register, it is written to only reload register(Transferred to counter at next reload time)Timer Ai mode registerb7 b6 b5 b4 b3 b2 b1 b001 0Symbol Address When resetTAiMR(i = 0 to 4) 039616 to 039A16 0016Bit symbolTMOD0TMOD1Bit nameFigure 1.17.10. Timer Ai mode register in one-shot timer modeMR0MR1MR2MR3TCK0TCK1Functionb1 b0Operation mode select bit 1 0 : One-shot timer modePulse output functionselect bitExternal trigger selectbit (Note 2)Trigger select bit0 : Pulse is not output(TAiOUT pin is a normal port pin)1 : Pulse is output (Note 1)(TAiOUT pin is a pulse output pin)0 (Must always be “0” in one-shot timer mode)Count source select bit0 : Falling edge of TAiIN pin's input signal (Note 3)1 : Rising edge of TAiIN pin's input signal (Note 3)0 : One-shot start flag is valid1 : Selected by event/trigger selectregisterb7 b60 0 : f10 1 : f81 0 : f321 1 : fC32R W Note 1: The settings of the corresponding port register and port direction register are invalid.Note 2: Valid only when the TAiIN pin is selected by the event/trigger select bit(addresses 038216 and 038316). If timer overflow is selected, this bit can be “1” or “0”.Note 3: Set the corresponding port direction register to “0”.92

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

Saved successfully!

Ooh no, something went wrong!