Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Having accuracy problem with PIC16F877A ADC

Status
Not open for further replies.

Mehmood Ahmed

New Member
Hi,

I am having accuracy problem with PIC16F877A ADC. I am using 2 ADC channels for analog signal input and switching one after reading value on other channel continuously in ADC interrupt. I have set Vref- on 1Volt and Vref+ on 3 references are fixed and showing no variations. after scaling the readings i am putting result on seven segment displays and pwm channels for each analog input. both channels giving variation in reading of around 2~3BIT LSB at fixed input signal. I am using dc signals for input.

Thanks
 
A reading that varies by 2 or 3 represents just 6mV at the Vref voltages given. Getting DC voltages that are ripple free is very difficult especially in a digital environment. I suspect it is simply noise. Try putting 100nF ceramic capacitors on the two input pins.

Another possible source of error is not allowing sufficient acquisition time.

Mike.
 
A reading that varies by 2 or 3 represents just 6mV at the Vref voltages given. Getting DC voltages that are ripple free is very difficult especially in a digital environment. I suspect it is simply noise. Try putting 100nF ceramic capacitors on the two input pins.

Another possible source of error is not allowing sufficient acquisition time.

I am using 20MHz clock,TAD = 64Tosc, giving 300us delay before channel switching and giving 300us after channel selecting which I think is enough time for acquisition. I have tried 100nF caps as well
 
What is your source impedance?, switching channels can be slow, as the sample and hold has to charge/discharge, which is dependent on the source impedance. If it's switched too fast, then the higher one reads low, and the lower one reads higher.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top