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 support@ccsinfo.com

A/D problem with 18F458, with solution...

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








A/D problem with 18F458, with solution...
PostPosted: Fri Mar 30, 2007 11:35 am     Reply with quote

I have just spent the last couple of days trying to get the A/D (channels 2,3) working on a 4Mhz 18F458. It would read the data but when the voltage on one input changed the value from the other channel changed! Convinced myself it was to do with the Vref and checked everything, new chip, new signal soures, checked the ADCON0 and ADCON1 regs, read the data sheet....
In the end it was because I had no delay between switching to the A/D channel and reading the A/D. Once I put in a 25uS delay and it all works perfectly!
Will try to remember this for next time....
Mike (cambridge, UK)
mskala



Joined: 06 Mar 2007
Posts: 100
Location: Massachusetts, USA

View user's profile Send private message

PostPosted: Fri Mar 30, 2007 8:23 pm     Reply with quote

That's good to know. I looked in the data sheet (I use a 18F452) and didn't see that as a requirement. I haven't noticed this problem, but I sample each of 2 channels a bunch of times before switching.

Thanks
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