Quote Originally Posted by malc-c View Post
I assume that using a 100 Hz frequency for the PWM would be ideal... what PIC did you use, and is having an internal clock an issue (I'm using a 12F675 for experimential use)
Malcolm,

I was using a 16F877A, I guess it was really comparing Apples to Oranges.

I figured I better check with a 12F675, but didn't have one handy so I used a 12F683. It was close enough to figure out what was wrong.

This get's everyone, so I should have seen it right away, but nope.

CMCON = 7 ; disable the comparators
ANSEL = 1 ; AN0 is analog, rest digital

also, You have a PWM output on GPIO.0 ... The same pin as the POT is connected to on AN0. That'll cause problems with the A/D reading.

Hope you're still interested?

EDIT: 100hz is no problem. But you'll need a faster crystal/resonator
INTRC won't cut it.

HTH,