[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] light up and led
From: |
Patrick Blanchard |
Subject: |
Re: [avr-gcc-list] light up and led |
Date: |
Thu, 06 Oct 2005 18:05:46 -0500 |
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
> > follow.
>
> 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.
after now knowing about the C99 syntax, the ISR approach make a lot more
sense. I preferred ISRs w/ CVavr because they were easy to implement and
worked better than polling or looping in main() for most everything... I
guess this means I owe you a beer.
- Re: [avr-gcc-list] light up and led, (continued)
- Re: [avr-gcc-list] light up and led, Bernard Fouché, 2005/10/06
- Re: [avr-gcc-list] light up and led, Joerg Wunsch, 2005/10/06
- Re: [avr-gcc-list] light up and led, Timothy Smith, 2005/10/06
- Re: [avr-gcc-list] light up and led, Vincent Trouilliez, 2005/10/06
- Re: [avr-gcc-list] light up and led, Joerg Wunsch, 2005/10/06
- Re: [avr-gcc-list] light up and led, Patrick Blanchard, 2005/10/06
- Re: [avr-gcc-list] light up and led, Joerg Wunsch, 2005/10/06
- Re: [avr-gcc-list] light up and led, Timothy Smith, 2005/10/06
- Re: [avr-gcc-list] light up and led, Daniel Mayo, 2005/10/06
- Re: [avr-gcc-list] light up and led, Timothy Smith, 2005/10/06
- Re: [avr-gcc-list] light up and led,
Patrick Blanchard <=
- Re: [avr-gcc-list] light up and led, Timothy Smith, 2005/10/06
- Re: [avr-gcc-list] light up and led, Patrick Blanchard, 2005/10/06
- Message not available
- Message not available
- Re: [avr-gcc-list] light up and led, Patrick Blanchard, 2005/10/07
- Re: [avr-gcc-list] light up and led, Joerg Wunsch, 2005/10/07
Re: [avr-gcc-list] light up and led, Timothy Smith, 2005/10/06