WaveDAC8 vs. Lookup table

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

cross mob
CaDu_3933941
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

Hi all,

I am currently trying to implement a PI controller with an output that will be multiplied with a 60 Hzsine wave.

I am currently using the WaveDAC8 component of the top design in the PSoC 5LP. My first idea was to feed the output of the WaveDAC into an ADC SAR, however, the results I was getting were a bit funky.

Would this operation be better if I used a lookup table? Or would it not make a difference?

Thanks

0 Likes
1 Solution

You need a table for sine values (int preferred) of the size of the points (resolution) you need.

Set up a timer that generates an interrupt every time a new sample has to be generated (60 * points number) per second. and do your calculations. You may even save 3/4 of your table by adjusting the value to the quadrant you actually work on, Do not spend too much time in the interrupt handler, do the AD conversion in the main-loop.

Bob

View solution in original post

0 Likes
4 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

The WaveDAC is using a lookup-table. So  you might use a timer to rread from a table the wanted value with your wanted granularity.

Bob

0 Likes

Would this work for multiplication with some other variable that is also a value read from an ADC?

0 Likes

Also, how would I implement this?

0 Likes

You need a table for sine values (int preferred) of the size of the points (resolution) you need.

Set up a timer that generates an interrupt every time a new sample has to be generated (60 * points number) per second. and do your calculations. You may even save 3/4 of your table by adjusting the value to the quadrant you actually work on, Do not spend too much time in the interrupt handler, do the AD conversion in the main-loop.

Bob

0 Likes