AnsweredAssumed Answered

could the pwm bean be unstable?

Question asked by Bongani Lukhele on Oct 29, 2012

Hello guys,

 

I'm new in this forum.I wrote a code in codewarrior v8.2 for the 56F807 that reads two adc channels using ADC beans, calculates the 1st harmonic of one of these signals which is denoted voltage[ ] in the code.The fft result is then use to multiply a reference sine signal Wnsin[ ] and this product is then subracted from the input signal voltage[ ] to generate PWM duty ratio values. My problem is that this code works well for an input square wave and fails for a triangular and sine wave.The pwm signal is very unstable..I'm also sending the two input signals to the serial ports, the serial communication only works with the square wave and stops or malfunctions when I try sending the other wave forms... What could be the problem?

 

I have attached a folder containing all the files for the code that I'm using...Thank you in advance..

 

Bongani

Original Attachment has been moved to: Transmitter-code.rar.zip

Outcomes