time
Write TBEXT = 1
Active edge detection for
one RT RTITBHCOMP
RTICPUC0
NTUx
CPUC0 might not be matched
depending on the NTU period
RTIUC0
to switch to ext. timbase
Module Operation
590
SPNU563A – March 2018
Copyright © 2018, Texas Instruments Incorporated
Real-Time Interrupt (RTI) Module
17.2.4.2 Switching from Internal Source to External Source
If the application switches from an internal source to an external source, the two signals must be
synchronized (see
). The synchronization will occur when the TBEXT bit is set. RTIUC0 will be
reset and the edge detection circuit will be active for one (RT RTITBHCOMP) period or until an
edge is detected. If there is no pulse during this period, the source will be reset from an external clock
source to an internal clock source. If an edge is detected, the windowed edge detection behavior will take
place. Setting the TBEXT bit will not increment free running counter 0.
NOTE:
If an external timebase is used, then the software must ensure that timebase low compare
and timebase high compare are programmed to a valid state before switching TBEXT to an
external source. This state is necessary to allow the timebase control circuit to operate
correctly. The following condition must be met:
•
RTITBHCOMP < RTIT RTICPUC0
RTITBHCOMP must be lower than RTICPUC0 because RTIUC0 will be reset if RTICPUC0 is
reached. RTITBHCOMP will represent the number of RTICLK cycles from RTICPUC0 until
the circuit switches to the internal timebase when no NTU edge is detected.
If an external timebase is used, RTIGCTRL[0] must be set to 1 (enable RTIUC0) to ensure
that the timebase control circuit does not wait indefinitely for an incoming signal.
shows a timing example for the synchronization phase when the TBEXT bit is set.
Figure 17-6. Switch to NTUx
17.2.4.3 Switching from External Source to Internal Source
When the edge detection is active (TBEXT = 1) and no clock edge of NTUx is detected inside the
programmed detection window, the RTI will automatically switch the timebase to RTIUC0.
shows a timing example for a missing NTU signal. In the case where the INC bit is set, RTIFRC0 will
automatically be incremented by one to compensate for the missed NTU pulse.
Setting TBEXT = 0 will also switch the clock source for RTIFRC0 to RTIUC0.