Hello,
I ran the comparator example for the MIMXRT1020-EVK from SDK_2_9_1_MIMXRT1021xxxxx/boards/evkmimxrt1020/driver_examples/cmp/polling/cmp_polling.c and it works as expected for the default GPIO_AD_B0_14 pin on the eval board.
I am trying to use pin GPIO_AD_B0_10 instead for my project and I cannot get it to work. The user LED stays off when I connect J19-6 (GPIO_AD_B0_10) to J19-8 (VCC) or J19-7 (GND).
I changed the following in pin_mux.c:
// From
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_14_GPIO1_IO14,0U);
// To
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_10_GPIO1_IO10,0U);
and cmp_polling.c:
// From
#define DEMO_CMP_BASE CMP1
// To
#define DEMO_CMP_BASE CMP3
According the reference manual, GPIO_AD_B0_10 is on cmp 3.
I also tried GPIO_AD_B0_11 with cmp 4 without any luck.
I added some more input parameters in pin_mux.c as well:
gpio_pin_config_t inputGPIO = {
.direction = kGPIO_DigitalInput,
.outputLogic = 0U,
.interruptMode = kGPIO_NoIntmode
};
GPIO_PinInit(GPIO1, 10U, &inputGPIO);
IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B0_10_GPIO1_IO10, 0x01B0A0U);
This wasn't working on our custom board so that is why I'm trying this on the eval board to make sure it wasn't an issue on our side.
Any help would be appreciated
Solved! Go to Solution.
Hi @comp1 ,
I strongly recommend you to change the pin configuration using ConfigTools.
Could you please check that you also changed the user channel to 4 (by default 0)?
I tried it on my side and it worked.
Best regards, Daniel.
Hi,
My name is Daniel and I will help you in this case.
Could you please update to the newest RT1020-EVK SDK?
Best regards, Daniel.
Hello Daniel,
Upgrading to the newest SDK_2_13_0 has the same issue.
Hi @comp1 ,
I strongly recommend you to change the pin configuration using ConfigTools.
Could you please check that you also changed the user channel to 4 (by default 0)?
I tried it on my side and it worked.
Best regards, Daniel.
Hey Daniel,
Changing the user channel to 4 worked!
How did you know which user channel to use for that pin? The only correlation I could find with that pin and "4" is the pin muxing table in the reference manual listing port ACMP3_IN4 next to pad GPIO_AD_B0_10. I thought the "_IN4" was the interrupt number, not a user channel (or positive channel?).
Is DAC channel 7 correct? How do I correlate that with the pins I want to use?
Thanks, I want to make sure I understand it all.
Hi,
I´m glad to hear that!
Please take a look to Figure 60-1. CMP, DAC and ANMUX block diagram and Chapter 10 in RT1020 RM for more information about this.
Best regards, Daniel.