adc output problem in pic18f4550.

Status
Not open for further replies.
hi,

my ADC program runs successfully for internal vref. I am taking output of accelerometer. when i changed my Vref+ and Vref- from internal to external. But there is one problem. problem is when input voltage is given to pic it gives 0v as output and when no input is given, it gives maximum voltage at output... my code is also given.

 
What version of C18 are you running..... I have had MAJOR issues with OR / AND masks in the ADC.h file.......Can you simulate it in MPLAB and look at the ADCON0 & ADCON1 registers AFTER the initialization. Just for your reference... Mine were all inverted... I had to write to the ADCON registers separately.

It may not be YOUR issue but it's worth looking into.

I am running the latest version and I have since replaced the ADC.h with an earlier version, It now works for me
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…