Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Flash Led

2004-01-17 by Wagner Lipnharski

ws34pk wrote:
> Hi Every body!
>               I have recently started programming the Atmel
> microcontrollers.Can some body help me write a simple program to
> flash an LED.I am using ATmega8.
> regards
> waseem


Waseem, read the instruction set, mostly about I/O port instructions, how to
set them for input, output and how to set or reset output level at the port
pins.  Other than that, you will need to have some timming function, to wait
some time between changing the port pin levels.

There is a I/O register that defines which bits in the I/O port will be
Input or Output. Of course you need the one with the LED to be defined as
Output.

Then just connect the LED via a resistor (300 to 500 ohms) to VCC.  The Led
Catode should be connected to the AVR I/O pin. In this way, the LED will
light when the AVR I/O pin is zero (low level).

Are you using the AVRStudio4?

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.