Wait routine

06 Dec 2010

Hi folks

Where does the Wait_api call to?
I've been looking through the files, and can't seem to find the function anywhere.
I just wanted to have a look at how it's been set up, what registers it pokes.

Lerche

06 Dec 2010

Hi Christian,

The wait functions (wait, wait_ms, wait_us) all just read TIMER3, which is constantly running at a 1us tick. So they read the time on entry, and wait for the time to elapse. That's about it!

Simon

06 Dec 2010

Simple, great!

Thx, Simon

Lerche

06 Dec 2010

Is posible to change the range to 0.1us or less?

06 Dec 2010

Hmm, if the CLK is running fast enough for the Timer, then it should (theoretically), be possible.
I don't know where the CLK comes from, but at 1uS per CLK, it should be 1 MHz.

Lerche

06 Dec 2010

Hi Evaristo,

The TIMER3 is setup as a fixed 1us tick so it can be relied upon, so you can't change the range. However, if you are willing to poke one of the other LPC1768 timers yourself (TIMER0-2), they are fairly flexible and have a prescaler, so you should be able to setup the sort of speeds you need.

Simon