9.4 Ramp Generator Input
When selected, the ramp generator (see
) can produce a falling-ramp DAC output signal. In this mode,
the DAC uses the most significant 10-bits of the 16-bit RAMPSTS countdown register as its input.
RAMPDECVALS
RAMPDECVALA
RAMPMAXREFS
RAMPMAXREFA
D Q
D Q
RAMPSTS (16b)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 STOP
START
To DAC
0
1
PWMSYNC
PWMSYNC
SYSCLK
PWMSYNC
COMP_RESET
OR
DACCTL[DACSOURCE]
AND
COMP_RESET
COMPSTS
COMPCTL[CMPINV]
SYNC_RESET
OR
PWMSYNC
DACCTL[DACSOURCE]
Read Only
Read Only
Read Only
2
1: COMP_RESET
2: SYNC_RESET
0: No Reset
Figure 9-3. Ramp Generator Block Diagram
Note
The PWMSYNC signal for the Ramp Generator is derived from the HRPWM register field
HRPCTL[PWMSYNCSEL]. The PWMSYNC signal is not the same as the EPWMSYNCI and
EPWMSYNCO signals.
The RAMPSTS register is set to the value of RAMPMAXREF_SHDW when a selected PWMSYNC signal is
received, and the value of RAMPDECVAL_ACTIVE is subtracted from RAMPSTS on every SYSCLK cycle
thereafter. When the ramp generator is first enabled by setting DACSOURCE = 1, the value of RAMPSTS is
loaded from RAMPMAXREF_SHDW, and the register remains static until the first PWMSYNC signal is received.
If the COMPSTS bit is set by the comparator while the ramp generator is active, the RAMPSTS register will
reset to the value of RAMPMAXREF_ACTIVE and remain static until the next PWMSYNC signal is received. If
the value of RAMPSTS reaches zero, the RAMPSTS register will remain static at zero until the next PWMSYNC
signal is received.
To reduce the likelihood of race conditions when updating the ramp generator RAMPMAXREFA and
RAMPDECVALA values, only the shadow registers RAMPMAXREF_SHDW and RAMPDECVAL_SHDW have
write permissions. The values of the shadow registers are copied to the active registers on the next PWMSYNC
signal. User software should take further steps to avoid writing to the shadow registers in the same cycle as a
PWMSYNC signal or else the previous shadow register value may be lost.
The PWMSYNC signal width must be greater than SYSCLK to ensure that the ramp generator is able to detect
the PWMSYNC signal.
The ramp generator behavior is further illustrated in
Comparator (COMP)
562
TMS320x2806x Microcontrollers
SPRUH18I – JANUARY 2011 – REVISED JUNE 2022
Copyright © 2022 Texas Instruments Incorporated
Содержание TMS320 2806 Series
Страница 2: ......