MEGA 1280 fails to run blink program properly

Afternoon all,

I have a MEGA 1280 connected to my 64 bit laptop running Windoze 7.

I have copied one of the standard blink programs (see below). It appears to compile and upload correctly but does not blink the LED connected to pin 13.

The problem is that I seem to remember this sketch running correctly when I first got it. Somewhere I thought I saw a note or fix for this problem but now I cant find it.

Any ideas how to fix this, its driving me crazy

Thanks Dillon

// blink sketch attached below

/* * Blink * * The basic Arduino example. Turns on an LED on for one second, * then off for one second, and so on... We use pin 13 because, * depending on your Arduino board, it has either a built-in LED * or a built-in resistor so that you need only an LED. * * http://www.arduino.cc/en/Tutorial/Blink */

int ledPin = 13; // LED connected to digital pin 13

void setup() // run once, when the sketch starts { pinMode(ledPin, OUTPUT); // sets the digital pin as output Serial.begin(9600); Serial.println("Starting..."); }

void loop() // run over and over again { digitalWrite(ledPin, HIGH); // sets the LED on delay(1000); // waits for a second digitalWrite(ledPin, LOW); // sets the LED off delay(200); // waits for a second digitalWrite(ledPin, HIGH); // sets the LED on delay(400); // waits for a second digitalWrite(ledPin, LOW); // sets the LED off delay(200); // waits for a second digitalWrite(ledPin, HIGH); // sets the LED on delay(140); // waits for a second digitalWrite(ledPin, LOW); // sets the LED off delay(500); // waits for a second digitalWrite(ledPin, HIGH); // sets the LED on delay(1000); // waits for a second digitalWrite(ledPin, LOW); // sets the LED off delay(400); // waits for a second }

The software looks OK. I assume you are checking for upload errors and don't get any. The next possibility is that the LED or resistor are broken.

Everything compiles and uploads correctly.. no errors .. not even warnings. I also had the Mega 1280 selected as the board.

I know the LED was not burned out because it works during upload .. and I swapped out the PIN13 for another pin and supplied an external resistor and LED and still nothing.

Thanks for any help

Dillon

If you open the serial monitor on the IDE (at the correct baudrate) do you see the Starting… message sent in the setup portion of your sketch?

Lefty

Well I opened the serial monitor and see nothing in either the receive or transmit window. I have also verified the baud is set to 9600 but I can not change the other parameters and do not know what they are set to in the IDE. My computer however is set to 9600, N, 8, 1.

I also changed the USB cable thinking that it might be defective but it still doesnt work.

Hopefully someone will find an answer.. its driving me nuts here

Dillon

With the Serial Monitor open and set to 9600 baud, try pressing the reset button on the Arduino. You should see the "Starting..." message when your sketch starts. If you don't get the message then there is something quite wrong with the Arduino and you might want to burn a new bootloader and/or restore the USB interface firmware.

Very peculiar.

johnwasser, retrolefty

I tried the reset as suggested but to no avail....

After much thought I had almost decided that it was a computer relater problem and not an arduino or IDE program. So to prove this I set up both IDE 0018 and 0022 on my netbook running XP PRO. I compiled with 0018 and uploaded the sketch and low and behold it worked just fine. Next I used compiled with 0022 and it also worked great.

SO... I thought .. ok what could go wrong with my Windoze 7 computer? and decided that it had to be something that I changed or maybe a driver that has become corrupt. So I decided to reload the FTDI driver.... and low and behold.. It works just fine.

Now why did I consider this course of action rather than reloading the firmware on the 8U2 and reinstalling the bootloader? Mainly because when all else fails the simplest course of action is usually the correct one. Rarely (this is only my twisted logic now) .. I say again rarely will you see something like a bootloader or firmware that is installed in an ancillary device be corrupted by uploading and running a simple program.. this is especially true of the simple programs that have been uploaded to this MEGA board.

In my career in electronics and computers ( I have been in computer forensics since 1990 and in electronics since 1966) I have only seen one time that a piece of software has done something to a computers hardware and that was to an IBM mainframe and 30 years ago.

I do thank you for your guidance and had it not been for your help it might have taken me a lot longer come to the conclusions that I did. YOu are the only ones that took the time to help and it is appreciated. I hope I can help you at some later date.

Dillon

I do thank you for your guidance and had it not been for your help it might have taken me a lot longer come to the conclusions that I did. YOu are the only ones that took the time to help and it is appreciated. I hope I can help you at some later date.

Your welcome.

Just for future reference there is a pretty simple test to prove out the basic serial communications ability of a arduino board that doesn't require that there be a active or proper sketch running on the board. We call it a loop-back test:

Wire a temporary jumper wire between a ground pin and the reset pin, this keeps the AVR chip inactive with all pins in tri-state mode.

Wire a jumper wire between digital pins 0 and 1. This wires the USB serial converter's data output to it's data input.

Plug board into PC

Open the IDE, select proper comm port number and click on serial monitor (or use an PC terminal program), and any characters you type in the transmit window and send should be seen in the receive window.

If this fails, it doesn't determine if the problem is with the arduino board's USB serial chip or the PC usb driver software but it at least takes the AVR chip and any sketch questions out of the pictures.

Lefty