PIC16f877A 50 Hz pwm generation

Status
Not open for further replies.

tusemo

Advanced Member level 4
Joined
May 28, 2012
Messages
109
Helped
23
Reputation
48
Reaction score
22
Trophy points
1,298
Location
Turkey
Activity points
1,841
Is it possible to generate 50 Hz pwm signal to drive servo by pic 16f877a (20Mhz crystal- And I want to use cpp modules)
 

Yes it is possible to use PIC16F877A to generate 50 Hz PWM signal to drive servo. In the CCP module, generating PWM with frequency of 50Hz is not possible with clock frequencies in the MHz range, where you should use the compare part of the CCP module.

Hope this helps.
Tahmid.
 

Because of that I have used 1843200 Hz crystal to be able to generate 50Hz signal but in that case I couldn't communicate with pic by using Rx pin (I am using pic16f877a)
 

Instead of lowering clock frequency (thereby increasing instruction time) so that you can use the PWM part of the CCP module, just use the compare part of the CCP module along with Timer 1.
 

Can you give code example of using compare mode for generating 50 Hz pwm signal ?
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…