Could Someone Give me Advise with i.MX RT1060 GPIO Configuration?

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

Could Someone Give me Advise with i.MX RT1060 GPIO Configuration?

200 Views
Walson
Contributor I

Hello there,

I am working on a project involving the i.MX RT1060; and I am encountering some challenges with the GPIO configuration. I am new to working with NXP processors; so I hope someone here can guide me through this.

I am using the MIMXRT1060 EVK board.
My goal is to configure GPIO pins for simple input and output operations.

I have been using MCUXpresso IDE for development and the SDK examples as a reference.
I started by following the GPIO driver example from the SDK; but I am having trouble getting the expected results.

I am trying to configure one pin as an output to control an LED and another pin as an input to read the state of a button.

The LED pin seems to be working intermittently; and the button pin does not seem to register any input. I have checked the connections and they seem fine. I also tried tweaking the configurations and double-checked the board’s schematics to ensure I am using the correct pins.

Are there any additional configurations or initializations required for the GPIO pins that I might be missing?
Could there be any potential conflicts or settings in the board initialization code that I need to address?

Also, I have gone through this post: https://community.nxp.com/t5/i-MX-Processors/i-MX-RT1060-Ref-Manual-GPIO-config-clarification-please...power-bi/  which definitely helped me out a lot.

Are there any common pitfalls or mistakes that beginners often encounter when working with GPIO on the i.MX RT1060 that I should be aware of?

Thank you in advance for your help and assistance.

0 Kudos
Reply
1 Reply

177 Views
Habib_MS
NXP Employee
NXP Employee

Hello @Walson,

First of all, I want to clarify that there are several ways to configure GPIOs, where in chapter 13 called "General Purpose Input/Output (GPIO)" of the reference manual, all the possible configurations are listed.

Having clarified this, the first thing to do in order to use a peripheral is to activate its clock so that it can be configured. After this, the peripheral is configured as denoted by the application, either input, output or some other configuration mode. Finally, you may or may not enable interrupt for this peripheral, for example, activating the interrupt to use with a push button.

If you need an example of how to implement a pin as input to use with a push button, you can check out the example of the SDK (version 2.16) called "igpio_input_interrupt", paying extra attention to these functions:
-GPIO_PinInit(EXAMPLE_SW_GPIO, EXAMPLE_SW_GPIO_PIN, &sw_config);
-GPIO_PortEnableInterrupts(EXAMPLE_SW_GPIO, 1U << EXAMPLE_SW_GPIO_PIN);

 

On the other hand, if you need an example of how to implement a pin as output, you can check out the example of the SDK (version 2.16) called "igpio_led_output", paying extra attention to the configuration function (GPIO_pin init). You can compare these examples to know what are the differences about these  GPIO configurations. Remember to consult the readme.txt file to understand how it works.

Also, if you experience any issue, do not hesitate to let me know.
BR,
Habib.