Programmable Timers
10-4
Am186™CC/CH/CU Microcontrollers User’s Manual
Three bits in the control register and the external TMRIN pin control the way Timer 0 and
Timer 1 count:
■
When the EXT (external clock) bit is set, the TMRIN signal provides the clock for the
associated timer. In this mode, the timer count increments once for each low to high
transition on the TMRIN pin. The external clock speed cannot be greater than one fourth
of the processor clock. The timer output can take up to six clock cycles to respond to
the clock or gate input because of internal synchronization and pipelining of the timer
circuitry.
■
When the RTG (retrigger) bit is set, a low to high transition on TMRIN resets the value
in the timer’s current count register. The timer counts during both the high and low phases
of the TMRIN signal.
■
When the P (prescaler) bit is set, Timer 2 provides the clock for the associated timer.
The timer increments once each time Timer 2 reaches its maximum count.
Table 10-3 summarizes the behavior of the timers.
Timers 0 and 1 provide two maximum count compare registers, TxCMPA and TxCMPB.
The setting of the ALT (alternate compare) bit determines whether one or both of these
compare registers are used. When ALT is zero, only TxCMPA is used. When ALT is one,
both compare registers are used.
When ALT is zero, the timer behaves as follows:
■
Each time the timer increments, it compares the value in TxCNT to the value in TxCMPA.
■
If the compare is not equal, the timer:
– Holds TMROUTx High.
■
If the compare is equal, the timer:
– Pulses TMROUTx Low for a single processor clock.
– Resets the TxCNT register to zero.
– Sets the MC (maxcount reached) bit. Software must clear the MC bit.
– If the INT bit is set in TxCON, the timer generates an interrupt request.
– If the CONT (continuous mode) bit is zero, the timer clears the EN (enable) bit and
the timer stops counting. If the CONT bit is one, the timer remains enabled and
continues counting.
Table 10-3
Timer 0 and Timer 1 Behavior
TxCON Bit Value
TMRIN
EXT RTG
P
Low
High
Low -> High
0
0
0
Hold
1/4 processor clock
No effect
0
0
1
Hold
Timer 2 time-out
No effect
0
1
0
1/4 processor clock 1/4 processor clock
Resets count
0
1
1
Timer 2 time-out
Timer 2 time-out
Resets count
1
x
x
No effect
No effect
Increments count
Содержание Am186 CC
Страница 1: ...Am186 CC CH CU Microcontrollers User s Manual Order 21914B...
Страница 4: ...iv Am186 CC CH CU Microcontrollers User s Manual...
Страница 18: ...Table of Contents xviii Am186 CC CH CU Microcontrollers User s Manual...
Страница 24: ...Introduction xxiv Am186 CC CH CU Microcontrollers User s Manual...
Страница 39: ...Architectural Overview Am186 CC CH CU Microcontrollers User s Manual 1 15 Figure 1 6 32 Channel Linecard CH CC...
Страница 40: ...Architectural Overview 1 16 Am186 CC CH CU Microcontrollers User s Manual...
Страница 86: ...System Overview 3 36 Am186 CC CH CU Microcontrollers User s Manual...
Страница 92: ...Emulator Support 4 6 Am186 CC CH CU Microcontrollers User s Manual...
Страница 112: ...DRAM Controller 6 8 Am186 CC CH CU Microcontrollers User s Manual...
Страница 134: ...Interrupts 7 22 Am186 CC CH CU Microcontrollers User s Manual...
Страница 186: ...Programmable I O Signals 9 8 Am186 CC CH CU Microcontrollers User s Manual...
Страница 200: ...Watchdog Timer 11 6 Am186 CC CH CU Microcontrollers User s Manual...
Страница 232: ...Asynchronous Serial Ports UARTs 13 24 Am186 CC CH CU Microcontrollers User s Manual...
Страница 242: ...Synchronous Serial Port SSI 14 10 Am186 CC CH CU Microcontrollers User s Manual...
Страница 264: ...High Level Data Link Control HDLC 15 22 Am186 CC CH CU Microcontrollers User s Manual...
Страница 332: ...Universal Serial Bus USB 18 34 Am186 CC CH CU Microcontrollers User s Manual...
Страница 348: ...Register Summary A 16 Am186 CC CH CU Microcontrollers User s Manual...
Страница 376: ...Index Index 18 Am186 CC CH CU Microcontrollers User s Manual...