Timer using the TaskTimer
If a simple timer is needed and the accuracy of 1 ms is sufficient, then you can use the TaskTimer.interface (Library).
' ------------------------------------------------------------------------ ' title: Example for the interface "TaskTimer" (library) ' hardware: ateval-board von eHaJo.de ' change ' 2013-10-11 rgf - library ' -------------------------------------- const F_CPU = 8000000 avr.device = atmega32 avr.clock = F_CPU avr.stack = 84 #library "Library/TaskTimer.Interface" #define LED1 as PortD.5 #define LED2 as PortD.6 LED1.mode = output,low LED2.mode = output,high TaskTimer.Init(Timer1,2,500) '2 Tasks, 500 ms TaskTimer.Task(0) = mytask0().Addr TaskTimer.Task(1) = mytask1().Addr avr.Interrupts.Enable do loop procedure mytask0() LED1.Toggle endproc procedure mytask1() LED2.Toggle endproc