I'm trying to understand why the GPIO performance on all IMX-RT processors are so low with the standard gpio.
Even a simple toggle GPIO code on a RT1176 like the one below reaches 6.6Mhz.
Writing on the GPIO interface creates 80 blocking wait states, even slower compared with rt1021.
what am I doing wrong?
I know there are fast GPIO types, but why the standard ones are so slow?
with the rt1021 i have about a 18Mhz signal about three times faster
while (1)
{
if (g_pinSet)
{
EXAMPLE_LED_GPIO->DR_SET= (1UL << EXAMPLE_LED_GPIO_PIN);
g_pinSet = false;
}
else
{
EXAMPLE_LED_GPIO->DR_CLEAR= (1UL << EXAMPLE_LED_GPIO_PIN);
g_pinSet = true;
}
}
}
Solved! Go to Solution.
Hello @mauro_chimenti,
As you point out the normal GPIO speed is low, the speed of GPIOs will depend on which GPIO are you using. This is nothing to do with you doing something wrong.
As you mention you could increase the speed of the GPIO port, by selecting the CM7 fast GPIO. IMXRT1170 Reference Manual says: "This GPIO instance contains a mux that selects between normal GPIO or CM7 fast GPIO. See IOMUXC_GPR_GPR42-43 for more details."
[Table 11-1. Muxing Options. Chapter 11 External Signals and Pin Multiplexing]
Depends of the GPIO you are going to use the GPR to modify, in this case we are talking about the iled_blinky_cm7 example, which uses the GPIO_AD_04. In this case the GPR to modify is the GPR42:
[Chapter 12 IOMUX Controller (IOMUXC). Section 12.4.4.43 GPR42 General Purpose Register (GPR42)]
If you want faster speeds on your GPIOs, it might be good use this functionality. Please look at the following community post relating this situation: RT1060 Normal GPIO vs Fast GPIO - NXP Community.
Best regards, Raul.
Hello @mauro_chimenti,
As you point out the normal GPIO speed is low, the speed of GPIOs will depend on which GPIO are you using. This is nothing to do with you doing something wrong.
As you mention you could increase the speed of the GPIO port, by selecting the CM7 fast GPIO. IMXRT1170 Reference Manual says: "This GPIO instance contains a mux that selects between normal GPIO or CM7 fast GPIO. See IOMUXC_GPR_GPR42-43 for more details."
[Table 11-1. Muxing Options. Chapter 11 External Signals and Pin Multiplexing]
Depends of the GPIO you are going to use the GPR to modify, in this case we are talking about the iled_blinky_cm7 example, which uses the GPIO_AD_04. In this case the GPR to modify is the GPR42:
[Chapter 12 IOMUX Controller (IOMUXC). Section 12.4.4.43 GPR42 General Purpose Register (GPR42)]
If you want faster speeds on your GPIOs, it might be good use this functionality. Please look at the following community post relating this situation: RT1060 Normal GPIO vs Fast GPIO - NXP Community.
Best regards, Raul.