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.

TMS320F2806: Main loop pin toggling time

Part Number: TMS320F2806


Tool/software:

Attached is the basic benchmark project. I think it’s a standard example project that ships with the C2000 IDE. Anyways, just toggling a pin in the main loop takes about 87nS. I believe that should be less than 20nS. If we move the pin toggling into a function call, it takes a whopping 187nS to execute. These two benchmarks make us believe basic IO manipulation is pretty inefficient.  Perhaps I'm missing something, please let me know and thank you.gpio_toggle.zip

  • Hi Paul,

    I don't currently have the necessary hardware to test this yet but can you test this on RAM? Though there is some physical delay for the signal path from CPU hardware to the GPIO MUX, this is slightly longer in Flash-based program. Testing with RAM will be needed to see the behavior of the GPIO rise/fall time described in the device data sheet

    Regards,

    Peter

  • Thank you for the reply, Given the MCU clock is 90mHz, we are expecting a GPIO to toggle in under 20nS yet it takes at least 4.5 times longer. We have tried running in RAM but saw no difference,

  • Hi Paul,

    There are a few factors which affect the latency from software to GPIO toggling. Clock frequency as you mentioned but also hardware path delays and memory type/allocation. About 4-5 clock cycles can be expected based on other E2Es and testing. 

    To get the most precise timing, expected use case is to utilize the ePWM module. What application are you targeting with this demo?

    Regards,

    Peter