I am implementing a phase-shifted-full-bridge converter that uses the PWM registers in up-down count mode. I need to synchronize the PWM output to an external signal. The sync signal is twice the desired switching frequency with 50% duty cycle. Is there some means of toggling the count direction each time a rising (or falling) edge of the incoming sync signal is received? The first rising edge would place the counter in up-count mode and the next rising edge would place the counter in down-count mode, and so on.
Thanks in advance for any insight.