GPIO Low Performance

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

GPIO Low Performance

跳至解决方案
1,616 次查看
mauro_chimenti
Contributor I

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;
  }
}
}

0 项奖励
回复
1 解答
1,586 次查看
RaRo
NXP TechSupport
NXP TechSupport

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."

RaulRomero_0-1680212017524.png

[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:

RaulRomero_1-1680212017549.png

[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.

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,587 次查看
RaRo
NXP TechSupport
NXP TechSupport

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."

RaulRomero_0-1680212017524.png

[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:

RaulRomero_1-1680212017549.png

[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.

0 项奖励
回复