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

VDDCORE/VCAP as ADC reference voltage!

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



Joined: 10 Oct 2012
Posts: 18

View user's profile Send private message

VDDCORE/VCAP as ADC reference voltage!
PostPosted: Thu Dec 06, 2012 3:44 am     Reply with quote

Hi all ,

I'm working on a project which I'll monitor voltage and current, using PIC18F67K22. I need to know whether I can use VDDCORE/VCAP pin as a voltage reference for ADC, which is on chip voltage regulator in this PIC (even though there are in build FVR 2.048 and 4.096v reference, I'm unsatisfied with its performance).
Ttelmah



Joined: 11 Mar 2010
Posts: 19545

View user's profile Send private message

PostPosted: Thu Dec 06, 2012 5:09 am     Reply with quote

Data sheet.....
Register 23-2. Bits 5..4.

Not directly.

Also look at Table 31.27 Entry A20. No matter how good your Vref is, it needs to meet this requirement if you are to get full accuracy from the ADC. Selecting the 2.048 source, will degrade the accuracy.

Remember that how well the ADC performs, depends on the quality of the chip's supplies as well as the actual reference chosen. Grounding in particular. Remember everything in the ADC works relative to AVss, not the chip's Vss, and that the processor itself _will_ be introducing noise onto it's supply lines. Also are you selecting the right ADC clock (if you use the internal clock, accuracy will plummet - again data sheet). The ADC input, because of it's capacitive nature, will also tend to integrate signals.

Best Wishes
RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

PostPosted: Thu Dec 06, 2012 5:23 am     Reply with quote

How is the FVR "unsatisfactory"? Is it an unsuitable voltage? Too noisy? Poor accuracy? Can't configure it? What is the problem?

The FVR is always going to be a better reference - more precise, lower noise - than any power voltage. Basically with any supply you don't know what voltage you're going to get, and its going to vary unexpectedly and non-repeatably. Any ADC referenced to a supply can never be expected to be better than around +/-5% accurate or so. Even 8 bit convertors are capable of close to ten times better accuracy than that. Power derived references hobble ADCs badly. Fine for very basic stuff, but you need a decent reference for anything serious. Granted the internal FVR is only a half-decent reference, and its output is not always available externally, butused sensibly its way better than any power rail.

RF Developer
m_embedded



Joined: 10 Oct 2012
Posts: 18

View user's profile Send private message

PostPosted: Thu Dec 06, 2012 6:54 am     Reply with quote

I have two boards which have the same controller I mentioned. In one board (controller 1) I'm getting nearly accurate value when i used 2.048 or 4.096 v, but in another one (controller 2) accuracy is low. For 1.31v I'm getting 1.36 v, internal voltage regulator for core enabled on both the boards.
RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

PostPosted: Thu Dec 06, 2012 7:45 am     Reply with quote

You read the errata for these parts, haven't you? It states that there is an offset issue with these parts. It can be calibrated out, but it will effect all readings.

Also, be careful with the references. There are instances of people expecting the 4.024V ref to work when their VDD is less than 4V! Realistically you need something like 0.5V or more of headroom above the reference for it to work properly. I haven't been able to find the exact figure: it should be in the data sheet somewhere.

Noise is a big issue, and poor circuit design can easily, and on occasions frighteningly, degrade ADC performance. Also be careful when you are using more than one ADC channel. You must ensure you have sufficient time after selecting a channel before converting it. I am struggling at the moment with a PIC18F8585 (a PIC with dire problems) needing four times longer acquisition time than the datasheet suggests). There are many things that degrade ADC accuracy. And yes, that includes the reference may not be very good.

RF Developer
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Thu Dec 06, 2012 10:56 am     Reply with quote

Quote:
i have two board , which have the same controller i mentioned , in one board(controller 1) i m getting nearly accurate value when i used 2.048 or 4.096 v , but in another one(controller 2) accuracy is low , for 1.31 v i m getting 1.36 v ,internal voltage regulator for core enabled on both the board

I don't see a specification of 18F67K22 VREF accuracy, but bandgap references of newer PIC24 chips
are specified with +/- 5%, the observed deviation is still within this range. Internal voltage regulators don't
offer a better specification, so you'll want to either use a higher precision external refernced or calibrate
the devices individually.
m_embedded



Joined: 10 Oct 2012
Posts: 18

View user's profile Send private message

PostPosted: Fri Dec 07, 2012 1:38 am     Reply with quote

I have studied the errata sheet of this family controllers and I have consider the offset values in my code.
When I use VSS and VDD as reference the values are accurate, so I can tell internal reference in this controller has poor performance.
Can anyone suggest me a higher precision external regulator for ADC reference ?
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Fri Dec 07, 2012 3:04 am     Reply with quote

MCP1541, AD1584. Almost every major manufacturer has a low dropout 4.096 reference available.
m_embedded



Joined: 10 Oct 2012
Posts: 18

View user's profile Send private message

PostPosted: Fri Dec 07, 2012 11:38 am     Reply with quote

FvM wrote:
MCP1541, AD1584. Almost every major manufacturer has a low dropout 4.096 reference available.


Thank you, I'll try with mcp1541 ...
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