> Does anyone have a simple, yet accurate software usec delay routine? > I'm running 4mhz PIC16F877 and want to be able to generate a call to > SoftUsecDelay(NumberOfMicrosecondsToDelay). For short delays you can just jump into a list of NOP instructions. If you wanted to make a fancy routine, it would first subtract off all its own overhead, then use a loop for multiples of the loop time, then jump into a list of NOPs for the exact remainder. Of course interrupts would need to be off for any of this to be valid. What time ranges do you want to delay for? ***************************************************************** Olin Lathrop, embedded systems consultant in Devens Massachusetts (978) 772-3129, olin@cognivis.com, http://www.cognivis.com -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! use mailto:listserv@mitvma.mit.edu?body=SET%20PICList%20DIGEST