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?
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
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?
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.
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.
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.
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.
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.
Hi. So here is a snippit of the schematic.
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.
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?
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?
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
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
Sorry, got it mixed up. It's channel 1 that reads 1022