Hello all, I am seeking help with programming an arduino MEGA via the ICSP using a USBasp. I have gone through the required firmware dates to the USPasp and such. I am even able to upload code to the arduino UNO using this method with no problems via the arduino IDE or microsoft visual studio. However, when I attempt to upload to the MEGA boards nothing happens. I get no errors. The compiler says everything was successful but I cannot get the simple blink code to work. Below is the message I recieve when attempting to upload to the MEGA. I get the same type of message when i upload to the UNO but in that case it actually works.
Compiling 'test' for 'Arduino Mega 2560 or Mega ADK'
Binary sketch size: 1632 bytes (of a 258048 byte maximum) (0.2140123 secs)
Uploading to I/O board using 'usbasp'
Done uploading
Here is the simple code I am uploading
int led = 13;
void setup() {
pinMode(led, OUTPUT);
}
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(500); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(500); // wait for a second
}
Any suggestions??
The USBasp simply does not support the protocol/commands that AVRDUDE uses to address the larger flash address space that the mega2560 uses. Your best bet is to use your Uno board loaded with the example arduinoISP sketch as the 'hardware programmer' (which is listed among the IDE supported programmers that it supports). I don't own a mega2560 yet, so haven't done this personally but have read from several members here that it does work.
I have used both a USBtiny and USBasp programmer and while they mostly work on all my boards, up to a 1284P and 1280 type boards, they do sometimes report a 'false positive' verify error after performing a burn bootloader operation (bootloader works fine regardless of the verify error). I have however decided to buy one of those cheap $9 Asian E-bay 'arduino' Nano boards and dedicate and package it as a hardware programmer, after I load it with the arduinoISP sketch. Seems logical in the arduino IDE environment to use the arduinoISP programmer as the first choice to use?
Ok, I can give that a try, I was able to upload the bootloader to the MEGA using the USBasp. Also, the MEGA2560 is listed as one of the supported MCU. Here is a user manual for it.
aerouta:
Ok, I can give that a try, I was able to upload the bootloader to the MEGA using the USBasp. Also, the MEGA2560 is listed as one of the supported MCU. Here is a user manual for it.
Cytron.io - Simplifying Digital Making
I see that. As i said I don't own a mega2560 so can't report on USBasp use on one. I know the USBtiny programmer doesn't work with 2560 as reported on their forum. Again using arduinoISP would give you another path to try. Post your results.
I just gave it a shot. Still not working. Code uploads with no errors but does not blink LED.
I have included a picture of the simple setup
I have tried using the USBasp, Arduino UNO, and Arduino Mega as a programmer to write to a mega with no success. Any clue what I am missing?? Still not getting any error messages, just a non responsive board.
Any clue why the mega does not get programmed via the ICSP?
Surely someone as some suggestions???
This might be dumb but put a 10uF capacitor between reset and ground on the uno.
mistergreen:
This might be dumb but put a 10uF capacitor between reset and ground on the uno.
Thanks, I ran down to radio shack and tried that yesterday. It did not seem to make a difference but I still have it wired uup that way.
Could there be something wrong with the code? Does the way you call the pins change if using a programmer?