Thanks for the replies! I will look into it and let yall know what happens. Only thing is I don't remember this being a problem when I ran this same code on a 16f876.
Thanks for the replies! I will look into it and let yall know what happens. Only thing is I don't remember this being a problem when I ran this same code on a 16f876.
If I was going to do the same thing and use the 'software' PWM command, I might change your original code to what I put above, or maybe use a word value instead of a byte and change the cutoff point to 32767, or reset the counter if it hits 100, or 10000, or whatever.
I see what was causing the motor to rev up. If you loop the PWM signal but if there is a PAUSE (i.e flashing an LED) before looping back this causes it to act this way. I think the motor responds this way when it is turned off. But if you loop back quickly the Pulse seems continuous with no hiccups. Yall are right, that I will probably have to use hardware PWM because I would be taking input from Infrared and doing some calculations before looping back.
Thanks for the suggestion again guys!
Bookmarks