You are here

Sine wave lookup to PWM8 output with no latency? | Cypress Semiconductor

Sine wave lookup to PWM8 output with no latency?

Summary: 1 Reply, Latest post by nguyennghianh on 15 Mar 2011 05:42 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
dmeeks's picture
2 posts

Hello all -

I am a newbie, using a PSoC 1, and I need to generate a PWM output that is a sine wave (after filtering). The sine wave values will be from a lookup table (similar to the example program using a sine wave lookup to drive a DAC).

My question has to do with updating the PWM with each new lookup value. I cannot stop the PWM, or delay it, while loading the next sine wave value. If that happens, then the frequency of the sine wave output will be off.

So what I need to do is to load the next PWM pulse width value (the period is always 255) without adding any extra delay to the PWM output.

I have also been wondering if something like a counter or a one-shot would also work for this, and if one of those may make the solution easier?

Thanks in advance for your help!


nguyennghianh's picture
1 post

you can use PWM_WriteCompareValue to change PWM value. It's all right.

Log in to post new comments.