The first “Hello World!” project I prefer for Microcontroller is LED Blinking. I have used AVR microcontroller . Here,All pins of PORTB declared as output.
Source Code
Here,i have written code in C using AVR Studio 5.0.
/*
* ledblinking.c
*
* Created: 3/30/2011 9:36:30 AM
* Author: sfg
*/
#include <avr/io.h>
#include <util/delay.h>
int main(void)
{
DDRB=0xFF; //all pins of PORTB declared as output
PORTB=0x00;
while(1)
{
//TODO:: Please write your application code
PORTB=0xFF; //High State
_delay_ms(200); //delay
PORTB=0x00; //low state
_delay_ms(200); //delay
}
}
Comments on: "Led blinking program with ATMEGA32 and AVR Studio 5.0" (18)
waw it is the first tutorial to be posted it is the good starting
but please try to post the avr studion5 GUI include in this tutorial windows and you can send me on my email by
ismailkamal2009@gmail.com
thanks very much
I tried compiling this program in studio 5 and it gives me a “Inconsistent operand constraints in the ‘asm’ ” inside that delay header. What is the problem here?
some macro or variable declaration problem occurs.
Send your code to me,I will check.
Thanks
thanks for the sample code!!!
this is so helpful. thanks for sharing. soft starter
Hello guys,
this link http://ww.thiems.eu/prangelsatz is a project at our university in Germany, Bocholt.
The content is about the Prangelsatz. This is not a real word, so google doesn’t know anything about this, if the project has been started.
After we and our class member implement pages about the Prangelsatz, google recognize this word.
So if you want do some good things, click on the link above and comment what is good or bad on our page.
Greats,
Sebastian
Is this alll u can code?? are u 5th std student??
hey can u delay the time for more than 1 minute
hi this is suresh i want led shato desine editor
Myself Sumanta, is trying to implement the program of BLINKING LED in AVR studio4 with
ATMEGA32. But a problem is occuring there. After burning of the program, the LED is not
blinking but remaining in ON position. Please suggest me if there is anything wrong with the
program or any other settings. If possible Email or SMS me.
Email Id- (sumanta.show@gmail.com / show.sumanta@rediffmail.com)
Mobile no.- (9932582375)
try this one. remember to use same ports for LED’s i use two LED’s for this.
#include
#include
int main(void)
{
DDRB=0b00000011; //initialize pin 1 and 2 on portb as output.
PORTB=0x01; //start value for portb.
while(1)
{
PORTB=0x02;
_delay_ms(2000);
PORTB=0x01;
_delay_ms(2000);
}
}
Can u help me to implement z above circuit using mux/demux? thanx
I truly prize your piece of work, Great post.
this use C code programmed..can u show me the AVR Assembly code for this project…dot asm language…thx
Will you help me how to control serial 8 leds, only uses one digital port. thanks
This is great tutorial to get started with AVR microcontrollers. I found here some more avr microcontroller based projects. you can check these projects, they are explained with circuit diagrams and codes.
Nice tutorials. Please start posting again
nice project