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

12f675 a/d conversion resolution

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







12f675 a/d conversion resolution
PostPosted: Thu Mar 27, 2003 8:43 am     Reply with quote

Hi all

I am about to use the 12f675. Can I reduce the resolution of the a/d converter from 10 to 8 bits via the reference voltage pin? If so how is this done.
Many thanks.

Dave
___________________________
This message was ported from CCS's old forum
Original Post ID: 13135
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: 12f675 a/d conversion resolution
PostPosted: Thu Mar 27, 2003 11:32 am     Reply with quote

:=Hi all
:=
:=I am about to use the 12f675. Can I reduce the resolution of the a/d converter from 10 to 8 bits via the reference voltage pin? If so how is this done.
------------------------------------------------------------

You can truncate the result to just the upper 8 bits by
using the CCS adc=8 directive. Will that do what you want ?
Example:

#include "c:\Program Files\Picc\Devices\12F675.h"
#device adc=8

main()
{
char c;

// Put adc setup code here.

c = read_adc(); // Get 8 bit result

while(1);
}


___________________________
This message was ported from CCS's old forum
Original Post ID: 13150
dave.t
Guest







Re: 12f675 a/d conversion resolution
PostPosted: Fri Mar 28, 2003 4:06 am     Reply with quote

:=:=Hi all
:=:=
:=:=I am about to use the 12f675. Can I reduce the resolution of the a/d converter from 10 to 8 bits via the reference voltage pin? If so how is this done.
:=------------------------------------------------------------
:=
:=You can truncate the result to just the upper 8 bits by
:=using the CCS adc=8 directive. Will that do what you want ?
:=Example:
:=
:=#include "c:\Program Files\Picc\Devices\12F675.h"
:=#device adc=8
:=
:=main()
:={
:=char c;
:=
:=// Put adc setup code here.
:=
:=c = read_adc(); // Get 8 bit result
:=
:=while(1);
:=}
:=
:=

Hi PCM

Maybe what I should of said was how do applied voltages to the reference input affect the resolution of the converter when using an external voltage referance.
Many thanks.

Dave
___________________________
This message was ported from CCS's old forum
Original Post ID: 13183
R.J.Hamlett
Guest







Re: 12f675 a/d conversion resolution
PostPosted: Fri Mar 28, 2003 6:12 am     Reply with quote

:=:=:=Hi all
:=:=:=
:=:=:=I am about to use the 12f675. Can I reduce the resolution of the a/d converter from 10 to 8 bits via the reference voltage pin? If so how is this done.
:=:=------------------------------------------------------------
:=:=
:=:=You can truncate the result to just the upper 8 bits by
:=:=using the CCS adc=8 directive. Will that do what you want ?
:=:=Example:
:=:=
:=:=#include "c:\Program Files\Picc\Devices\12F675.h"
:=:=#device adc=8
:=:=
:=:=main()
:=:={
:=:=char c;
:=:=
:=:=// Put adc setup code here.
:=:=
:=:=c = read_adc(); // Get 8 bit result
:=:=
:=:=while(1);
:=:=}
:=:=
:=:=
:=
:=Hi PCM
:=
:=Maybe what I should of said was how do applied voltages to the reference input affect the resolution of the converter when using an external voltage referance.
:=Many thanks.
:=
There is a spec given for the chips, that lists 2v, as the minimum reference voltage span to give 10bit resolution. This presumably implies that the converter has a minimum detection threshold/step at about 2mV, which would tend to imply that the minimum Vref range compatible with an 8bit resolution, is in the order of 0.5v. However the data sheets do not say how the accuracy decays below this 2v threshold...

Best Wishes
___________________________
This message was ported from CCS's old forum
Original Post ID: 13189
dave.t
Guest







Re: 12f675 a/d conversion resolution
PostPosted: Fri Mar 28, 2003 8:29 am     Reply with quote

