I think like this... Right, you can setup the pot to give 2.5V at the input using a voltmeter. But then what ? Will you always use a voltmeter when setting the pot ? What does it matter if the motor stands still with 2.4V or 2.6V at the ADC input ? The visual difference in the setting of the pot would probably be very small. What kind of pot is it ? A regular 1-turn or some 10-turn pot ? I'd also guess that the differense between the ADC value with Vpp/2 (5V/2, right?) will be quite small compared with the theoretical half-range value (according to the datasheet). Probably just +/- a few bits, after all, that is what the datasheet specifies. And probably smaller then any visable difference from the mid-position setting of the pot. *Or* I must seriously be missing something here. :-) Jan-Erik. On 2010-11-21 01:38, James Newton wrote: > Think about that for just a second? > > If I /knew/ the value of ADRES to inject, why would I be trying to find i= t? > > -- > James Newton > 1-970-462-7764 > > -----Original Message----- > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf = Of > John Temples > Sent: Saturday, November 20, 2010 16:24 > To: Microcontroller discussion list - Public. > Subject: RE: [PIC] pickit2 unreliable debug 12F675 > > On Sat, 20 Nov 2010, James Newton wrote: > >> In this specific case: I have a pot connected to AN0 and set so that 2.5= v > is >> on the pin. Now I want to know exactly what ADC count the chip is readin= g > so >> I can set that as the midpoint in my code and turn the motors one > direction >> when the voltage is lower and the other when it is higher. >> >> With a debugger, I simply read the ADC output register and I'm done. >> >> How would you get that value without the debugger? > > The simulator has a register injection feature that reads hex values > from a file that are injected into ADRES over time. > > -- > John W. Temples, III --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .