xpress_embedo
Advanced Member level 4
- Joined
- Jul 5, 2011
- Messages
- 1,154
- Helped
- 161
- Reputation
- 396
- Reaction score
- 189
- Trophy points
- 1,353
- Location
- India
- Activity points
- 10,591
Hello!!!
I am not able to generate Sine wave of frequency 200Hz when configured PWM Frequency of PIC16F877A to 10KHz and PIC is operating at 20MhZ Crystal.
This is MATLAB Code to generate table.
Have a look at my code attached below, please help.
View attachment PWM_Test.zip
I am not able to generate Sine wave of frequency 200Hz when configured PWM Frequency of PIC16F877A to 10KHz and PIC is operating at 20MhZ Crystal.
This is MATLAB Code to generate table.
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 fSampling = 10000; %10Khz Sampling Rate F = 200; %200hz Frequency t = 0:1/fSampling:1-1/fSampling; xSignal = sin(2*pi*F*t); % plot(t(1:100),xSignal(1:100)); xSignalPWM = xSignal(1:100); xSignalPWM = xSignalPWM * 250; xSignalPWM = xSignalPWM + 249.5067; xSignalPWM = round(xSignalPWM); plot(xSignalPWM);
Have a look at my code attached below, please help.
View attachment PWM_Test.zip