XMC4500: how to force CCU slices to their passive levels?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hi,

I am working on a motor control application where I am using one of the CCU8 units in the XMC4500 as follows:

- Slice 0-2: complementary PWM outputs
- Slice 3: ADC and interrupt (field-oriented controller) trigger

Sometimes it's a good idea to initiate freewheeling, e.g., when the controller measures unreasonably high phase currents or any other unrecoverable errors. Freewheeling is a simple way to stop the motor in a safe way. Currently, the only way I can freewheel is by the PWM outputs themselves; by setting all of them to their passive levels, i.e., I don't have a separate GPIO signal that can force the gates open. The question is, how do I do this by the CCU module? What I would _not_ like to do:

- Change the alternative function of the IO's (to input), since it feels a bit hacky. Also, this method can't synchronously set the PWM's to a passive level.
- Generate TRAP by S/W (if possible), since I want to be able to differentiate from a true trap.

I can't seem to find a good way to do this. Any suggestions? Note that I want slice 3 to remain unaffected, since it's triggering various things.
0 Likes
1 Reply
Not applicable
I solved this, and the suitable solution of to use one of the POSIF peripherals in multichannel mode. After initialization is done, the only thing needed to trigger freewheeling is by the following:

XMC_POSIF_MCM_SetMultiChannelPattern(posif_peripheral, pattern);
XMC_POSIF_MCM_UpdateMultiChannelPattern(posif_peripheral);
0 Likes