This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Generating sinewave without the use of PEC

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

Parents
  • 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

Reply
  • 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

Children
No data