Pages: [1]   Go Down
Author Topic: Programming the AVR does not work after using a serial programme  (Read 504 times)
0 Members and 1 Guest are viewing this topic.
Budapest, Hungary
Offline Offline
Newbie
*
Karma: 0
Posts: 15
I'm an enthusiast iOS and Linux developer, recently starting Arduino hacking.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I'm using an Arduino Duemilanove with an ATmega328p chip on Ubuntu 11.10. My problem is the following:

I've uploaded the code from this tutorial to my device, and it seems to be working fine (I've configured the famous `minicom' application to 9600 baud, 8-bit, no parity, 1 start, 1 stop bit - as it was specified in the tutorial, and I got the 'Hello World!' message every 5 seconds, as expected.). However, I can't upload hex files to my Arduino anymore. I'm using avrdude with the following parameters: (the config file is the usual Arduino avrdude config file):

Code:
avrdude -C avrdude.conf -p atmega328p -c arduino -b 57600 -P /dev/ttyUSB0 -U flash:w:serial.hex:i

I even tried it with baud rate=9600. I'm getting various error messages from avrdude, including:

avrdude: stk500_getsync(): not in sync: resp=0x00

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0xe0
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x00
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0xe0

However, the board resets correctly, isn't stuck in a loop...

I'm sure it's the serial settings which messed up the board, but how can I fix it? (since I can't set the UART control bits back without being able to upload new code to the MCU...)

Thanks in advance!
Logged

If it can't be done in XXX, try in C.
If it can't be done in C, try in assembly.
If it can't be done in Assembly, well...

Budapest, Hungary
Offline Offline
Newbie
*
Karma: 0
Posts: 15
I'm an enthusiast iOS and Linux developer, recently starting Arduino hacking.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

SOLVED:

I didn't notice I was running "minicom" in the background. Killed Minicom, unplugged/replugged the Arduino, and it works now perfectly!

Cheers,

Árpád
Logged

If it can't be done in XXX, try in C.
If it can't be done in C, try in assembly.
If it can't be done in Assembly, well...

Pages: [1]   Go Up
Jump to: