Nov 19, 2012 #1 J john120 Banned Joined Aug 13, 2011 Messages 257 Helped 11 Reputation 22 Reaction score 10 Trophy points 1,298 Activity points 0 Hi evry body I am trying to generate pwm and control the speed of my dc motor,but the speed is variable with rotative encoder, can u plz help me with ccs c compiler codes.?? Thanks!!
Hi evry body I am trying to generate pwm and control the speed of my dc motor,but the speed is variable with rotative encoder, can u plz help me with ccs c compiler codes.?? Thanks!!
Nov 20, 2012 #2 H horace1 Advanced Member level 5 Joined Nov 18, 2008 Messages 2,118 Helped 596 Reputation 1,188 Reaction score 571 Trophy points 1,393 Location Norwich, UK Activity points 13,063 for PWM see section 15.0 of the pic16f877a datasheet https://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010242 if the device does have have hardware QEI for the encoder you can use software QEI (use interrupt on change) https://mbed.org/users/aberk/libraries/QEI/le4bkf/docs/QEI_8cpp_source.html
for PWM see section 15.0 of the pic16f877a datasheet https://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010242 if the device does have have hardware QEI for the encoder you can use software QEI (use interrupt on change) https://mbed.org/users/aberk/libraries/QEI/le4bkf/docs/QEI_8cpp_source.html