How Do You Find Delay in Microcontroller Programs?

TIME : 2016-01-07
How Do You Find Delay in Microcontroller Programs?

To calculate a delay in a microcontroller program, you count the number of instructions in the delay loop and multiply that by how many times the loop runs. Since each instruction takes a known amount of time based on the controller's clock speed, you can work out the total delay. For example, knowing how many instructions a chip like the ATmega executes per second lets you translate instruction counts into an actual time delay.