GPIO Input And Output Problem

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

GPIO Input And Output Problem

5,881 Views
omerkaanbasakin
Contributor IV

Hi ı am using MIMXRT1052 on custom board. I am  using  MCUXpresso as an ide with  SDK_2.7.0_MIMXRT1052xxxxB. I tried to use GPIO2  pin 22 for interrupt. But ı cant get any interrupt. I examin examples of GPIO input and GPIO output.  

When I modified the output sample for GPIO2 22nd pin, I measured the output with an oscilloscope. No matter how I make changes using the pin config tool, I get a maximum output of 1.16v. In the Input example, I can see the interrupt signal with the help of an oscilloscope (3V), but if I complete the connection between the signal and the processor, I see a signal at the mV level. Am ı skipping an adjustment ? Is that normal? 

P.S. : I only change GPIO and pin definitions in two examples.

Labels (1)
0 Kudos
Reply
18 Replies

5,570 Views
omerkaanbasakin
Contributor IV

Hi Victor,

-Just to be sure that I understood the behavior you are facing correctly. You configured pins GPIO_B1_06 and GPIO_B1_14 as output and when you send these pins to a high level you get only 1.6 volts, am I correct? 

Yes ı configured  GPIO_B1_06 and GPIO_B1_14 pins as output when we tried to toggle or send high level, measured  1.1V - 1.4V.  

-Do you see this behavior in our EVK or on a custom board? 

Pin configurations not suitable  for output on evk (ethernet pins) but we get 3V from TP 26.

Kind Regards. 

0 Kudos
Reply

5,570 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hi Omer,

 

Based on your response I understood that you are seeing this behavior on a custom board, is this correct? If so, what is the value of the power-rail that supplies power to these two pins? 

 

Regards,

Victor

0 Kudos
Reply

5,570 Views
omerkaanbasakin
Contributor IV

Hi Victor,

NVCC_GPIO(3V) supplies these two pins and other GPIO2 pins. Only GPIO_B1_06 and GPIO_B1_14  not give 3V output.

0 Kudos
Reply

5,570 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hi Omer, 

Could you please specify all the configuration that you have in these pins? 

Regards, 

Victor 

0 Kudos
Reply

5,570 Views
omerkaanbasakin
Contributor IV

Hi Victor,

I only use GPIO_B1_06 and GPIO_B1_14 pins for interrupt. Other pins were placed  on the board but the parts were not soldered. The pins and ı choose randomly and all other GPIO pins was working. 

Kind Regards

0 Kudos
Reply

5,570 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hi Omer, 

Yes, I understand this part. But could you please clarify how are you configuring these two pads? For example, what do you have in registers IOMUXC_SW_MUX_CTL_PAD_GPIO_B1_06 and IOMUXC_SW_PAD_CTL_PAD_GPIO_B1_06? 

Regards, 

Victor 

0 Kudos
Reply

5,570 Views
omerkaanbasakin
Contributor IV

Hi Victor,

I just set direction and if direction is input set interrupt from pin config tool.

Best Regards

0 Kudos
Reply

5,570 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hi Omer,

Could you please share with me the project that you are using to test this? I'm confused because I thought that the problem was that you cannot see that these two pins output 3 volts, but now you mentioned that you set these two pins as inputs, could you clarify this? 

Regards,
Victor

0 Kudos
Reply

5,570 Views
omerkaanbasakin
Contributor IV

Hi Victor,

Sorry for the confusion.Let me start over. I am using MIMXRT-1052 on custom board. I am using Mcuxpresso. I tried to get interrupts from two GPIO2 pins which we discussed. But ı cannot get interrupt from pins. I check my code over and over again but ı cant get interrupt. So ı thought my processor pins were damaged. So ı gave up trying to get interrupt. Changed pins direction to output. When ı toggle to pins cant see 3V from both. So i figured out that is the problem. Our pins were damaged. We tried to toggle by selecting random pins among GPIO1, GPIO2, GPIO3. GPIO1, GPIO2 and GPIO3 pins supplied by NVCC_GPIO(3v). The remaning pins except our damaged pins were able to generate 3V. So we choose the interrupt pins from among the working pins and there is no problem now. But the two damaged pins still not working. 

"Could you please share with me the project that you are using to test this? " - Sorry already deleted test project. But Still using same code.

/* GPIO configuration of RST on GPIO_AD_B1_00 (pin J11) */
gpio_pin_config_t RST _config = {
.direction = kGPIO_DigitalOutput,
.outputLogic = 0U,
.interruptMode = kGPIO_NoIntmode
};
/* Initialize GPIO functionality on GPIO_AD_B1_00 (pin J11) */
GPIO_PinInit(GPIO1, 16U, &RST _config);

