Has anyone who has used the example code for the A/D convertor on the 16c74A noticed "leakage" between channels? I don't know if it's because I'm not waiting long enough for the internal capacitor to settle or what, but I seem to get slightly different values read from AN2, depending on the voltage on AN1. The details: Here's the code from the Microchip document "Care and feeding of the PIC16C74 and it's peripherals" ---------- ; routine to do the a/d conversion. The channel number is in ; register Adcnt ; the result (8 bits) is transmitted as two Hex bytes, followed by a ':' adcnvrt movf Adcnt, 0 ; get a/d count value movwf Adcntw ; put in work register bcf STATUS, 0 ; clear the carry flag for the upcoming ; rotate operations rlf Adcntw, 1 rlf Adcntw, 1 rlf Adcntw, 1 movlw 0c1h ; load the initial ADCON0 value ; excepting channel select iorwf Adcntw, 0 ; set the pin select bits we want movwf ADCON0 ; set the ADCON0 with the new channel call wait ; wait for about 20 uSec bsf ADCON0, 2 ; start conversion adwait btfsc ADCON0, 2 ; wait for conversion done goto adwait ; (PJL) this is the added bit, do a second conversion after the ; first one has finished - see the text of the email below call wait bsf ADCON0, 2 ; start the second conversion adw2 btfsc ADCON0, 2 goto adw2 ; (PJL) back to textbook stuff movf ADRES, 0 ; get analog value call sendhex ; output the data return ------ Now, I have set up AN3 as an external Vref (2.55 volts - no it doesn't change when I read different channels). AN1 is fed from a 10K pot connected to +5V and 0V. AN2 is fed from a LM35DZ temperature chip that gives 10mV per degree C (hence the 2.55Vref) I would expect a room temperature value of 23 (0x17), however this varies from 22 up to 26 as I twiddle the pot on AN1. It is quite reproducible. I have done this on two 16c74A/JW's, but not tried it on different A/D channels. There is a time delay between reading channels of roughly 3-4 mSec while the just-read data is "sendhex'd" at 9600 Baud (3 bytes). I can fix the problem by throwing away the first A/D reading, and taking a second reading from the same channel, see the code between the (PJL) comments. Now the values don't change. Being an engineer at heart, I am happy to live with the above code change to get the right result, but I'd still like to know WHY and to see if anyone else has had a similar experience. Pete .............................................................................. . Never trust a man who, when left alone in ....... Pete Lynch . . a room with a tea cosy, doesn't try it on ....... Marlow, England . ..........Billy Connolly. ......................... pic@beowulf.demon.co.uk ..