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.

TMS320F280025C: Read & Write GPIO pin

Part Number: TMS320F280025C
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Hello.

Currently, the functions GPIO_readPin() and GPIO_writePin() are used with the SYSCLK of the TMS320F280025C as 100 MHz. However, when I check with an oscilloscope, it appears that these functions are taking about 1μs to execute.
Is this something that should take this long?
Also, if these functions are taking this long, is there any way to read the GPIO status or write the output land more quickly?

Thank you in advance.

  • Hi Hiroki,

    How did you time the execution of the following functions ?

    it appears that these functions are taking about 1μs to execute.

    Can you use CPU timers to time the execution instead ?

    Thanks.

  • Hi Prarthan,

    I apologize.
    When I said about 1μs, I did not mean that I measured it precisely, but I guessed that the time spent processing GPIOs was slower than expected when I used GPIOs to measure the processing time of a certain operation.
    (Maybe it was just that process that was slower.)

    How exactly do you mean to measure it with the CPU timer?

    Thank you in advance.

  • How exactly do you mean to measure it with the CPU timer?

    Refer to the Timer examples in C2000Ware to see how timer works.

    Regardless your assumption of GPIO toggling time seems to large. Taking the driverlib functions as example you can write your own function call or bitfield register read or write to do the same.

    Thanks

  • Hi Prarthan,

    Comparing the case where GPIO_togglePin() is used in the while statement and the case where the processing inside the function is written directly in the main statement, a large difference in the pin toggle cycle was observed.
    (When GPIO_togglePin() is used: 800ns, when the process is written directly in the main statement: 100ns)
    In response to the above results, since the pins used by GPIO_writePin() and GPIO_readPin() are fixed, we defined them as variables and wrote the processing in the function directly to the main program, which improved the processing speed problem.

    Thank you in advance.