224
Rabbit 4000 Microprocessor User’s Manual
21.3.4 Capture Mode
Pulse Width or Time Between Events
The following steps explain how to measure the pulse width or time between events.
1. Select the same input pin to perform a pulse-width measurement between the start and
stop conditions, or select two different input pins to measure time between events on
those pins.
2. Set the counter to start on the start condition and stop on the stop condition, latch on the
stop condition, and generate an interrupt on the stop condition.
3. In the interrupt handler, read out the counter to determine the pulse width or time inter-
val between the two events.
Time-Stamp External Events
The following steps explain how to time-stamp external events.
1. Set the trigger for the desired event type.
2. Set the counter to run continuously, latch on the start (and/or stop) condition, and gen-
erate an interrupt on the start (and/or stop) condition
3. In the interrupt handler, read out the counter as an event timestamp.
Measure Time Interval from a Software Start to an External Event
The following steps explain how to measure the time interval between a software start and
the occurrence of an external event.
1. Set up the counter to run continuously, latch on the stop condition, and generate an
interrupt on the stop condition.
2. Set up the stop condition for the event of interest.
3. Reset the counter via ICCSR at the software start.
4. In the interrupt handler, read the counter as a time duration.
21.3.5 Count Mode
The following steps explain how to count pulses.
1. Enable the input-count mode by writing to ICCR and setting the counter to run continu-
ously until the stop condition occurs and to latch on the start condition in ICT
x
R.
2. If an interrupt is desired at a particular count, write that value into the LSB and MSB
registers, and enable the stop condition interrupt in ICCSR.
3. Set the start condition to match the signal type to be counted.
4. Reset the counter by writing to ICCSR.
5. Read the counter at any time to get the current count.
6. If a match value is enabled and generates an interrupt, you can re-enable the count
mode by clearing the counter via ICCSR and re-enable the mode in ICT
x
R back to run-
ning continuously until the stop condition occurs.
Summary of Contents for Rabbit 4000
Page 1: ...Rabbit 4000 Microprocessor User s Manual 019 0152 070720 H...
Page 18: ...8 Rabbit 4000 Microprocessor User s Manual...
Page 40: ...30 Rabbit 4000 Microprocessor User s Manual...
Page 74: ...64 Rabbit 4000 Microprocessor User s Manual...
Page 82: ...72 Rabbit 4000 Microprocessor User s Manual...
Page 86: ...76 Rabbit 4000 Microprocessor User s Manual...
Page 96: ...86 Rabbit 4000 Microprocessor User s Manual...
Page 182: ...172 Rabbit 4000 Microprocessor User s Manual...
Page 240: ...230 Rabbit 4000 Microprocessor User s Manual...
Page 248: ...238 Rabbit 4000 Microprocessor User s Manual...
Page 256: ...246 Rabbit 4000 Microprocessor User s Manual...
Page 310: ...300 Rabbit 4000 Microprocessor User s Manual...
Page 330: ...320 Rabbit 4000 Microprocessor User s Manual...
Page 348: ...338 Rabbit 4000 Microprocessor User s Manual...