Problem with bandgap V conversion

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

Problem with bandgap V conversion

Jump to solution
1,107 Views
sys
Contributor III

Hello,

I'm having troubles with the conversion in subject: I'm using Kinetis MKE02Z32VLH4 (2N22J), mounted on our custom board.

We are supplying VDDA/VREFH and VDD pins with 5V.

The ADC module is set to 12-Bit conversion, with these settings:

- Input clock select: Bus clock/2

- Prescaler: 8 (è frequency ~1048 kHz)

- Long sample time: Enabled

- Low power mode: Disabled

Reading Channel No 23 (bandgap), we read a value of 1442 on 4096 (12Bit). Considering that, from datasheet, the bandagap voltage should be about 1.16V, we obtain a Vdd voltage of 3.3V.

But we are supplying with 5V... Am I mistaking something? I would expect a value about of 950 corresponding to 1.16V with Vdd = 5V

Thanks in advance to all!

Labels (1)
Tags (3)
1 Solution
800 Views
davidsherman
Senior Contributor I

I ran into a problem with measuring the bandgap on a KE06, did you enable the bandgap in the Power Management Control?  It's not obvious that it has to be enabled first, and for me I was seeing unstable, far off results because it was reading something that wasn't connected.

View solution in original post

5 Replies
800 Views
sys
Contributor III

Thanks a lot!

that was the problem!

Thanks to everyone, real fast and useful answers!

Sorry Jingjing..both was Correct Answer..but I can select only one :smileyhappy:

Have great day u too

Sandro

PS: It is not clear to understand this setting reading datasheet..just a suggestion for next revision :smileyhappy:

800 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Sandro Mores,

     That good to hearing your problem is solved.

     It doesn't matter about the correct answer marking, it just demonstrate your question is soved.

    If you don't understand the datesheet, you can refer to our sample code.:smileyhappy:

Best regards!

Jingjing

0 Kudos
800 Views
davidsherman
Senior Contributor I

Thank you Jingjing, I have to concur that the ADC section of the user's manual makes no mention of having to enable the bandgap buffer first to use it.   Something that should maybe be considered for a manual addendum.  The analog comparator section does make mention of this when using it for the reference, but if someone was trying to use the ADC, they would not know unless they happened to read the chapter on the PMC or the ACMP.

0 Kudos
800 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Sandro Mores,

      1: You should make sure that you already enable the bandgap in PMC.

PMC_SPMSC1 |= PMC_SPMSC1_BGBE_MASK;

      2: Test your VDDA and Vrefh, whether it is 5V.

      3: Check your configuration code, I test it on our FRDM-KE02Z40M, my bandgap ADC resut is 985 with 5V VDDA, when I test my VDDA, I find it is actually 4.85V.

    Then my bandgap is : (985/4096)*4.85=1.166V, it meets the Vbg data in our datasheet.

        You can refer to my test code to check your code,  please find the test code from the attachment:

Wish it helps you!

If you still have question please let me know!


Have a great day,
Jingjing

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

801 Views
davidsherman
Senior Contributor I

I ran into a problem with measuring the bandgap on a KE06, did you enable the bandgap in the Power Management Control?  It's not obvious that it has to be enabled first, and for me I was seeing unstable, far off results because it was reading something that wasn't connected.