Main operating highlights of the APWM section:
- The time-stamp counter bus is made available for comparison via 2 digital (32-bit) comparators.
- When PRU-ICSS_ECAP_CAP1 / PRU-ICSS_ECAP_CAP2
registers are not used in capture mode, their contents can be used as Period and
Compare values in APWM mode.
- Double buffering is achieved via shadow registers APRD and ACMP (PRU-ICSS_ECAP_CAP3/PRU-ICSS_ECAP_CAP4). The shadow register contents are transferred over
to PRU-ICSS_ECAP_CAP1 / PRU-ICSS_ECAP_CAP2 registers either immediately upon a write, or on a
CTR = PRD trigger.
- In APWM mode, writing to PRU-ICSS_ECAP_CAP1 / PRU-ICSS_ECAP_CAP2
active registers will also write the same value to the corresponding shadow
registers PRU-ICSS_ECAP_CAP3/PRU-ICSS_ECAP_CAP4. This emulates immediate mode. Writing to the shadow
registers PRU-ICSS_ECAP_CAP3/PRU-ICSS_ECAP_CAP4 will invoke the shadow mode.
- During initialization, you must write to the active registers for both period and compare. This automatically copies the initial values into the shadow values. For subsequent compare updates, during run-time, you only need to use the shadow registers.
Figure 7-55 PWM Waveform Details Of eCAP APWM Mode Operation
The behavior of APWM active-high mode (APWMPOL == 0) is:
CMP = 00000000h, output low for duration of period (0% duty)
CMP = 00000001h, output high 1 cycle
CMP = 00000002h, output high 2 cycles
CMP = PERIOD, output high except for 1 cycle (<100% duty)
CMP = PERIOD+1, output high for complete period (100% duty)
CMP > PERIOD+1, output high for complete period
The behavior of APWM active-low mode (APWMPOL == 1) is:
CMP = 00000000h, output high for duration of period (0% duty)
CMP = 00000001h, output low 1 cycle
CMP = 00000002h, output low 2 cycles
CMP = PERIOD, output low except for 1 cycle (<100% duty)
CMP = PERIOD+1, output low for complete period (100% duty)
CMP > PERIOD+1, output low for complete period