Not applicable
Dec 02, 2016
09:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 02, 2016
09:29 AM
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.
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.
- Tags:
- IFX
1 Reply
Not applicable
Dec 07, 2016
08:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 07, 2016
08:05 AM
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);
XMC_POSIF_MCM_SetMultiChannelPattern(posif_peripheral, pattern);
XMC_POSIF_MCM_UpdateMultiChannelPattern(posif_peripheral);