I don't have the datasheet in front of me, but don't you have to select GP2= as the A/D first? Try the gooligums tutorials, they work pretty much the s= ame = Cheers Craig -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of= Tamas Rudnai Sent: Tuesday, February 09, 2010 8:17 AM To: Microcontroller discussion list - Public. Subject: Re: [PIC] 10F analog I believe you should wait for a while before you start the conversion. Put a delay in between ADC ON and GO, and see if that helps. Tamas On Mon, Feb 8, 2010 at 2:57 PM, alan smith wrote: > Since its a little difficult to run the debugger on a 10F, just having th= e programming pins available (I prefer not buying the 10F adapter deal) I'm= trying to use a 10F as a programmable one-shot. > > I have code running now that toggles an LED so I know the timer portion i= s working fine. I connect up a pot to GP0, measure the voltage on the pin t= o make sure its adjusting, etc...so external stimulus is there. > > Should be pretty straight forward...Ive done analog capture many a time i= n 16F and 18F > > setup the control and port > > =A0 =A0 =A0 =A0movlw =A0 b'01000001' > =A0 =A0 =A0 =A0 =A0 =A0 =A0; =A0 ||||||||_ ADC on > =A0 =A0 =A0 =A0 =A0 =A0 =A0; =A0 |||||||__ ADC go/done > =A0 =A0 =A0 =A0 =A0 =A0 =A0; =A0 ||||||___ analog channel select > =A0 =A0 =A0 =A0 =A0 =A0 =A0; =A0 |||||____ analog channel select > =A0 =A0 =A0 =A0 =A0 =A0 =A0; =A0 ||||_____ x > =A0 =A0 =A0 =A0 =A0 =A0 =A0; =A0 |||______ x > =A0 =A0 =A0 =A0 =A0 =A0 =A0; =A0 ||_______ Analog 0 on GP0 (1=3Danalog) > =A0 =A0 =A0 =A0 =A0 =A0 =A0; =A0 |________ Analog 1 on GP1 > =A0 =A0 =A0 =A0movwf =A0 adcon0 > > =A0 =A0 =A0 =A0movlw =A0 b'11111011' =A0 =A0 ; set gp2 as an output > =A0 =A0 =A0 =A0tris =A0 =A0gpio > > > READ_ANALOG > =A0 =A0 =A0 =A0bsf =A0 =A0 adcon0,GO =A0 =A0 =A0 ; start a/d conversion > wait4done > =A0 =A0 =A0 =A0btfsc =A0 adcon0,GO =A0 =A0 =A0 ; test if done > =A0 =A0 =A0 =A0goto =A0 =A0wait4done =A0 =A0 =A0 =A0 =A0 =A0 =A0 ; > =A0 =A0 =A0 =A0movf =A0 =A0adres,w =A0 =A0 =A0 =A0 ; yes, load result > =A0 =A0 =A0 =A0movwf =A0 scaleValue =A0 =A0 =A0 =A0 =A0 =A0 =A0; and save= as value > =A0 =A0 =A0 =A0retlw =A0 0 > > > I have in the main body of the code where I use scaleValue to load for my= timer..ie...0-255 seconds. > > Anyone done analog capture with the 10F and can see anything wrong here? = =A0Timer isn't loading with a short value..I have .5V sitting on the pin so= that should be about 16 using a 3.3V supply. =A0Doens't appear to be doing= this. > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? =A0Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- = /* www.mcuhobby.com */ int main() { char *a,*s,*q; printf(s=3D"/* www.mcuhobby.com */ int main() { char *a,*s,*q; printf(s=3D%s%s%s, q=3D%s%s%s%s,s,q,q,a=3D%s%s%s%s,q,q,q,a,a,q); }", q=3D"\"",s,q,q,a=3D"\\",q,q,q,a,a,q); } -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist