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 Rounding

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







A/D Rounding
PostPosted: Mon Jan 10, 2005 9:17 am     Reply with quote

Just getting back to using Pics again after 3 years absence, got a question that I should know the answer to but can't remember.

When doing A/D conversion (8bit) you only get a value between 0 - 255 right?

Now my question - when does the value change from say 50 to 51?
Does it round up ie once the true value would be 50.51 does it round up to 51 or does it stay at 50 until the voltage on the A/D pin is at least equal to 51.

Hope you can understand what I'm asking

regards

JFK
SherpaDoug



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

View user's profile Send private message

PostPosted: Mon Jan 10, 2005 9:31 am     Reply with quote

The answer is dominated by the signal noise and the error level of the A/D. Most modern A/Ds are guaranteed monotonic, which measn a rising voltage will go from 49 to 50 to 51 not skipping any values, but this is not guaranteed unless the spec sheet says so. Even still the range of voltage represented by "50" could be vanishingly small, or nearly twice as large as "nominal". Many A/Ds have trouble at the point the MSB switches. The step width for 0x7F may be very different from the step width for 0x80.
Better A/Ds may be guaranteed to 1/4LSB in which case each output is at least 1/4 of nominal width. But 50.51 implies 1/100LSB which just ain't going to happen!
_________________
The search for better is endless. Instead simply find very good and get the job done.
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