Path: Home => AVR overview => Software knowhow => Timing loops    (Diese Seite in Deutsch: Flag DE) Logo
Timing loops icon

Programming timing loops in AVR assembler

Beginners in AVR assembler programming very often start by blinking a LED on a port pin. This "Hello World" of the AVR universe already is a complicated task, because it is not just setting a constant to an appropriate number of milliseconds and call a timer to wait for that time (as you might solve it on a high-level language on a PC. In assembler it requires a basic understanding of how and how fast the controller executes instructions. The necessary knowledge for such delay loops and their exact calculation is described here.

Overview

  1. 8 bit register time loop
  2. 16 bit double register time loop
  3. 24 bit triple register time loop
An alternative solution for that task is provided here, which is easily expandable to any lengthy delay loop, even for 64 bit long loops.

To the top of that page

©2009-2020 by http://www.avr-asm-tutorial.net