iMXRT1172 ADC input channel voltage range query

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

iMXRT1172 ADC input channel voltage range query

Jump to solution
2,169 Views
vihang_vinayak
Contributor II

Hi,

We are using MIMXRT1172AVM8A processor in our board. We want to use ADC feature of the processor. The VREFH pin is connected to 1.8V.

In our device our ADC input signal is 0 to 3.3V range. Can we give this pin directly to the processor ADC channel pin.

If yes, than what modification we need to do in the processor configuration registers for detecting this

0 to 3.3V range at the ADC channel input pin. Please suggest.

 

Regards,

Vihang Waze

0 Kudos
Reply
1 Solution
2,023 Views
Leon_Li1
NXP Employee
NXP Employee

Hi vihang_vinayak

I have test your code today. 

I do not found any ADC result issue.When I give a 2V voltage signal, the ADC result is about 2133 as below picture.

Leon_Li1_0-1672968966451.png

 

When I give 1.2V voltage signal, the ADC result is about 1280 as below picture.

ADC2.png

The test condition :

  1. SDK version: 2.12.0
  2. VREFH is 1.8V
  3. Setting CSCAL bit to '0'
  4. J9-10 connet sample voltage signal V+
  5. J10 -19 connet sample voltag signal gnd

Note:Due to use SDK version: 2.12.0, I change "triggerPrioirtyPolicy" to "triggerPriorityPolicy" in line 140 of peripherals.c

The code in attachment.
 
Also we would like your opinion if we are receiving the input signal is 0 to3.3V range on the ADC pin then should we connect the vref to 1.54V to sample the complete signal? 
 
The suggestion is 1.54v is not necessary. 1.54v is a example.
We can use 1.8v, then we can get 1.8*(64/30) = 3.84v.  It can cover 0-3.3v.
 

View solution in original post

0 Kudos
Reply
10 Replies
2,156 Views
lucas_cao
NXP Employee
NXP Employee

lucas_cao_0-1671679494716.png

 

0 Kudos
Reply
2,147 Views
vihang_vinayak
Contributor II

Hi Lucas,

Thank you for your reply and details

For initilal verification we tested the ADC on the iMRT1176 Eval kit as per the details you shared.

The iMRT1176 Eval kit has the VREFH connected to 1.8V

We configured the CSALE bit to '0' for the particular ADC channel pin and applied varoius signal levels 0V, 1.2V, 1.8V, 2V, 2.5V, and 3.3V.

For levels between 0V to 2.0V, we could read the ADC values as 0 to 3111 (12-bit ADC) but,

For all the voltage levels above 2V upto 3.3V we observed that the ADC is reading 4095 for all the levels 2.1V, 2.5V, 3V, 3.3V.

Can you help and let us know, if we are missing any more configurations to be change in the processor code

Thanks for your kind support

Regards

Vihang Waze

 

 

0 Kudos
Reply
2,122 Views
Leon_Li1
NXP Employee
NXP Employee

Firstly, double check if he CMDLx[CSCAL] register is set to “0” rightly in IDE and this CMDLx is right associate ADC channel corretly.

Secondly, please make sure your supply signal ground connect to the board ground.

Thirdly, you can set CMDL[CSCAL] to “1”,and then check that give 0V, 1.2V, 1.8V,the ADC values is right or not.

Signal

ADC value(12 bits)

0

0

1.2

2730

1.8

4095

0 Kudos
Reply
2,118 Views
vihang_vinayak
Contributor II

Hi Leon_Li1,

As you said we checked by setting CMDL[CSCAL] to “1” we are getting correct values as mentioned in the table.

But we want to measure ADC voltage from 0 to 3.3. Hence after setting CMDL[CSCAL] to "0" the input range is extended till 0 to 2V only i.e.

Input    |   ADC value

0V        |         0

2V        |    4095

Is this right in case of Vref = 1.8? or should we set the Vref = 1.54?

Thanks for your support

Regards

Vihang Waze

 

0 Kudos
Reply
2,108 Views
Leon_Li1
NXP Employee
NXP Employee

Hi vihang_vinayak,

It is right when Vref = 1.8.

 When set CMDL[CSCAL] to "0", the ADC result should be

SignalADC value(12 bits)
0v0
1.2v1280
1.8v1920
2v2133

Please double check ADC value of 1.2v and 1.8V. Make sure the CMDL[CSCAL] to "0" rightly and work.

There are some demos in SDK. Such as "lpadc_polling", you can use this demo switch CMDL[CSCAL]  to test.

I am work from home, so the resource is limited.

Also you can provide your code, I will test it ASAP.

 

 

 

 

0 Kudos
Reply
2,038 Views
vihang_vinayak
Contributor II

Hi Leon,

As you said we checked with 1.8V Vref and setting CSCAL bit to '0'.

At 2V we are getting 4095 only

I have shared you the code . . Please check from your side if we are missing any configuration

Please find the attachment

Thank you for your help and support.

Also we would like your opinion if we are receiving the input signal is 0 to3.3V range on the ADC pin then should we connect the vref to 1.54V to sample the complete signal? Please give your suggestions on this

Regards,

Vihang

0 Kudos
Reply
2,024 Views
Leon_Li1
NXP Employee
NXP Employee

Hi vihang_vinayak

I have test your code today. 

I do not found any ADC result issue.When I give a 2V voltage signal, the ADC result is about 2133 as below picture.

Leon_Li1_0-1672968966451.png

 

When I give 1.2V voltage signal, the ADC result is about 1280 as below picture.

ADC2.png

The test condition :

  1. SDK version: 2.12.0
  2. VREFH is 1.8V
  3. Setting CSCAL bit to '0'
  4. J9-10 connet sample voltage signal V+
  5. J10 -19 connet sample voltag signal gnd

Note:Due to use SDK version: 2.12.0, I change "triggerPrioirtyPolicy" to "triggerPriorityPolicy" in line 140 of peripherals.c

The code in attachment.
 
Also we would like your opinion if we are receiving the input signal is 0 to3.3V range on the ADC pin then should we connect the vref to 1.54V to sample the complete signal? 
 
The suggestion is 1.54v is not necessary. 1.54v is a example.
We can use 1.8v, then we can get 1.8*(64/30) = 3.84v.  It can cover 0-3.3v.
 
0 Kudos
Reply
2,000 Views
vihang_vinayak
Contributor II

Hi Leon_Li1,

We tested with the code you shared and we were able to read  2133 at 2V, and 1280  at 1.2V and can go up till 3.3V.

Can you please share in detail what changes you made in the code to get the above values. This will help us to correct our approach for other ADC pins configuration

Thank you for your valuable support and help.

Regards,

Vihang

0 Kudos
Reply
1,992 Views
Leon_Li1
NXP Employee
NXP Employee

Due to use SDK version: 2.12.0, I only changed "triggerPrioirtyPolicy" to "triggerPriorityPolicy" in line 140 of peripherals.c. Please make sure your SDK version No..

I did not change any others.

I think there were some issues in your test process before.

0 Kudos
Reply
2,144 Views
lucas_cao
NXP Employee
NXP Employee

Hi @vihang_vinayak 

Well, i cannot hlep your new question. 

Hi @Leon_Li1 

Can you help here?

0 Kudos
Reply