in theory the right setting have to be
Code:
ANSEL=%00110001
CMCON=7
GPIO=0
TRISIO=1
and later i just change the main loop to...
Code:
Main:
ADCIN 0, DUTYVAR3
GOTO Main
AND NOW it's working pretty good and smooth... well here...
For once i found a use of the Left-Justified results... Never thought ADCIN handled it 
Make sure your Pot impedance meet the maximum recommended on.. 2.5 k if my memory serves me well. 10K here (EasyPic 4) still work fine..
Also, as the ADC results is a 8 bit result, you should change the SPWM_RES to 255.
Last edited by mister_e; - 15th February 2007 at 19:28.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks