Greeting guys I have already made a code of generating a nice and pure sine wave using the PWM from CAPCOM1 and PEC (Peripheral Event Controller). Now I have been asked to generate 12 sine waves. Configurating CAPCOM in order to enable 12 channels is not a problem. I am currently facing a dilemma as my processor has maximum eight PECs. The burning question is it possible to generate 12 sinewaves without the aid of PEC? If yes, I would love to hear from you asap Kind regards Arron Joshi
This may help: http://www.keil.com/appnotes/docs/apnt_178.asp
I am working on someone's software as he left no notes or details. It generates 512 array of sine wave data and I use the pointer to increment and point the array of data in the timer 0. Someone used PEC to generate sine wave and I don't know he did it but I believe that it is possible to implement sine wave without it. Any suggestion? Arron Joshi
OK, it looks like you want to ignore my advice.
I have checked it out and it could not work on my keil environment as it is currently old version. Furthermore i am specifically interested in producing code in C rather than assembly. AJ
Hi again... Here is my pseudo code..... Sine wave table generation up to 512 data.. In the timer 0 section, I simply use the pointer to point the sine wave table so that increment every microseconds which generates PWM on my channel 0 (CC1_CC0) and I use simple low pass filter in order to observe sine wave... It works but distorted. I widened the timescale to analyse the PWM waveform and I have noticed that it keeps going back to zero when it reaches the 2 bytes. Also it goes to 2 bytes when it exceeds zero. I believe it could be an overflow. I have spent hours and hours to iron this problem today and no luck so far... However if I use PEC which can be set up in DAVE application and codes such as SCPR=_sof_(&CC10_CC1) It works without any problem. So I still experience problem without implementing PEC. I would love to hear from you guys to give me tip to iron this nightmare problem Thank you in advance AJ