Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Is the animated led connection correct with atmega32?

Status
Not open for further replies.

electronicslab

Junior Member level 3
Joined
Sep 6, 2009
Messages
28
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
On Earth
Activity points
1,418
atmega32 use the led animation

https://img246.imageshack.us/i/avr.jpg/

The led is off all the time.Don't know why.
Someone please help.

Code:
#include <avr/io.h>

/// Typedefs //////////
typedef unsigned char u8;
typedef unsigned int u16;
typedef unsigned long u32;

/// Defines ///////////
#define forever         117
#define LEDOFF          PORTB |= (1<<4)
#define LEDON           PORTB &= ~(1<<4)

/// Prototypes ////////
void InitPorts (void);
void Delay (u32 count);

int main(void)
{
    InitPorts();

    while (forever)
    {
        LEDON; 
		Delay(20000);
        LEDOFF; 
		Delay(20000);
    }
}

void InitPorts(void)
{
    //DDRB |= 1<<DDB4;
	DDRB=0xFF;
}

void Delay(u32 count)
{
    while(count--);
}
 

avr atmega32 connections

The Led cathode should be connected to ground and anode the pin 4. Then the led will glow

Use a current limiting resistor approx 180E

Nandhu
 
nandhu015 said:
The Led cathode should be connected to ground and anode the pin 4. Then the led will glow

Use a current limiting resistor approx 180E

Nandhu
Thank you.
What does it mean by 180E?
180 vault? or watt?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top