I\'m trying to implement a microsecond delay in a bare metal arm environment( LPC1768 ) / GCC. I\'ve seen the examples that use the SysTimer to generate an interrupt that then d
One way is just to use a loop to create the delay, something like shown below. You need to calibrate your factor. A more general purpose approach is to calculate the factor on startup based on some known timebase.
#define CAL_FACTOR ( 100 )
void delay (uint32_t interval)
{
uint32_t iterations = interval / CAL_FACTOR;
for(int i=0; i