Hello, I'm rather new to Keil C and just getting geared up to use it on my next project. ATM, I'm overwhelmed with the number of options and extensions that are available. I intend to write a C "library" that consists of 3 functions:
Delay() DelayMS() DelayUS()
Delay(2); // creates a 2 second delay DelayMS(500); // creates 500ms delay DelayUS(10); // creates a 10us delay
Hi,
2 questions here:
(1) I tried the nop way as you suggested, how come the delay I get does not change much if I give 'us' 2 very different values?
(2) I use the following code:
void delay_us() { SysTick->VAL = 9000; while(SysTick->VAL != 0) {} }
and delay also does not change much for VAL 2000 and 9000.
Does it have sth to do with code optimization? I am using IDE's default setting.