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

a/d reading jumping

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







a/d reading jumping
PostPosted: Thu Apr 22, 2004 10:09 am     Reply with quote

Folks, seem to be having a spot of bother with the A/D on my 16f877

on the development i am using they have a pot connected to A0, i have tried my program on this and it works,

then i tried connected an external input to A1 from a amp to it and it jumps....alot the Vin is staying at 3.217v (its a very accurate multimeter#) however the reading is jumping between 123-167

by my calculations it shoud read 5/256=2omv =>3.217*.02= 160

intially it was jumping more, but i figured that it was become they hadn't a commom ground, so i connected the 2 grounds and this brought down the level of jumps.

Any idea whats going on?????
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Thu Apr 22, 2004 10:19 am     Reply with quote

Are you switching between A0 and A1? Are you allowing enough settling time after selecting the channel and before starting the conversion? Are you getting crosstalk between channels?

Just a few thoughts.
_________________
The search for better is endless. Instead simply find very good and get the job done.
Guest








PostPosted: Thu Apr 22, 2004 10:44 am     Reply with quote

nono,

i am only using one channel.

i was just saying that i have teste dit on Ao and it works, so the code i think is ok,

any other ideas.
fonta
Guest







PostPosted: Fri Apr 23, 2004 3:14 am     Reply with quote

Hello frustrated.What is your Vref+ and Vref-?.Your Vref must be a stable and precise voltage, for example 5.00V.You must use a LM4040-5.0, REF02 ,etc.. for your Vref.
Bye.
Gerrit



Joined: 15 Sep 2003
Posts: 58

View user's profile Send private message

PostPosted: Fri Apr 23, 2004 3:37 am     Reply with quote

If you use internal ref. did you measure (with a scope) the voltage
on the controler.

are you flashing some light (LED) during conversion ?

are there other loads on the ouitput pins that are pulsed ?

is there an other pulsinf load on your powersuply ?



Gerrit
frustrated
Guest







PostPosted: Fri Apr 23, 2004 4:13 am     Reply with quote

Hi again,
thanks for your help so far.

i am using the internal Vref.

it s just wrecking my head that the program works on Ao (using pot on development board)but not on A1 with an input not from the development board.

i'll try connecting Ao to A1, and take the reading from A1, this way i should be able to see if it is a problem with that port.

mean while, keep the suggestions coming.

thanks
frustrated
Guest







PostPosted: Fri Apr 23, 2004 7:02 am     Reply with quote

ok,

i connected the A0 and A1, when taking the reading from A1 it worked the way it was suppose to,.

i know have my desired input connected to A1 an it is jumping, (i have it running off the same power supply aswell , so there shouldn't be problem with the supply)

i really need this sorted asap,

so come on people any ideas.

do i need a resistor before my input?
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

View user's profile Send private message Send e-mail

PostPosted: Fri Apr 23, 2004 8:18 am     Reply with quote

The signal you are bringing onto the board, what is producing it? Is its impedance less than 10K Ohm (100 Ohm or less would be great)? How are you making the connection? 27 feet of randomly choosen wire from the trash heap? Or a neat and tidy connection?

Just looking with a DMM doesn't mean much because they don't have bandwidth. Use an oscilloscope to check your signal for noise. What you are describing is a very common symptom of 60Hz (50Hz) hum riding on your desired signal. If you have much cable length at all between your source and the ADC and there is too much impedance.

You mentioned a missed ground connection before. Are you sure you made the ground connection properly and didn't get one hole/pin off on the connector (I've done that too many times to count).

Are you allowing sufficient time for the ADC reading in your code? If the on-board potentiomenter is working ok then you are probably fine codewise but just checking.
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

PostPosted: Fri Apr 23, 2004 8:43 am     Reply with quote

If you bring the input signal to the PIC pin through a 1K resistor and place a ceramic 10uF cap between the input pin and ground that should eliminate noise above 100Hz. An easier first step would be to add just the capacitor. Are you using twisted pair wiring?
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