MCF5213 ADC Disaster

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCF5213 ADC Disaster

1,816 Views
Juason
Contributor I
Hello everyone,
 
   I've come acrossed a bit of conflicting documentation regarding the ADC and VREFs of the MCF5213.  For starters the CAL register and surrounding illustrations in the HW Reference manual Rev3 from 3/2007 seems to indicate this processor supports both internal and external VREFs - however the internal VREF voltage is never given.  Further confusing the issue is the CAL register definition which has INTERNAL and AN2/AN6 given for the options.  Where does AN2/AN6 come from?  Is this an error? I thought VRH and VRL were the Vref pins?
 
   In our design we use a 3.3V supply for the Coldfire and a 3.0V Vref for the VREFH pin which is connected to the VDDA pin.  I later found the errata showing that VREF needs to be 3.1V or higher to avoid random crazy values from coming out of the ADC - a problem we've not seen but are going to redesign to avoid. 
 
   The reason why I'm asking for clarification is because the ADC scale seems off and noisy, and the CAL register seems broken.  
 
- First of all I have the CAL register set to 0 which indicates an internal VREF.  If I set the external vref bits the ADC fails to return anything but 0s. 
 
- Second, the input range to the ADC is 0-3.0V to coincide with the VREF of 3.0V.   However at 3.0V I'm seeing an ADC result of 3900ish - which implies a 3.3V vref is really being used.  The only way this is possible is if there is an internal VREF.
 
- Third I'm noticing quite a bit of noise in my ADC readings that does not correlate to measured noise using a scope. 
 
   Thanks in advance for any help on this. 
 
 
- Jason
 
  
Labels (1)
0 Kudos
3 Replies

443 Views
mjbcswitzerland
Specialist V
Hi Jason

If you set the bits SEL_VREFH and SEL_VREFL in the CAL register, the (normally) ADC inputs AN2 and AN6 are used as VREF inputs - this means that these should be connected to the reference voltages (eg. 0V and 3.0V - assuming these are the reference voltages). These are then used instead of the dedicated VREFH and VREFL inputs.

I believe the internal REF that you are implying to is in fact the reference which has been selected (either from VREF inputs of the alternative ones). I don't think that any of the chips with the 12 bit ADC has an internal reference of its own so something has to be connected - make sure that it is also well filtered to achieve good results (suggestions are in the user manuals)

Regards

Mark

www.uTasker.com

0 Kudos

443 Views
Juason
Contributor I
If that is the case, then the 544 page Reference Manual was written in haste without any regard for the end user.    I apologize for being upset, but I consistantly get burned by incorrect and contradictory datasheets from Freescale. 
 
Does it point out AN2/6 anywhere else in the Reference Manual?     In Block Diagram 23.3 you can see VREFH and VREFL are not coming in via AN2/6.  It is an entirely separate block which is why I thought the VRH and VRL pins were the VREF. 
 
Furthermore in diagram 23.5 you can see VREFL on both ADC muxs.  There is no mention of VREFH, and no indication it must use AN2 or AN6. 
 
Lastly the VRH and VRL pins are called out as the VREF pins in the signal diagrams!
 
Would you happen to know how AN2/6 applies to the Errata?  Do I still need to tie the VRH and VRL pins to VDDA and VDDS?  Or do I only need to tie AN2/AN6?  Or both?  According to the errata if I don't do this correctly the ADC is going to randomly spit out bogus values :/
 
As for the internal reference, I have to believe one exists from my results.  I do appreciate the reply.  I am just frustrated, and often feel as though I am the first person ever to be utilizing the peripherals on freescale parts :smileytongue:
0 Kudos

443 Views
Juason
Contributor I
Update:
 
Freescale support got back to me regarding this issue.  They believe there is no internal ADC Vref and acknowledged the data sheet is incorrect.  They were not able to explain why the part is scaling to 3.3V off a 3.0V reference using the VRH and VRL pins, and I do not have AN2/AN6 hooked up for comparison.  So that will have to remain a mystery....
 
They said the CAL register actually selects between external references provided at VRH/VRL and AN2/AN6.  While that logically makes no sense, it does mimic the behavior I have seen.

SEL_VREFH -0 VRH -1 AN2

SEL_VREFL -0 VRL -1 AN6

They were not entirely sure about the +3.1V vref errata and how it applied to the MCF5213.   They said the errata does apply to the MCF5213, but could possibly not affect the AN2/AN6 pins.  So when using the 5213 you will need to use a 3.1 to 3.2 V vref, only.

I hope this offers some clarity for anyone else facing this problem in the future.

 
0 Kudos