Dear Friends, How to create a delay loop in C51.Say for example I need a delay loop for 35mS.How to do this.I tried a code taken from this forum.It is void delay(void) { unsigned long msdl; msdl = 35L * 1000L; while(--msdl) { _nop_(); } } Logically I think it should produce a 35mS delay code.But When I see in the Performance Analyzer window the delay produced is 0.547275 seconds. Can anybody help me in solving this problem. Thanx in Advance
Dear Friends, Thank you all for the useful reply.I am a beginner to this KEIL.I dont know how to get a delay loop for the 35ms.I dont need a accurate value.I just want to use this delay for button debouncing.Please guide me to generate a delay loop in c51.Sorry for stealing your valuable time.
"I just want to use this delay for button debouncing" I think a timer-based approach would be far better for this application. Do a bit of work with your favourite internet search engine, and I'm sure you'll find plenty...
View all questions in Keil forum