Newbie problem reading serial ports

I got an Arduino recently from SparkFun. I believe I am able to upload a program to it - but I thought I would try having the program write to the USB serial port and nothing is happening. I have included the program.

I uploaded the program using the Arduino GUI and it appears that it uploads just fine. The yellow LED's flash like something is being uploaded and I get this message:

Binary sketch size: 4648 bytes (of a 14336 byte maximum)

Atmel AVR ATmega8 is found. Uploading: flash Firmware Version: 1.18 Firmware Version: 1.18

The problem is that I never get my message back in the serial window. I have experimented with different settings for the Serial Monitor Baudrade (like 9600 - like it appear that my program is expecting). I am continuing to experiment but I was hoping someone could point out what I am doing wrong.

Do you have to do somehting special to get your program to start?


void setup() { Serial.begin(9600); }

void loop() { Serial.println("hello world"); delay(1000); // waits for a second }

Are you using the Arduino Mini?
Otherwise you should select the Atmega8 microcontroller (tools>microcontroller<atmega8)

Maybe a stupid thing:
Did you press the serial ‘monitor button’ next to the upload board? (after uploading the code to the board)

Maybe you could check if you receive any value in Hyperterminal/Xterm?


I am so happy. The problem was that I had the MCU set to ATMEGA168.

What is the deal with that? Different instruction set between the two processors.

Anyway, thank you so much - my first Arduino hello world program.