- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm working with the CY8CKIT-059 5LP Prototyping Kit. I added a PWM in FF mode to my project and connect the output to the onboard Blue LED on P2.1. The PWM controls the LED as expected but when I'm done running the PWM I issue a PWM_Stop() followed by a LED_B_Write(0) (which LED_B is defined and connected to P2.1).
I would expect that after those 2 commands the LED would be OFF but it is ON.
I'm not attaching my project as I thought this would be a general question with perhaps something else I need to do to fully disconnect the PWM from the Blue LED. Reading the datasheet of the PWM it reads as though the stop state would be to have PWM at a 0 but perhaps I'm missing something.
Thanks,
George
- Labels:
-
ispn:39618:1:0
-
l1:314:1:0
-
PSoC5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You should issue a "kill" to the PWM to set its outputs to 0 before stopping it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you have an example of doing this? I looked at the API and was expecting a "PWM_Kill()" command and there isn't. In FF mode there's only an asynchronous kill mode so I'm not sure how exactly to kill the PWM in code. While I'm asking, after you do kill the PWM is issuing a PWM_Start() enough to get it back up and running properly?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Read the component data sheet, it explains the kill modes in detail. In a FF PWM you have a 'kill' input, when its '1' the output gets disabled (with the next clock cycle, independent of the current PWM state).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have looked at the component datasheet and I see that in FF mode there is a kill input but I didn't see a register that can control the kill mode so what would you suggest I use to control the kill mode input?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your help. By following the PWM_Basic_test Example I was able to add the control register and force the PWM output low. It would be nice if this was just part of the API.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This example seems to be not available anymore in PSoC Creator. Could anyone please share the code example?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
George,
There should be multiple ways to 'reset' your LED.
- Use the kill input on the PWM as recommended by helic.
- Stop the PWM and reset it.
- Place a two-input AND gate between the output of the PWM and the output pin and use a Control Register to enable the LED.
Len
"Engineering is an Art. The Art of Compromise."