You can actually improve on that Dave...
Instead of...
ADCON0.2=1
PAUSE 50
RETURN
... which makes the assumption that your ADC reading will complete in 50mS... well - suppose it didn't? And suppose it only took only 50uS then you've wasted a shed load of time!
So, rather than a hit or miss approach, nail it properly...
ADCON0.2=1
WHILE ADCON0.2=1:WEND
RETURN
To find out why I've done this, read the Datasheet description for pin ADCON0.2




Bookmarks