RA0 is also wired to the ICSP connector. I guess you have disconnected the programmer? Joep 2010/7/29 Jan-Erik Soderholm : > > > On 2010-07-29 18:56, alan.b.pearce@stfc.ac.uk wrote: >>> No, just the standard "PICkit2 Starter Kit" : >>> http://www.microchip.com/pickit2/ >>> >>> The 28-pin demo board in that kit : >>> http://ww1.microchip.com/downloads/en/DeviceDoc/41301A.pdf >>> Scematic at page 9, the pot at the top of fig A-1. >>> >>> It's the voltage drop over R7 that is my concern. >>> >>> >>> Jan-Erik. >> >> Well, I suspect we are at a point where something in your code is >> setting RA0 to an output and setting it low, i.e. writing 0 to both >> TRISA and PORTA. > > It's not "my" code. :-) > > The code is "lesson 4" in the PICkit2 low-pin-count demo code kit. > I have put a copy of the actual code here : > http://jescab2.dyndns.org/pub_docs/a2d_asm.txt > > I tried to do some minor adjustments (only enabling AN0, shutting > WPU off and so on) but no changes at all. > > > >> >> AIUI having a port bit set to analogue doesn't stop it being used as a >> digital output port. This is used to advantage in some sneaky schemes >> for doing things like making capacitance meters, by discharging the cap >> and then using the A/D or comparator to measure the time it takes to get >> to a certain voltage. >> > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .