PWM output controlled from GPIO

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

cross mob
lock attach
Attachments are accessible only for community members.
Not applicable
Hi All,

setup: XMC1300, DAVE 4, using DAVE APPs

I am trying switch on and off the PWM (CCU4) from two different GPIO pins. I can do only one action, either on or off, but not both via the pins. How do I go about doing this?

I have attached my test project, within this project I can not have two event generators send signals to two events of the PWM_CCU4_0, I am only allowed to connect one, or both, but then I do not have the option of having one starting the PWM and the other stopping it, only the remaining events can be chosen. I would appreciated any insights anyone can offer me.

Regards
Enigma
0 Likes
7 Replies
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
Hi Enigma,

Can you check if the ERU which you are using for the GPIO is able to link to both CCU4 PWM?
0 Likes
Not applicable
Hi Travis,

Sorry, but I do not understand what you would like me to check.

What I checked (what I guessed you implied):
I can connected the signal of the event generator output PWM_CCU4 unit (via iout). I can connect it to both events I currently have for the PWM_CCU4 unit. (see below)

1741.attach

I was trying to connect the two GPIO pins to the same event detector, but this is also not allowed.

Any further suggestions or comments?

Regards
Enigma
0 Likes
Not applicable
Hi Enigma,

maybe you connect the GPIO pins to two interrupts. The corresponding service routines then start or stop the CCU.

Kind regards
Kurt
0 Likes
Not applicable
Hi Kurt,

I can do that, but currently I am looking for performance. I can switch off the PWM with the GPIO input in 160ns and with the interrupt the best I can achieve is 1.7us. I really want to be able to start and stop it within 160ns and I do not see how the interrupts in the micro controller are going to achieve that.

Regards
Enigma
0 Likes
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
Just curious what application are you working on which requires the PWM to be off immediately?

Lastly i think you can make use of the CCTrap which turn off the PWM almost immediately and we use this specifically for motor control to prevent short circuit of the IGBT gate driver.
0 Likes
Not applicable
Hi Travis,

We have an experiment in which we try and extend the life of a qubit in a special way with gating microwaves. What I am trying to do is to see if this would be possible with a uC, this would allow us more flexibility in the processing of information as well as many other advantages over the technology currently employed.

I will have a look at this CCTrap you have recommended. You believe this will allow me to switch on and of a PWM then from two GPIO ports?

Regards,
Enigma
0 Likes
Not applicable
Hi again,

It seems not to be possible at all starting and stopping a PWM from two different GPIO using the event detector. I have tried almost everything and I am still stuck. Could you post a code snippet of how you propose to do it with the CCTrap.

Regards,
Enigma
0 Likes