11 years, 6 months ago.

How to access system clock ticks

Hello,

I am working on a timing system and am new to mbed and to a lesser extent ARM processors. I have spent a fair amount of time in the 8-bit MCU world. Is there a way to get access to the system clock ticks? At 96 MHz I should be able to get sub microsecond timing resolution with access to the system clock value.

I did search the site and could not find an answer to this question, probbaly poor search skills.

TIA wade

1 Answer

11 years, 6 months ago.

You could set up a timer to run at full speed. One timer is used by mbed libraries, leaving the others free for your use.

Accepted Answer

Do you know of an example that does this on the mbed site or do you know where to point me for further information. I have most of today trying to gain access to the timers so I can do this.

TIA wade

posted by wade brown 01 Jul 2013

Here for example is a code snippet of someone who manually set an interrupt: http://mbed.org/users/microguy/notebook/timer0-example-code/

Not exactly what you want, but a good starting point. You also want to start the timer, make sure it runs at full speed, and then read the current value.

posted by Erik - 02 Jul 2013