Saturday, June 28, 2008

More Success on the pic pwm!

I finally figured out how to decrease the amount of jitter in the servo produced by the flickering of values coming from the Analog to Digital Converter!

The pic microcontroller I use has a 10bit ADC resolution. Until now I thought this was the most annoying thing ever, since most of the instructions are byte (8bit) operations. They gave you the option of having the output of the ADC Left Justified or Right Justified, so there was always this pair of bits that was lost.
I just realized recently that if I ignore the two lower most bits, and I force the ADC output to be 8bits, I can get the flickering of the ADC values to not affect the pwm signals. This way I can clean up the movement of the servos, and not have to add resistors as I previously did.