Ram issue: how to reset and upload?

I'm working on Mac OS X.5.7, with a Diecimila and a ATmega 328.
Here is my project: http://www.flickr.com/photos/cyrillearndt/sets/72157621768853033/
I changed the ATmega 168 for the 328 (not enough program space, not enough ram) and it worked fine.
I just added some code and uploaded.
Pressed a button to change the preset and the Arduino began to freeze: random parts of the text on the screen, LED onboard flashes (13, same than RS LCD pin), random LEDs.
It happens every time I reset it. :frowning:

I want to upload a more light firmware but:

avrdude: stk500_recv(): programmer is not responding

How to fix that?

Does your new 328 have a bootloader preloaded?

See : http://arduino.cc/en/Tutorial/Bootloader

Yes, of course, as I said it worked fine before adding those last lines.


Is there a way to avoid that the chip begins the program in order to upload?
I was thinking of something like pushing the reset button and upload, but it doesn't work: the program begins immediately!

Assuming the chip is not fried, the easiest and most useful long-term solution for this is getting a dirt cheap avr programmer like this:



  • very cheap
  • flash your chips anytime anywhere
  • restore broken bootloaders
  • erase chips that behave strange

I already thought about that, but have 3x preloaded 168 in advance, so I don't think I will need the programmer for a while... (but have only one 328 :()

You're a masochist it seems...

Get a programmer man!

I think I'm going to try this (cheapest) solution : MEGA-ISP Shield
It's basically the 6 pins cable pluged one side on the slave Arduino and the other to 4 pins/+5/GND of the master (programmer) Arduino. Plus 3 LEDs.
But no one seems to have already done this for programming a 328...
[edit]I would enjoy to have a programmer but as I said I don't need it do much for now.
4 solutions:

  • Order it here in France (expensive shipping and shops)
  • Wait to go to Paris and try there to find one
  • Buy one from the US or eBay
  • Build it myself
    The cheap one from Sparkfun seems great, but doesn't look to good for my Mac...[/edit]

If you're talking about this one

it is based on the USBtinyISP by limor fried (and others) and it works on windoze/mac/linux. It is auto-detected on MAC/Linux.

But if you have a look at the comments you see problems with macs, linux and some windows machines. Some fixed it by cutting a trace and powering it externally, others used a hub. It doesn't seems so perfect as it should! :-/

Hm. I only use linux and it just works.

For now it would be ok because I have a Ubuntu(+Windows) PC I can use, but in a few months I will only have my MacBook, so it should be alright. I will try the MEGA-ISP first, and if I have a problem, will perhaps give it a try... (I don't have a hub btw)

I soldered headers to wires, will try it tomorrow with a 168 chip first.

Hm... trying on a 168:

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: stk500_2_ReceiveMessage(): timeout
avrdude: stk500_2_ReceiveMessage(): timeout

Am I missing a configuration part or it should be straight on?
(-Upload the avr-isp sketch

  • Connecting cables
  • Select "Burn bootloader" in the IDE)

I have again checked every connection, MEGA-ISP doesn't seem to work for me:
On the programmer Arduino the LEDs blink, and then the heartbeat LED fades... always the same error.
On the slave Arduino, the sketch runs...

BTW, the onboard LED of the programmer Arduino blinks not very bright according the blinking of the slave. It seems normal (since 13=SCK), but doesn't do that with the Standard Firmata on the Master (I used it to check the connections.).

Also no result with an empty sketch on the slave Arduino.

Any other idea?

I ordered the Sparkfun Pocket AVR programmer, I hope this will solve this issue! :wink:

You have chosen wisely.

I hacked my Duemilanove and made it an AVR programmer! I couldn't afford the programmer sold in shops here, nor get one from abroad.

It works like a charm! I've programmed MANY AVRs!!


I got the programmer, had to use a PC, but it's working fine! :wink:

(I will soon get a hub, and it will be alright on the MacBook.)