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.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…