Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

CCS/TM4C123GH6PM: Measuring time, in milliseconds or microseconds on the TM4C

$
0
0

Part Number:TM4C123GH6PM

Tool/software: Code Composer Studio

Hello,

I am writing a ros_embedded program using github.com/.../rosserial_tivac

I need to measure time, in order to make a loop execute a routine each 100ms.

Usually this is done with something like:

while(1) {

    current_time = micros();

    if(current_time - last_time >= 100000) {

// execute routine

    }

}

In tiva-c there is the SysCtlClockGet() - which returns 80000000 - when the TM4C123 is running at 80Mhz.

Is there any way we can get the sysclock ticks? Basically, I would like to do a blink without delay in the TM4C.

Are there anyways to accomplish this other than the use of measuring the time / clock timers? (maybe the systick interrupt)

Either way, how do I measure time in the TM4C? Sometimes I just need to temporarily measure how long a routine takes for debugging purposes.

Best regards,

Can


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>