This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

GPIO output not equally spaced

Equipment: StarterWare_02_00_01_01, XDS100v2, Windows7, CCS6, BBB A6

Hi,
testing the GPIO performance with a BBB I wrote a function that contains 10 times the following code. The function runs in an infinite loop:

  asm(" LDMIA r0!,{r3}"); // get the data addressed by r0 and load it to r3, increment r0
  asm(" STR R3,[R1]"); // write to GPIO1_06
  asm(" LDMIA r0!,{r3}");
  asm(" STR R3,[R1]");

The value loaded to r3 in turn is either 0x40 or 0, i.e. GPIO_06 is alternately set HIGH and LOW.

What I saw on the scope was somewhat disappointing:
1. In most cases HIGH and LOW time had an equal value of 440ns, i.e. only about 1.136MHz for one on/off cycle.
I did not do any cache activation or fpu enabling. Should I?
I read that 10 to 15MHz shall be possible. How could that be achieved?
2. But the time for the LOW and HIGH signal was not always 440ns. Sometimes it was bigger: 688 or 888ns for instance (within a group of 10 on/offs).
That means something is disturbing the process.
I am aware that all other GPIO1 bits are cleared. But should that have any influence on the continuity of the outputs?


Can I do something to get higher output rates and a continuous signal?
(No, not by PRU. I need at least 16 output pins.)

Thank you!

Martin H.

  • Hi Martin,

    greetings from Martin.

    1. How to get higher Pin output rates?

    I think you should accelerate your code. The effect by enabling the MMU und all chaches is significant. I have measured an code execution acceleration by a factor > 1000 (!!!) when enabling all correctly. Within Starterware, if i remember correctly, there is an example for Enabling the MMU und all caches. Else, even a loop-jump can cause a significant calculation delay. The FPU should have no impact on your code, but if you want to use it, some of the libraries have to be recompiled.

    By the way, I use CCS 5.2.1 with starterware 02_00_07_something and BB White A6A @720 MHz. Programmed with C and C++. My actual system contains around 15k-20k SLOC.

    2. The output Signal will allways jitter. Within a 10ns raster.

    Why? Between the Cortex Core and the Output Pins there are some (4?) BUS-Systems. The Output-Pins have an output Clock of 100MHz.

    When the Cortex Core sends the signal to the output pin you can not guarantee the exact cycle of the output clock it reaches the IO-cell (ok, this is very simplified).

    3. 16 output Pins output synchron? Perhaps you could use the GPMC Interface Pins (just a suggestion)

    I hope, this helps.

    Greetings

    Martin B.

  • Hi Martin,

    thanks for your immediate and comprehensive reply.
    That is interesting news and it tells me that GPIO output like this is something I cannot use in my case.
    However, the acceleration by this factor is amazing. I will definitely activate it.
    Thank you for clarifying this.

    Regards,
    Martin