How to calculate loop delay in AVR?

The basic principle of time delay is to create a loop so that the microcontroller waits for a certain period of time without processing. The duration of a command is equal to the cycle time of the oscillator used. The duration of a command in an AVR using an f Mhz oscillator; T = 1 / f * 10 ^ 6 seconds.




AVRLoop


  1. First, download the AVRLoop program from the link below. Link : https://www.dropbox.com/s/ew64s32hw3n7369/AVRdelayloop3.rar?dl=0
  2. After downloading the program, extract the files from RAR and open the AVRLoop program without installation.
  3. Choose the registers on the top.
  4. To calculate the delay, elect the time and cycle rate option and write the time and oscillator frequency we want to delay.
  5. Click on the GO button and see delay code.



The important thing when using this program is that you do not use the 8DIV option when programming the fuse bits. This will cause the delay that you calculate to be incorrect.

Comments

Popular posts from this blog

0-99 Counter Circuit with JK Flip-Flop