LED is not woking

Another problem I have - after successful programming device red LED (PD1) don’t want to light !

Code is here:

#define F_CPU 20000000UL // Baby Orangutan frequency (20MHz)
#include <avr/io.h>
#include <util/delay.h>

int main( void ) {

DDRD |= 1 << DDD1; // set LED pin PD1 to output
PORTD |= 1 << PORTD1; // LED on

return 0;

I do all thing as in sample: pololu.com/docs/0J36/3.b, program HEX to flash, then verification - all was ok. What was wrong ?

Try replacing “return 0;” with “while(1);”. In general you never want to return from main() on an AVR because the results are unpredictable.

You linked to an example program that should blink the LED. Did that program work for you?

If you still need help, then let us know what type of device you are programming and what programmer you are using.


Thank you for your suggestion, problem solved now - I missed the location of power and ground pins.
Now everithing work perfect exept TTL serial port. I would like to do things under WinXP 64 (my main machine) and know about driver problem from topic AVR programmer on XP 64bit, but hope may be there is some work around for debugging via programming port for example ?
I am using Orangutan-B 328P and AVR USB Programmer.

Sorry, we haven’t made any progress with Win XP 64-bit since that thread. --David