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

XMC™ Forum Discussions

Not applicable
Hello,

I'am working on a PWM signal on my Relax Lite Kit (without DAVE Apps, because I must not use them) and I'm struggling with switching it off properly.
When putting the slice in idle mode the output pin is randomly set to HIGH or LOW, where I need it to be LOW only.

I looked into the Dave Apps API Docu, theres a function called "PWMSP001_Stop" which, as far I can see, just sets the slice in idle mode and
clears timervalues and prescalers. I also can't find a note in the reference manual where pinstates are described in idle mode.

So what's the best way to disable the PWM and get the corresponding GPIO on a defined level without changing the GPIO alternate function etc.?
For now I am setting the compare value to zero, but I'd like to switch it off properly rather than just setting the duty cycle to zero.

Thanks,

Raz
0 Likes
2 Replies
Not applicable
Hi razdraz

In my opinion, i choose to change the GPIO alternate function to direct output and set the output to LOW as soon as i want to disable the PWM output.
0 Likes
Travis
Employee
Employee
First like received
razdraz wrote:
Hello,

I'am working on a PWM signal on my Relax Lite Kit (without DAVE Apps, because I must not use them) and I'm struggling with switching it off properly.
When putting the slice in idle mode the output pin is randomly set to HIGH or LOW, where I need it to be LOW only.

I looked into the Dave Apps API Docu, theres a function called "PWMSP001_Stop" which, as far I can see, just sets the slice in idle mode and
clears timervalues and prescalers. I also can't find a note in the reference manual where pinstates are described in idle mode.

So what's the best way to disable the PWM and get the corresponding GPIO on a defined level without changing the GPIO alternate function etc.?
For now I am setting the compare value to zero, but I'd like to switch it off properly rather than just setting the duty cycle to zero.

Thanks,

Raz



Hi razdraz,

Please have a look into chapter "22.2.7.8 TRAP Function" which allows the PWM outputs to react on the state of an input pin. Hope this meet your needs and we can discuss further on this topic.

Best Regards
Travis
0 Likes