hello all
i am very new in lpc17xx i want to introduce delay in program of 10ms. can any one give me some examples for lpc1768 .and i also want to know how to calculate MR0 value, is any formula for that??
Thanks in advance.
void LARGE_DELAY ( int chicken ) { do { SMALL_DELAY ( 147 ); if ( chicken != 0 ) chicken = chicken - 1 ; } while ( chicken != 0 ); } void SMALL_DELAY ( int cockroach ) { do { int leaf ; for ( leaf = 0 ; leaf < ( 196 * 2 ) ; leaf = leaf + 1 ) { leaf = leaf + 1; } SMALL_DELAY ( 147 ); if ( cockroach != 0 ) cockroach = cockroach - 1 ; } while ( cockroach != 0 ); }
SMALL_DELAY ( 147 );
Ah, yes. The very "small" delay. Until next power failure or stack overflow or watchdog reset.