Programmable Timers
Am186™CC/CH/CU Microcontrollers User’s Manual
10-5
When ALT is set and the timer is using TxCMPA (initial value after reset), the timer
behaves as follows:
■
The RIU (Register-In-Use) bit is zero (this is a read-only bit).
■
Holds the TMROUTx signal High (inverse of RIU).
■
Each time the timer increments, it compares the value in TxCNT to the value in TxCMPA.
■
If the compare is equal, the timer:
– 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.
– Sets the RIU bit and performs the next compare against TxCMPB.
When ALT is set and the timer is using TxCMPB, the timer behaves as follows:
■
The RIU (Register-In-Use) bit is one (this is a read-only bit).
■
Holds the TMROUTx signal Low (inverse of RIU).
■
Each time the timer increments, it compares the value in TxCNT to the value in TxCMPB.
■
If the compare is equal, the timer:
– Resets the TxCNT register to zero.
– Sets the MC (maxcount reached) bit.
– If the INT bit is set in TxCOT, the timer generates an interrupt request. Software must
clear the MC bit.
– Clears the RIU bit and TMROUTx transitions to high.
– If the CONT (Continuous Mode) bit is zero, the timer clears the EN (Enable bit) and
the timer is disabled. If the CONT bit is set, the timer remains enabled and performs
the next compare against TxCMPA.
Because the comparison is done after the count is incremented, if TxCNT and TxCMPA
are set to the same value, the comparison of TxCNT to TxCMPA will not be equal until the
current count reaches its maximum value, wraps around through zero and counts to the
TxCMPA value. Setting TxCMPB to zero provides the maximum time-out for the second
phase of the timer.
Setting the ALT bit and using the two compare registers allows Timer 0 and Timer 1 to
generate waveforms on the associated TMROUT pins.
10.5.4
Requesting Interrupts
The INT bits in the T0CON, T1CON, and T2CON registers control interrupt request
generation when a maximum count is reached. The request remains asserted for as long
as the MC bit in the TxCON register is set. Software must clear this bit.
If the maximum count and compare registers are both set to 0000h, the timer associated
with that compare register counts from 0000h to FFFFh before requesting an interrupt. With
a 40-MHz clock, a timer configured this way interrupts every 6.5536 ms.
When the ALT bit is set for Timer 0 or Timer 1, the MC bit is set both when the timer reaches
the TxCMPA value and when the timer reaches the TxCMPB value. Software can
differentiate these two conditions by examining the RIU bit. The RIU bit is 1 when the
Содержание 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...