ADC channel reads max value despite pull-down resistor

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

ADC channel reads max value despite pull-down resistor

1,130 次查看
EsbenDN-TC
Contributor I

Hi.

I am working with MIMXRT1061DVL6B and I see something confusing with ADC1

When I setup and measure on channels 1 and 2 I get different values even though the channels have the same configuration and both pins are not connected to anything.

The configuration is like this:

Channel 1 - IOMUXC_GPIO_AD_B0_12_GPIO1_IO12
Channel 2 - IOMUXC_GPIO_AD_B0_13_GPIO1_IO13

Hyst::eDis,
Pull::eDown100k,
PullKeeper::ePull,
PullKeeperEn::eEn,
OpenDrain::eDis,
Speed::eLow50M,
Drive::eR0,
Slew::eSlow

Since the internal pull-down resistor is enabled, I expect both channels to read close to 0.

Channel 2 reads value 0 as expected, but channel 1 reads 1022 (10-bit resolution).

What is up with channel 2? Are there any additional pin configuration I need to do?

 

0 项奖励
回复
11 回复数

1,092 次查看
Pablo_Ramos
NXP Employee
NXP Employee

Hi @EsbenDN-TC,

In order to narrow down what could be the issue, can you test the ADCs without the pull-down resistors and with different voltage?

Please let me know your results

0 项奖励
回复

1,064 次查看
EsbenDN-TC
Contributor I
I'm afraid I can't try different voltages as I don't have access to pin K14 (channel 1) on the current PCB revision. Channel 2 works fine with other voltages but I realized that I can't use channel 2 because low levels on that pin will interfere with the ROM Bootloader during power up.
0 项奖励
回复

1,013 次查看
Pablo_Ramos
NXP Employee
NXP Employee

Hi @EsbenDN-TC,
Thanks for the update. However, I still have some question about your application

What is the purpose of your application? Why is the pull-down resistance needed on the ADC pins?

0 项奖励
回复

958 次查看
EsbenDN-TC
Contributor I

The purpose is to detect the PCB revision. So the idea is that with a pull-down resistor on the ADC pin I will measure ~0, and from that I can deduct that this is PCB revision 0. On future revisions I will route a voltage divider to the ADC pin and from the measured value I can deduct the PCB revision.

0 项奖励
回复

907 次查看
Pablo_Ramos
NXP Employee
NXP Employee

Hi @EsbenDN-TC,

Thanks for your patience

We tested this on the EVK and notice that the pads for ADC1 channel 1 and channel 2 (GPIO_AD_B0_12 and GPIO_AD_B0_13 respectively) are normally used for UART1 that in SDK examples is used to send data to the terminal.

Pablo_Ramos_4-1722888776457.png

If we check these two pads, they have a pull-up resistor of 10k, this making the ADC1 channel 1 and channel 2 to read high voltage even though the 100k pull-down resistor is enable.

Pablo_Ramos_1-1722888711823.png

We read the voltage externally and from the ADC and the values is inside the expected taking in to account the voltage divider generated by the 10k and 100k resistors.

Pablo_Ramos_2-1722888727149.png

Pablo_Ramos_3-1722888733126.png
This case applies for the EVK only, I'm assuming that you are using a costume board so could you share a part of your schematic? ADC pin channel 1 should be floating, right? Please check if there is no other signal coming to the pin unintentionally.

0 项奖励
回复

867 次查看
EsbenDN-TC
Contributor I

Hi. So here is a snippit of the schematic.

snipHwRevADC.png

As you can see I have a voltage divider on channel 2 that was supposed to give the voltage level that the ADC would read as HW revision 1. This was working as expected but it turned out however that since GPIO_AD_B0_13  is used as UART1 Rx (as you mention), having a low voltage level on this pin during start up will interfere with the ROM Bootloader Serial Downloader at power on. So I tried to move the HW revision ADC to channel 1 and now I have the issue.

0 项奖励
回复

832 次查看
Pablo_Ramos
NXP Employee
NXP Employee

Hi @EsbenDN-TC,
Could you please help me clarify the following:

The photo is from the schematic of the PCB that is having the issue?

This new revision still has wrong ADC reads?

0 项奖励
回复

736 次查看
EsbenDN-TC
Contributor I

Yes. The snippit shows the PCB revision where I have the problem. So K14 (channel 1) is floating and I expect to measure 0 (because of internal 100k pull-down). But when I measure I get 1023.

I have tried setting up the following ADC1 channels (all are floating pins on the PCB) with identical settings and got following readings.

[K14] Channel 1: Result = 0x3ff
[L14] Channel 2: Result = 0x007
[L10] Channel 4: Result = 0x005
[J11] Channel 5: Result = 0x005
[K11] Channel 6: Result = 0x001
[L11] Channel 7: Result = 0x002
[M12] Channel 8: Result = 0x002


All except Channel 1 reads close to 0 as expected. I tried this on both the current PCB revision and an older version where the same ADC channel pins are also floating.

It really seems something strange is up with channel 1. Could it be that since pin K14 is also used for LPUART1_TX which is used by ROM Bootloader Serial Downloader, that the default pin configuration is different from the other pins?

0 项奖励
回复

683 次查看
EsbenDN-TC
Contributor I
Just to clear up any potential confusion. The voltage divider resistors R17 and R47 in the schematic snippit are not mounted on the PCB I use for the measurements.
0 项奖励
回复

642 次查看
Pablo_Ramos
NXP Employee
NXP Employee

Hi @EsbenDN-TC,

Unfortunately, I cannot replicate the issue as I don't have the exact same hardware as you. However, if you could get one of our EVK to test your software configuration that could be useful.

I made some tests with the MIMXRT1060-EVKB where I set the pull-down with some SDK instructions (IOMUXC_SetPinMux and IOMUXC_SetPinConfig) and then configurate the ADC as the SDK example does. As I explained in a post before there is a pull-up resistor on the EVK so if we take it in consideration, the calculate value, the ADC value and the external read they all match.

When I run my code, I use internal boot in order to boot from external NOR Flash memory and as the following figure state this boot mode don't use the ROM Bootloader pins as LPUART1

 

Pablo_Ramos_1-1723860312516.png

See figure 9-1 of i.MX RT1060 Processor Reference Manual

When you run your application is there any difference in our boot mode and boot device?

I understand that you now have access to ADC1 channel pins, could you please inject different signal to verify the integrity of the channel? (without the pull-down)

As you mention these pins are used as LPUART1 from the ROM Bootloader on SDK examples so it may be convenient to use other pins for your application

0 项奖励
回复

1,128 次查看
EsbenDN-TC
Contributor I

Sorry, got it mixed up. It's channel 1 that reads 1022

0 项奖励
回复