Daryl,
I had a go using your data and got the same result (not what I was hoping for a sine wave). I decided to increase to 6 bit and have another stab at it. I got the same triangle wave that you had on your example. (still not the expected sine wave). I then divided 180 degrees down to the same number of samples, used the sine function, added 1 (then no negative voltages), and scaled to same as actual voltages. I had a new set of data that I used to base my output on. essentialy I picked the closest actual value to the calculated value. I graphed the new data and got the attached waveform (more like a sine wave). This was acheieved by repeating some of the samples with the same voltage and on some skiping voltages. Now I am not sure how the best way to implement it is? do I create a table using this data and simply step through? or do I use the sine function in the pic basic to calculate the output?




Bookmarks