Configure pin for analogue input for MXRT1050 (MIMXRT1052xxxxB)

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

Configure pin for analogue input for MXRT1050 (MIMXRT1052xxxxB)

Jump to solution
979 Views
ranjay_shandilya
Contributor III

Hi,

I am using IMXRT1050-EVKB. 

Processor: MIMXRT1052xxxxB
Package_id: MIMXRT1052DVL6B

I want to configure pin on the board so that it can receive analogue input. Can u please let me know which pin to configure and how to configure it. Is there any sdk example available which can be modified.

Note: Actual Input which I wanna provide is value of resistance connected to circuit.

Thanks

0 Kudos
1 Solution
959 Views
ranjay_shandilya
Contributor III

Thanks @kerryzhou 

It makes sense  about the noisy data.

 

But when i provide input voltage to the pin, the converted out displayed in the terminal is not consistent with the supply. For example when I increase the input voltage, the output increases sometimes and but other times it decreases. Not sure why.

View solution in original post

0 Kudos
7 Replies
973 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @ranjay_shandilya ,

    To the analog input pin, you don't need to configure the pinmux, as the pin is fixed to the analog module, you just need to configure the anlog module directy.

  Take an example:

kerryzhou_0-1655783020047.png

ADC, you don't need to configure the pinmux, then just configure the ADC module.

The reference code is:

SDK_2_11_1_EVKB-IMXRT1050\boards\evkbimxrt1050\driver_examples\adc

ACMP is the same, just refer to the related SDK is OK.

 

Wish it helps you!

Best Regards,

Kerry

 

0 Kudos
968 Views
ranjay_shandilya
Contributor III

Hi @kerryzhou 

Thanks for the response.

I am using adc polling example and need a bit of clarification.

When I flash the polling example to the board. 

ranjay_shandilya_0-1655888936267.png

I get output as in above screenshot.

The problem is this conversion is happening even without me adding any sample input.  As I understand, I should be providing a sample input to the pin and output will be the converted value. Is there something I am missing?

Could u please help me understand this.

Thanks

0 Kudos
962 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @ranjay_shandilya ,

  Please check the project readme.txt:

Board settings
==============
ADC1_IN0 is ADC input. Please sample voltage by J23-2 pin

  So, if you don't input the voltage to the J23-2 pin, it is the noisy data that you get.

  So, to get the correct data, you need input the voltage to J23-2 pin.

 

Wish it helps you!

Best Regards,

Kerry

 

0 Kudos
960 Views
ranjay_shandilya
Contributor III

Thanks @kerryzhou 

It makes sense  about the noisy data.

 

But when i provide input voltage to the pin, the converted out displayed in the terminal is not consistent with the supply. For example when I increase the input voltage, the output increases sometimes and but other times it decreases. Not sure why.

0 Kudos
957 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @ranjay_shandilya ,

  Please tell me your input voltage and the related printf result.

  Please note, your input voltage should be the same GND as the board's GND.

  Then I will help you to check it in detail.

Best Regards

Kerry

0 Kudos
953 Views
ranjay_shandilya
Contributor III

Hi @kerryzhou 

My Observation is as below:

Input voltage            ADC Value (Output)

No I/p volt               144


3.30V                      223
3.30V                      138
3.30V                      155
3.30V                      152
3.30V                      146


5.35V                      159
5.35V                      174
5.35V                       37
5.35V                      157


1.9V                        131
1.9V                        146
1.9V                        149

Note: For the same input voltage everytime I press any key to get user channel's data
I get different ADC value ( why? )

ranjay_shandilya_0-1655904384541.png

 

0 Kudos
948 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @ranjay_shandilya ,

  Your input voltage is wrong, the input voltage can be higher than VREFH, please refer to the datasheet:

kerryzhou_0-1655945736035.png

I find you mark the correct answer, do you still have issues about it?

If yes, how do you input the different voltage, it is cut down from the VREFH or VDDA from the same board and share with the same GND?

This is my test result when I input the 3.3V:

kerryzhou_1-1655946979445.png

3.3V is from here

kerryzhou_2-1655947004141.png

You can try it like me.

When you want to use lower voltage, you can divide the voltage from J24_8.

Best Regards,

Kerry

 

 

 

 

0 Kudos