CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

what are some do's and don'ts for using the ADC

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
bcs99



Joined: 22 Nov 2003
Posts: 32

View user's profile Send private message

what are some do's and don'ts for using the ADC
PostPosted: Thu Apr 01, 2004 12:15 am     Reply with quote

As the topic says, I'm looking for some tips on ADC usage. I'm having problems with noisy or jumping readings. I've followed the base guidelines from the datasheet (18F452). I'm using a 20Mhz crystal. I am only using port A for analog so I've set the adc_ports to A_ANALOG I've set the adc clock to divide by 32. None of my imputs exceed the 10k impedance limit. I'm using the ADC_START_ONLY and ADC_READ_ONLY options with the read_adc function. I read only when the ADCON0.2 bit clears. The rest of my circuit functions well and I did not expect these inputs to be so noisy. So before redesigning the circuit I'm looking for some do's and don'ts for circuit and pcb layout. Any help would be greatly appreciated.

Bob
random_person
Guest







PostPosted: Thu Apr 01, 2004 1:07 am     Reply with quote

Found a link on Microchips forum website that may give you some ideas about how to improve ADC readings for PIC's in general

http://forum.microchip.com/printable.asp?m=28993&mpage=1.

Well i hope i'm not insulting your ADC intelligence, but a few general tips...

1. Make sure your aquisition time is sufficiently long enough to get an accurate reading. Since you are charging / discharging capacitors, make sure they have enough time to set. Not doing so might be a cause for "jumpy" or inconsistent readings.

2. As the link suggests...perhaps you need to implement some digital filtering for the ADC pins. That would help reduce the noise.

3. If that isn't an option...you can always implement a digital filter in software if you are knowlegable about those things. Another low tech solution i've resorted to is just averaging your digital readings...essentially "filtering" out some high frequency noise but you of course lose some accuracy.

Hope this helps Smile
random_person
Guest







PostPosted: Thu Apr 01, 2004 1:20 am     Reply with quote

And another thing suggested by the link...you might put some capacitor on Vcc/Vref of the PIC, which will help reduce noise on that pin in particular. I assume any noise across the Vcc/Vref pin will be reflected in your ADC readings.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group