12 bit ADC returns 3009 for VDD?

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

12 bit ADC returns 3009 for VDD?

2,234 Views
BasePointer
Contributor II
Hi,
 
I've  two batteries in my application to measure with ADC. I have some questions.
 
The function below returns 1483 when I select the channel as internal bandgap reference that is 1.2V. This is ok because 4095 * 1,2V / 1483 = 3.3V that is my MCU and ADC supply. If I choose the channel as VDD, VDDA, VDDSW or VDDASW (I don't excatly know what are the differences between them), same function returns 3009 for me and this correspond to 3009 * 1.2V / 1483 = 2.44V. I was expecting its to return 4095. Why does this happen?
 
If the MCU and ADC high reference voltages are same and 3.3V, and if AD0 channel is connected to a battery that is 3.6V over a 1K resistor, what should the function return for AD0 channel? Isn't it 4095?
 
MCU is under Non Disclosure Agreement !
 
Code:
unsigned int ReadADCChannel(unsigned char ch){  unsigned char i, resh, resl;  unsigned int result, total = 0;    //low power, fbus/4, long sample, 12bit, BusClk(fBus=~6.2Mhz)  ADCCFG = 0b11010100;     ADCSC2 = 0;  ch &= 0b00011111; // choose the channel    for(i=0; i < 16; i++)  {        ADCSC1 = ch;      while(!ADCSC1_COCO);      resh = ADCRH;    resl = ADCRL;    result = ((unsigned int)resh << 8) | resl;    total += result;  }    ADCSC1 = 0b00011111; // module disable      return(total / 16);}

 Thanks,
BasePointer.
Alban removed NDA info

Message Edited by Alban on 2007-02-09 09:00 PM

Labels (1)
0 Kudos
4 Replies

305 Views
Alban
Senior Contributor II
Hello BasePointer,
 
May I stress once again that you are in breach of your Non-Disclosure Agreement with Freescale ?
 
The people from the Forum cannot help you, as the device is not released to the public, anything specific to it should be reported to the person who gave you the engineering samples. Doing otherwise could have legal implications for your company.
 
Only when a product is launched the datasheet and MCUs are available to the public.
 

 
Vdd is the digital power supply.
Vdda is the analogue power supply.
 
Clarify "W" supplies with your supplier as they could be for internal test only.
Clarify with your supplier if the Vdd/Vdda reading should return the core voltage or pin voltage, as your MCU may use a 2.5V core.
In both case, this clearly needs to be clarified in the datasheet, feeding info back to your supplier should get the datasheet updated.
 
Regards,
Alban.
 
0 Kudos

305 Views
BasePointer
Contributor II
Hi Alban,
 
The MCU should be released on Feb, 08. I have follow the mcu since 2005, and you can't see any message here from me about it.
 
I have started the project and I have to ask these questions to learn more, I'm sorry for that.

 
I requested the updated datasheet. I'm waiting Embedded World 07 for it.

Thank you.

0 Kudos

305 Views
BasePointer
Contributor II
0 Kudos

305 Views
Alban
Senior Contributor II
Hi BasePointer,
Yep they are. You can now talk freely about them.
Still for very special support, I advise you to ask your MCU provider as rare are the people on the Forum working with this part yet.
 
For the Community: The LC60 is the first S08 with a specialist module to drive LCD.
As it is an S08, it is good for low power (battery operated devices) and debugging through BDM.
 
Cheers,
Alban.
0 Kudos