[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] light up and led

From: Timothy Smith
Subject: Re: [avr-gcc-list] light up and led
Date: Fri, 07 Oct 2005 09:54:11 +1000
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051002)

Patrick Blanchard wrote:

On Thu, 2005-10-06 at 21:59 +0200, Joerg Wunsch wrote:
Patrick Blanchard <address@hidden> wrote:

Yes, use a hardware timer. ;-)  ...
Otherwise, have a look at the functions in <avr/delay.h>.
FWIW using the delay.h made more sense for me; easier code to
It eats up your CPU.  Even if you don't have any other work for your
CPU while waiting, with a hardware timer, you could at least reduce
the overall power consumption by putting the CPU to sleep.

Sure, for really short delays, a spin-loop makes sense, but when
you want your LED to blink, just use it as a good example to get
acquainted with hardware timers (even though obviously, conserving
energy isn't the most important feature of a LED blinker ;-).

It's for some reason that even the very simple demo.c that accompanies
avr-libc uses a hardware timer.

so if i was to use the PWM in an avr i could time events without holding up the rest of the program? this is a little important for my appliaction because i need to run multiple outputs at once, each being timed individually

reply via email to

[Prev in Thread] Current Thread [Next in Thread]