Tahmid
Advanced Member level 6
- Joined
- Jun 17, 2008
- Messages
- 4,764
- Helped
- 1,799
- Reputation
- 3,590
- Reaction score
- 1,662
- Trophy points
- 1,413
- Location
- Berkeley, California
- Activity points
- 30,714
Re: Sinusoidol PWM-Gating Signal for H-Bridge using a uC
You changed the value of PR2 since you're using a 12MHz oscillator frequency. But you did not change the sine table which was written for PR2 = 249.
You can use this sine table:
You can calculate the sine table using my software Smart Sine: https://www.edaboard.com/blog/1798/
Hope this helps.
Tahmid.
You changed the value of PR2 since you're using a 12MHz oscillator frequency. But you did not change the sine table which was written for PR2 = 249.
You can use this sine table:
Code:
unsigned char sin_table[32]={0, 18, 36, 54, 72, 88, 104,
119, 132, 145, 155, 165, 173, 179, 183, 186, 187, 186,
183, 179, 173, 165, 155, 145, 132, 119, 104, 88, 72, 54, 36, 18};
You can calculate the sine table using my software Smart Sine: https://www.edaboard.com/blog/1798/
Hope this helps.
Tahmid.