Because the HCCOUNTER starts counting immediately after SOFTRESET, the first capture result into the
capture “0” registers should be discarded. The value captured will be the number of HCCAPCLK cycles since the
last SOFTRESET or the HRCAPCLKEN bit was set rather than an actual pulse width measurement.
5.3.2.2 HCCAP0 - HCCAP1 Registers
The HRCAP capture registers include a 2-deep FIFO buffer to store two pulse widths’ worth of data.
When a rising edge event occurs, HCCAPCNTRISE0 is loaded with the pulse width data from the last
falling edge to the current rising edge (low pulse width). At the next rising edge event, the value in the
HCCAPCNTRISE0 register is loaded into HCCAPCNTRISE1.
When a falling edge event occurs, HCCAPCNTFALL0 is loaded with the pulse width data from the last rising
edge to the current falling edge (high pulse width). For falling edge events, the HRCAP logic operates such that
the HCCAPCNTFALL0 register value is then loaded into the HCCAPCNTFALL1 register at the next rising edge
event rather than waiting until the next falling edge event.
5.3.2.3 RISE versus FALL Capture Events
HRCAP capture registers can be read either during rising edge capture events or during falling edge capture
events. They should not be read during both events.
There are a number of differences with regard to using RISE events to read captured registers versus using
FALL events to read captured registers as shown in
.
Previous RISE interrupt
HCCAPCNTFALL1
Service RISE interrupt
Previous FALL interrupt
Service FALL interrupt
HCCAPCNTRISE1
HCCAPCNTRISE0
HCCAPCNTRISE1
HCCAPCNTRISE0
HCCAPCNTFALL1
HCCAPCNTFALL0
Figure 5-5. Rise versus Fall Capture Events
5.3.2.3.1 RISE Capture Events
When a RISE event occurs, the application code has access to full valid capture data for two pulse widths
(1 period) in high-resolution capture mode and three pulse widths (1.5 periods) in normal capture mode.
HCCAPCNTFALL0 does not have valid data available on RISE events, as this values are not captured until
the falling edge event after the current rising edge event (event has not yet occurred).
The application code has until the next RISE event to read all relevant capture data and clear the RISE event.
Otherwise, the data will be overwritten and invalid. Therefore, RISE events are generally used to capture data for
period signals where duty cycle may vary significantly.
Note
Because HCCOUNTER starts counting immediately after SOFTRESET, the first RISE capture result
into HCCAPCNTRISE0 does not include valid pulse width data and should be discarded. When
the second RISE capture event occurs, this invalid data is transferred to HCCAPCNTRISE1, and
therefore the data in this register should also be discarded. After the second rise interrupt, all capture
data is valid and can be used normally.
High-Resolution Capture (HRCAP) Module
SPRUH18I – JANUARY 2011 – REVISED JUNE 2022
TMS320x2806x Microcontrollers
409
Copyright © 2022 Texas Instruments Incorporated
Содержание TMS320 2806 Series
Страница 2: ......