Using ADC with 0-3.3V input on MXRT-1170-EVK board

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

Using ADC with 0-3.3V input on MXRT-1170-EVK board

Jump to solution
522 Views
AnweshaPanda
NXP Employee
NXP Employee

I am trying the demo example 'lpadc high sample rate sample signal cm7'

In the sdk it is mentioned that the max possible input to the ADC should be 1.8V. 

How can I change it to 3.3 V i.e. what and where do I need to change the program to make it happen as my sensors output signals in the range of 0-3.3V?

 

0 Kudos
Reply
1 Solution
395 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @AnweshaPanda,

Bit 13 of the CMDL register is precisely what needs to be changed. But considering that you are using the "lpadc high sample rate sample signal cm7" example code, it's much easier and effective to change the commandConfig variable that is already used in that code to modify this register. On line 149 of the "lpadc_high_sample_rate_sample_signal.c" file, you can change the value of commandConfig.sampleScaleMode from kLPADC_SampleFullScale to kLPADC_SamplePartScale as shown:
EdwinHz_0-1690256502674.png

The next line, "LPADC_SetConvCommandConfig(DEMO_LPADC_BASE, 1U, &commandConfig);" will then set up the registers with a part scale input rather than a full scale for your ADC module.

BR,
Edwin.

View solution in original post

0 Kudos
Reply
3 Replies
408 Views
AnweshaPanda
NXP Employee
NXP Employee

Hello @EdwinHz,  

 

Thanks for the answer. 

Hello, our vref is 1.8. Where in the code I need to change? I think I need to change the 13th bit of CMDL register. Is it possible for you to share the snippet? 

396 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @AnweshaPanda,

Bit 13 of the CMDL register is precisely what needs to be changed. But considering that you are using the "lpadc high sample rate sample signal cm7" example code, it's much easier and effective to change the commandConfig variable that is already used in that code to modify this register. On line 149 of the "lpadc_high_sample_rate_sample_signal.c" file, you can change the value of commandConfig.sampleScaleMode from kLPADC_SampleFullScale to kLPADC_SamplePartScale as shown:
EdwinHz_0-1690256502674.png

The next line, "LPADC_SetConvCommandConfig(DEMO_LPADC_BASE, 1U, &commandConfig);" will then set up the registers with a part scale input rather than a full scale for your ADC module.

BR,
Edwin.

0 Kudos
Reply
496 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @AnweshaPanda,

The RT1170 supports ADC inputs of at most VREF, which has a maximum operating voltage of 1.89V. This is why the SDK mentions that you the input should not exceed 1.8V.

However, what you can do is reduce the input voltage from 3.3V. The RT1170 has an integrated scaling option that will reduce the input voltage by a factor of 30/64. As mentioned on Section "87.7.13.3" of the Reference Manual, a 3.3V ADC input will be scaled down to 1.54V. Therefore, by enabling CSCALE as well as supplying VREFH with 1.54V, you will get an appropriate digital conversion for your sensor.

EdwinHz_0-1689978806419.png

 

BR,
Edwin.

0 Kudos
Reply