:=:=:=:=Hi all
:=:=:=:=
:=:=:=:=I am about to use the 12f675. Can I reduce the resolution of the a/d converter from 10 to 8 bits via the reference voltage pin? If so how is this done.
:=:=:=------------------------------------------------------------
:=:=:=
:=:=:=You can truncate the result to just the upper 8 bits by
:=:=:=using the CCS adc=8 directive. Will that do what you want ?
:=:=:=Example:
:=:=:=
:=:=:=#include "c:\Program Files\Picc\Devices\12F675.h"
:=:=:=#device adc=8
:=:=:=
:=:=:=main()
:=:=:={
:=:=:=char c;
:=:=:=
:=:=:=// Put adc setup code here.
:=:=:=
:=:=:=c = read_adc(); // Get 8 bit result
:=:=:=
:=:=:=while(1);
:=:=:=}
:=:=:=
:=:=:=
:=:=
:=:=Hi PCM
:=:=
:=:=Maybe what I should of said was how do applied voltages to the reference input affect the resolution of the converter when using an external voltage referance.
:=:=Many thanks.
:=:=
:=There is a spec given for the chips, that lists 2v, as the minimum reference voltage span to give 10bit resolution. This presumably implies that the converter has a minimum detection threshold/step at about 2mV, which would tend to imply that the minimum Vref range compatible with an 8bit resolution, is in the order of 0.5v. However the data sheets do not say how the accuracy decays below this 2v threshold...
:=
:=Best Wishes


Dear R.J.
Just got the electrical specs. on the 12f675 and it does confirm what you said - thanks for you help.
Regards.
Dave
___________________________
This message was ported from CCS's old forum
Original Post ID: 13198
R.J.Hamlett
Guest







Re: 12f675 a/d conversion resolution
PostPosted: Fri Mar 28, 2003 9:03 am     Reply with quote

:=:=:=:=:=Hi all
:=:=:=:=:=
:=:=:=:=:=I am about to use the 12f675. Can I reduce the resolution of the a/d converter from 10 to 8 bits via the reference voltage pin? If so how is this done.
:=:=:=:=------------------------------------------------------------
:=:=:=:=
:=:=:=:=You can truncate the result to just the upper 8 bits by
:=:=:=:=using the CCS adc=8 directive. Will that do what you want ?
:=:=:=:=Example:
:=:=:=:=
:=:=:=:=#include "c:\Program Files\Picc\Devices\12F675.h"
:=:=:=:=#device adc=8
:=:=:=:=
:=:=:=:=main()
:=:=:=:={
:=:=:=:=char c;
:=:=:=:=
:=:=:=:=// Put adc setup code here.
:=:=:=:=
:=:=:=:=c = read_adc(); // Get 8 bit result
:=:=:=:=
:=:=:=:=while(1);
:=:=:=:=}
:=:=:=:=
:=:=:=:=
:=:=:=
:=:=:=Hi PCM
:=:=:=
:=:=:=Maybe what I should of said was how do applied voltages to the reference input affect the resolution of the converter when using an external voltage referance.
:=:=:=Many thanks.
:=:=:=
:=:=There is a spec given for the chips, that lists 2v, as the minimum reference voltage span to give 10bit resolution. This presumably implies that the converter has a minimum detection threshold/step at about 2mV, which would tend to imply that the minimum Vref range compatible with an 8bit resolution, is in the order of 0.5v. However the data sheets do not say how the accuracy decays below this 2v threshold...
:=:=
:=:=Best Wishes
:=
:=
:=Dear R.J.
:=Just got the electrical specs. on the 12f675 and it does confirm what you said - thanks for you help.
:=Regards.
:=Dave
I know somebody who did a 'compass' application, running the AD with 1v reference, and he hadn't spotted this limit, and was puzzled when it failed to give the full resolution he expected. It'd be really interesting, to quantify how the accuracy does decline at lower voltages.
Hope you work out how far you can go with the resolution you need.

Best Wishes
___________________________
This message was ported from CCS's old forum
Original Post ID: 13201
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