On an 16f690, ICSPDAT is RA0, not RB7. See the datasheet and the schematics in the user guide: http://ww1.microchip.com/downloads/en/DeviceDoc/Low%20Pin%20Count%20User%20= Guide%2051556a.pdf Joep 2010/7/29 Jan-Erik Soderholm : > > On 2010-07-29 19:55, Joep Suijs wrote: >> RA0 is also wired to the ICSP connector. I guess you have disconnected >> the programmer? > > I thought about that and specificaly looked for it > but I can not see that RA0/AN0 is connected to > the ICSP connector. > > The ICSP connector has : > > 1: Vdd/Vpp > 2: Vss > 3: GND > 4: ICSPDAT, RB7 > 5: ICSPCLK, RB6 > 6: AUX, RA4 > > How is RA0/AN0 connected to the ICSP connector ? > > >> >> 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 ca= p >>>> and then using the A/D or comparator to measure the time it takes to g= et >>>> to a certain voltage. >>>> >>> -- >>> http://www.piclist.com PIC/SX FAQ& =A0list 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 > --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .