lpcware

a question on the wait_us implementation

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 18, 2016 by lpcware
Content originally posted in LPCWare by changchao on Thu Apr 14 18:34:55 MST 2016
I read a blog article on using the lpc810,and in that,I saw the following code for waiting for a specified micro seconds,but I can not understand why it can acheive that,anyone have a clue on that?
thanks.

<code>
void wait_us(uint32_t count)
{
    volatile static uint8_t ram;
    while (count-- > 0) {
        ram = 0x11;        /* Wait(1000ns@12MHz) */
    }
}
</code>

Here is the article And the source code

Outcomes