/* GPIO configuration of IRQ_1 on GPIO_AD_B1_01 (pin K11) */
gpio_pin_config_t IRQ_1 _config = {
.direction = kGPIO_DigitalInput,
.outputLogic = 0U,
.interruptMode = kGPIO_IntRisingEdge
};
/* Initialize GPIO functionality on GPIO_AD_B1_01 (pin K11) */
GPIO_PinInit(GPIO1, 17U, &IRQ_1 _config);
/* Enable GPIO pin interrupt on GPIO_AD_B1_01 (pin K11) */
GPIO_PortEnableInterrupts(GPIO1, 1U << 17U);

Kind Regards,

Omer

0 Kudos
Reply

5,569 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hi Omer,

Thanks for the clarification! When you declared these pins as input, how much voltage did you supply them?

Regards,
Victor

0 Kudos
Reply

5,569 Views
omerkaanbasakin
Contributor IV

Hi Victor,

When we set input the pin direction, 3V time pulse signal interact with pins.

0 Kudos
Reply

5,569 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hi Omer, 

I made a couple of tests on my side with the RT1050-EVKB and I wasn't able to reproduce the behavior that you mentioned. I configure pin GPIO_B1_14 as GPIO2_IO30 and I toggle the pin in a while loop, I was able to see that level of the pin goes up to 3.3 volts. 

pastedImage_2.png

With the help of the MCUXpresso Config Tools, I added the following code inside the function BOARD_InitPins.  

IOMUXC_SetPinMux( IOMUXC_GPIO_B1_14_GPIO2_IO30,  0U);

After that, in the main, I initialize the GPIO pin. 

GPIO_PinInit(GPIO2, 30, &led_config);

Where led_config has the following parameters. 

gpio_pin_config_t led_config = {kGPIO_DigitalOutput, 0, kGPIO_NoIntmode};

Regards, 

Victor 

0 Kudos
Reply

5,569 Views
omerkaanbasakin
Contributor IV

Hi Victor,

Thanks for your reply. We can get 3V any pins from processor except GPIO_B1_06 and GPIO_B1_14. We didnt know that pins can deform seperately. Thanks for your time.

Kind Regards,

Omer

0 Kudos
Reply

5,569 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hi Omer, 

Just to be sure that I understood the behavior you are facing correctly. You configured pins GPIO_B1_06 and GPIO_B1_14 as output and when you send these pins to a high level you get only 1.6 volts, am I correct? 

Do you see this behavior in our EVK or on a custom board? 

Regards, 

Victor 

0 Kudos
Reply

5,568 Views
mjbcswitzerland
Specialist V

Hi

GPIO2 pin 22: Do you mean GPIO_B1_06 on the physical connection C12?
Do you have an i.MX RT 1050EVB to compare on?

Regards

Mark

[uTasker project developer for Kinetis and i.MX RT]

0 Kudos
Reply

5,569 Views
omerkaanbasakin
Contributor IV

Hi Mark

Thanks for your reply,

Yes ı mean GPIO_B1_06 and ı have i.MX RT1050 EVK . Output example pin refers to a led and ı check the voltage. Voltage almost equals to 3V. 

Regards.

0 Kudos
Reply

5,570 Views
mjbcswitzerland
Specialist V

Hi Omer

Please load the attached binary to your EVB to check the GPIO interrupt on GPIO2-IO22 (this is pin 18 on the PHY - U16). When there is a rising edge (touch the input with 3V) there will be an interrupt generated and a message sent each time on the debugger's VCOM output (115kBaud) - if you connect the USB device (USB connector next to the Ethernet connector) you can also get debug output on that (USB-CDC).

You can check the voltages involved and compare with your custom board to see whether a missing GPIO interrupt on this input could be due to a HW problem.

If you tell me which QSPI your custom board uses I may be able to send you a binary for it to that does the same so that you can verify that the firmware operates and that it is not a HW issue. If it uses the hyper flash as on the EVB the binary probably runs already.

Regards

Mark
[uTasker project developer for Kinetis and i.MX RT]

If you have difficulties loading the binary see this document for a guide: https://www.utasker.com/docs/iMX/uTaskerLoader_TestDrive.pdf
Since the binary contains a complete secure serial/OTA loader and application solution you can also play around with its many other features too.

The same application runs on any i.MX RT 1010..1064 without any porting effort.

0 Kudos
Reply

5,569 Views
omerkaanbasakin
Contributor IV

Hi Mark 

Thanks for your reply,

Sorry for late response. We figure out the problem, only GPIO_B1_06 and GPIO_B1_14 pins not working. We get 3V from GPIO1,GPIO2,GPIO3.

When we changed the pins to GPIO_B0_00 and GPIO_B0_13, we see3v output and get interrupt.

I did not know that the GPIO pins can specifically deformed. Are there separate protections on the pins?

Thansk for your time

Kind Regards

0 Kudos
Reply