RT1060 Normal GPIO vs Fast GPIO

Document created by Victor Jimenez Employee on Mar 21, 2019Last modified by Victor Jimenez Employee on Mar 21, 2019
Version 2Show Document
  • View in full screen mode

The i.MXRT1060 provides the tightly coupled GPIO, enable to be accessed with high frequency.

RT1060 provides two set of GPIOs registers to control pads output. GPIO1 to GPIO3 is general GPIO, and GPIO6 to GPIO8 is tightly GPIO, but they share the same pad, that means the gpio pin can select from GPIO1/2/3 to GPIO6/7/8.

The registers IOMUXC_GPR_GPR26, IOMUXC_GPR_GPR27, and IOMUXC_GPR_GPR28 are for GPIO selection.

To select the gpio pin between GPIO1/2/3 or GPIO6/7/8 you can use MCUXpresso Config Tools. For example, if you select pin G10 you can select either GPIOI_IO11 for normal GPIO or GPIO6_IO11 for fast GPIO. 

I made an example based on the SDK v2.5 to compare the speed of Normal GPIO and Fast GPIO. For this, I used pin G10 (GPIOI_IO11 and GPIO6_IO11).

Note: As you can see in the below image, GPIO1,2,3,4 and 5 are sourced from ipg_clk_root and GPIO6,7,8, and 9 are sourced from ahb_clk_root. What means that for GPIO6,7,8 and 9 you don't need to activate any clock. The current version of the SDK (v2.5) didn't take into consideration this, so if you want to use any of these GPIOs you need to add the following if statement into the function GPIO_PinInit. This bug was already reported and it will be fixed in new releases of the SDK.

 

Firstly, I used the normal GPIO pin (GPIOI_IO11). I will toggle the pin by writing directly to the GPIO_DR register. Notice that you can access this pin through J22 pin 3 in the evaluation board, so you can measure the performance of the pin. Here are the results:

With the normal GPIO pin, we reach a period of 160ns when writing directly to the GPIO_DR register. Now, if we change to the fast GPIO and use the same instructions we have the following results.

As you can see when using the fast GPIO pin, the period of the signal it's almost one-third of the period when using a normal GPIO.

Now, The A1 silicon of the RT1060 has a new GPIO toggle feature. If we toggle the pin with the new register DR_TOGGLE instead of the GPIO_DR we will get better performance with both pins, normal GPIO and fast. Here are the results of normal GPIO with the DR_TOGGLE register.

As you can see when using the register DR_TOGGLE along with the normal GPIO pin we get a period of around 53 ns while when writing to the GPIO_DR register we got 160 ns. When using the register DR_TOGGLE and the fast GPIO we will get the best performance of the pin. Results are shown below.

 

Many thanks to Jorge Antonio Alcala Vazquez for his valuable help with this document.

 

Hope this helps!

Best regards,

Victor.

Attachments

    Outcomes