A question about GPIO speed on LS1043

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

A question about GPIO speed on LS1043

1,674 Views
190145240
Contributor II

A question about GPIO speed

We have a board which base on LS1043 and we want the gpio works as a clock output,we test the wave by the scope and find that the clock freq is 1.85MHz at most.

We look up all the pdf and can not find the gpio work speed, So we need your help about what's the speed of ls1043 gpio.

thank you!

6 Replies

1,506 Views
190145240
Contributor II

OK,Thanks for your help!

0 Kudos
Reply

1,506 Views
190145240
Contributor II

We tried to the following test:

1. In a thread we write to a global variable on and on, and we count the counts, the result is :200,000,000

2.mmap gpio controller data register to user space, and write to the address the same as 1, the result is : 20,000,000

there are 10 times difference, so, although the gpios do not limit the update speed, but the test result shows it has a max limit.that is say, CPU is 100% busy, but gpio's update speed mismatch the cpu. 

0 Kudos
Reply

1,506 Views
alexander_yakov
NXP Employee
NXP Employee

I do not see anything incorrect in the fact that global value, placed in memory, has 10 times faster update speed, than memory mapped peripheral. Even if these two instances both have addresses in memory space, this does not mean they should have identical access time. GPIO block is relatively slow peripheral, it is not guarantied to be the same speed, as CPU.

0 Kudos
Reply

1,506 Views
190145240
Contributor II

Hi alexander:

   thanks for your reply!

   as your suggest,I tryed to do the following test:

   1.in user space, mmap gpio controller address to userspace and gcc -O2,

    I start a thread in which I write 0 and 1 to gpio2_25 alternately and without delay

    from the scope,I got the square ware freq is 2MHz

    2.in kernel space, call gpio_request gpio_set_val

    in a test.ko, call gpio_set_val 0 and 1 to gpio2_25 alternately and without delay

    the result is the same as 1, 2MHz

    according to the test result,it seems to the gpio's Max update speed is 2MHz, Is this right?

    and I can not find the description about the gpio update speed such as STM32F2XX, is there

0 Kudos
Reply

1,506 Views
alexander_yakov
NXP Employee
NXP Employee

We do not specify maximum GPIO update speed in our documentation, because of the reason described above.

0 Kudos
Reply

1,506 Views
alexander_yakov
NXP Employee
NXP Employee

GPIO is very simple interface, it can output only logic "1" or "0" levels, and can not be configured to output square wave frequency. So, if you wish to generate square wave output using GPIO pin, you have to output logic "1" and "0" sequentially. This can be done by sequential writing to GPDAT register. So, the output frequency of resulting square wave will depend on how fast you can update GPDAT register in loop. The fastest way to update GPDAT register is update it in software loop, without using any interrupts. In this case you will achieve maximum update frequency, but the processor core will be 100% busy by this task, and you will be unable to use it for other tasks. As long as this "bit-banging" on GPIO pins is not an expected usage of the processor, we do not specify maximum frequency, which may be achieved in this case.

To generate output frequency, I recommend using a hardware "timer" block which generates output frequency in hardware, without any core intervention. You just need to only set timer frequency, timer mode and enable it. For LS1043 this timer module is named "Flex Timer Module" and described in Chapter 23 of LS1043 Reference Manual.

LS1043A Reference Manual is available from LS1043A product page, "Documentation" tab:

https://www.nxp.com/products/processors-and-microcontrollers/arm-based-processors-and-mcus/qoriq-lay...