I am trying to do analog to digital conversion. When I read any analog input ANx I get the value present at pin AN0. For example, I have AN0 connected to 2v, AN1 connected to 5v, and AN2 to GND. An A/D conversion on any of these channels yields ~420, plus or minus a couple. This is the result I'd expect on AN0 but not the other pins. I have double and triple checked that I am setting the channel correctly before acquisition of each channel. Below is the problem area of the code, with the AdcGet routine straight out of a hobbyist magazine. Please help, this is my first pic project and a couple of my friends need it working next week to faciliate the completion of a school project. The project should ultimately collect data and store it to a palm os device via the usart. Currently most everything works, including storing collected data into the palm, but AN0 is repeatedely sent to the palm rather than AN0..5. Lindsay ReadAnalogData ;----------- Read Read and store Acceleromter X Axis movlw d'0' movwf CHAN call AdcGet ; Read Analog Input movf MEMLO,W movwf ACCEL_X_AXIS_LO movf MEMHI,W movwf ACCEL_X_AXIS_HI ;----------- Read and store Acceleromter Y Axis movlw d'1' movwf CHAN call AdcGet ; Read Analog Input movf MEMLO,W movwf ACCEL_Y_AXIS_LO movwf PORTB ; even if I connect AN1 to GND PORTB ; remains the value of the LSBs of AN0 movf MEMHI,W movwf ACCEL_Y_AXIS_HI ;----------- Read and store Acceleromter Z Axis movlw d'2' movwf CHAN call AdcGet ; Read Analog Input movf MEMLO,W movwf ACCEL_Z_AXIS_LO movf MEMHI,W movwf ACCEL_Z_AXIS_HI ;----------- Read and store Gyro X Axis movlw d'3' movwf CHAN call AdcGet ; Read Analog Input movf MEMLO,W movwf GYRO_X_AXIS_LO movf MEMHI,W movwf GYRO_X_AXIS_HI ;----------- Read and store Gyro Y Axis movlw d'4' movwf CHAN call AdcGet ; Read Analog Input movf MEMLO,W movwf GYRO_Y_AXIS_LO movf MEMHI,W movwf GYRO_Y_AXIS_HI ;----------- Read and store Gyro Z Axis movlw d'5' movwf CHAN call AdcGet ; Read Analog Input movf MEMLO,W movwf GYRO_Z_AXIS_LO movf MEMHI,W movwf GYRO_Z_AXIS_HI return AdcGet bcf STATUS,C movf CHAN,W movwf STORE rlf STORE,F rlf STORE,F rlf STORE,F movlw B'10000001' iorwf STORE movwf ADCON0 clrf DELAY Wait1 decfsz DELAY,F goto Wait1 Sample bcf PIR1, ADIF bsf ADCON0,GO Wait2 decfsz DELAY,F goto Wait2 Wait3 btfsc ADCON0,GO goto Wait3 GetVal movf ADRESH,W movwf MEMHI bcf STATUS,RP1 bsf STATUS,RP0 movf ADRESL,W bcf STATUS,RP0 movwf MEMLO call Delay64I ; 64 Instruction 2*Tad delay return -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body