--- Rith Nachampasak wrote: > Thanks for your replay Samo! > > 1. on your code below, why do you start with > GET_TEMPERATURE instead of FIRST CHANNEL? GET_TEMPERATURE is the name of a subroutine. It could be anything, it is just an example taken from an application that measured voltage from four temperature sensors. When subroutine is called, I first set up A/D module, THEN I start measuring. > > Here's what I'm trying to do: > > 1.Converting an analog voltage from 7-segments feeds > into MUX1 (8:1) then outputs to AN0 (PIC16C765) > 2.another 7-segment feeds into MUX2 (8:1) then > outputs AN1(PIC16C765) OK. No problem here. You will have two analog inputs. > 3.B'00000011' For ADCON1. This value gives you 5 analog channels and Vref on channel 3. Is that what you need? If no, than you need value 'xxxxx100'b in ADCON1. This makes channell 0 (RA0), 1(RA1) and 3(RA3) analog inputs, Vref = Vdd. Set TRISA bits 0 and 1. >AN7-AN5 as digital. These > three pin connected to MUX1 & MUX2 select lines > (A,B,C) OK. Configure PORTE pins as outputs. > 4.Need to do a continue LOOP count-up on the MUX1 & > MUX2 first to select IN0-IN6 from the MUX. to A/D OK. 1. set up propper value in ADCON1 2.set/clear appropriate TRIS bits for PORTA and PORTE 3.Set MUX control bits to 000, so you get voltage from first of your seven segments both on AN1 and AN2. 4. select first channel in ADCON0 and read it 5. select second channel in ADCON0 and read it 6.do what you need to do with results of first two conversions 7. Set MUX control bits to second segments. 8. Read again, until you read all 7 values on both channels. You can do this in a loop, just increment value on PORTE until you read all segments. 9. Go to number 3 again, when you need to read again. Regards, Samo > > --Rith __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu