Poland
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« on: August 18, 2012, 08:07:14 am » |
Hello there, I've bought an ATmega1284p, set it up on a breadboard(Maniacbug's Mighty 1284p setup) and successfully programmed Optiboot into it, using ArduinoISP. As my Uno(the first version, not R2 nor R3) is the only device with USB-TTL serial I have, I tried to use it to upload sketches to the 1284p. I tried to remove the ATmega328p from Uno and then connecting Rx, Tx, and Reset to 1284p - it didn't work. I also tried it without removing the ATmega328p, but connecting Uno's reset to GND and manually resetting the 1284p - no success. I always get a message from avrdude that the programmer is not responding(not out of sync). When I reset the 1284p, a LED connected to pin 1 blinks, so the bootloader is there. Original Mighty 1284p bootloader doesn't want to work either. I also tried to upload sketches via ArduinoISP, without bootloader, and it works fine. Even sketches using hardware Serial work fine, using Arduino Uno as USB-TTL serial. I'm using Arduino IDE 1.0.1 on Debian Wheezy amd64. I'm not sure if this is issue of Arduino Uno(and buying a FTDI cable would help) or the ATmega1284p. Has anybody ever tried to use Arduino Uno with Mega8u2 to upload sketches to standalone ATmega or Arduino without USB?
PS Sorry for mistakes in language, if any. English is not my native language.
|
|
|
|
|
Logged
|
|
|
|
|
Leeds, UK
Offline
God Member
Karma: 35
Posts: 986
Once the magic blue smoke is released, it won't go back in!
|
 |
« Reply #1 on: August 18, 2012, 08:16:12 am » |
Remove the ATMega328p. Connect TX from the arduino to TX of the ATmega1284, and RX from the arduino to RX of Atmega1284. Then connect the reset pins together.
There is no reason why this shouldn't work, so I am guessing that you got the TX and RX reversed.
|
|
|
|
|
Logged
|
~Tom~
|
|
|
|
Poland
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #2 on: August 18, 2012, 08:46:18 am » |
I've checked if the Rx and Tx pins are not reversed, and they are OK. I think this is not the problem, because sketch using Serial, uploaded with ArduinoISP, using "Upload with Programmer" works. Here's an image showing how it's all connected. The switch on the left was used previously to reset the 1284p and in the photo it's unconnected. Three LEDs on the right were connected to Arduino when I was using it as an ISP.  When I try to upload sketches using serial, the TX and RX LEDs flash two or three times, and after two-three seconds i get "avrdude: stk500_recv(): programmer is not responding" in Arduino IDE.
|
|
|
|
|
Logged
|
|
|
|
|
Leeds, UK
Offline
God Member
Karma: 35
Posts: 986
Once the magic blue smoke is released, it won't go back in!
|
 |
« Reply #3 on: August 18, 2012, 08:53:27 am » |
Could you go to File->Preferences and check the box labeled upload next to "Show Verbose Output during:". Then try uploading again and post what it says.
|
|
|
|
|
Logged
|
~Tom~
|
|
|
|
Poland
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #4 on: August 18, 2012, 08:56:59 am » |
Here it is: /usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -v -v -v -v -patmega1284p -carduino -P/dev/ttyACM0 -b115200 -D -Uflash:w:/tmp/build5095698683208589081.tmp/Blink.cpp.hex:i
avrdude: Version 5.11.1, compiled on Oct 18 2011 at 21:41:15 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "/usr/share/arduino/hardware/tools/avrdude.conf" User configuration file is "/home/szymon/.avrduderc" User configuration file does not exist or is not a regular file, skipping
Using Port : /dev/ttyACM0 Using Programmer : arduino Overriding Baud Rate : 115200 avrdude: Send: 0 [30] [20] avrdude: Send: 0 [30] [20] avrdude: Send: 0 [30] [20] avrdude: Recv: . [14] avrdude: Recv: . [10] AVR Part : ATMEGA1284P Chip Erase delay : 9000 us PAGEL : PD7 BS2 : PA0 RESET disposition : dedicated RETRY pulse : SCK serial program mode : yes parallel program mode : yes Timeout : 200 StabDelay : 100 CmdexeDelay : 25 SyncLoops : 32 ByteDelay : 0 PollIndex : 3 PollValue : 0x53 Memory Detail :
Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- eeprom 65 10 128 0 no 4096 8 0 9000 9000 0xff 0xff Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- flash 65 10 256 0 yes 131072 256 512 4500 4500 0xff 0xff Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00 Block Poll Page Polled Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
Programmer Type : Arduino Description : Arduino avrdude: Send: A [41] . [80] [20] avrdude: ser_recv(): programmer is not responding avrdude: stk500_recv(): programmer is not responding
|
|
|
|
|
Logged
|
|
|
|
|
Poland
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #5 on: August 18, 2012, 04:01:36 pm » |
Well, I've recompiled Optiboot to use 9600 baud rate and burned it into 1284p. I can upload Blink sketch without problems using serial to the 1284p, and it blinks fine, but uploading anything that is bigger is never successful. It stops in random place when uploading and I get that from avrdude: avrdude: Recv: b [62]
avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x62 avrdude: Send: V [56] @ [40] . [00] . [00] . [0c] [20] avrdude: ser_recv(): programmer is not responding avrdude: stk500_recv(): programmer is not responding
|
|
|
|
|
Logged
|
|
|
|
|
Leeds, UK
Offline
God Member
Karma: 35
Posts: 986
Once the magic blue smoke is released, it won't go back in!
|
 |
« Reply #6 on: August 18, 2012, 04:05:48 pm » |
When you compile optiboot with a 16MHz crystal it switches in a software based UART if the BAUD rate is <57600 baud. I found that optiboots software version is not very reliable (works for small programs, but not larger ones), so you may want to compile it for 57600. Alternatively, if that fails, I can send you my current version of optiboot.c which has a much improved software UART routine (written mainly for the tiny84, but should work with others). That would allow you to run at the lower Baud rate.
|
|
|
|
|
Logged
|
~Tom~
|
|
|
|
Poland
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #7 on: August 18, 2012, 05:24:59 pm » |
Well, it couldn't upload even Blink at 57600 baud rate. Could you send the file, please?
|
|
|
|
|
Logged
|
|
|
|
|
California
Offline
God Member
Karma: 13
Posts: 631
|
 |
« Reply #8 on: August 19, 2012, 12:19:09 am » |
Ah, the "paged_write" fun that nobody else has a problem with  This seems to be an issue when low voltage serial programmers try to put Optiboot on. You should be able to eventually get "Blink" onto the 1284p, but any larger sketches will fail. Try bootloading the "Orginal Mighty 1284" onto the chip and then try to upload any sketch on it. It might fail. If you bootload/sketch upload this one on the 1284p UART1 (as opposed to UART0) it seems to work well. http://code.google.com/p/optiboot/downloads/detail?name=optiboot_atmega1284p-u1.hex&can=2&q=Just replace the "U1" optiboot in the folder of the Mighty1284 Optiboot and burn bootloader. The history is here: http://arduino.cc/forum/index.php/topic,80483.465.html
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Online
Brattain Member
Karma: 249
Posts: 16553
Available for Design & Build services
|
 |
« Reply #9 on: August 19, 2012, 12:39:04 am » |
Have you tried NickGammon's writeup for '1284s? http://www.gammon.com.au/forum/?id=11637Go a little past halfway down the page. Covers installing a bootloader and downloading a sketch.
|
|
|
|
|
Logged
|
|
|
|
|
California
Offline
God Member
Karma: 13
Posts: 631
|
 |
« Reply #10 on: August 19, 2012, 12:57:28 am » |
Question CrossRoads... Have you tried this Gammon setup with an Uno?
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Online
Brattain Member
Karma: 249
Posts: 16553
Available for Design & Build services
|
 |
« Reply #11 on: August 19, 2012, 01:35:58 am » |
I have not. I use Atmel AVR ISP MKii.
|
|
|
|
|
Logged
|
|
|
|
|
Sweden
Offline
Full Member
Karma: 5
Posts: 115
|
 |
« Reply #12 on: August 19, 2012, 02:50:39 am » |
Hello there, I've bought an ATmega1284p, set it up on a breadboard(Maniacbug's Mighty 1284p setup) and successfully programmed Optiboot into it, using ArduinoISP. As my Uno(the first version, not R2 nor R3) is the only device with USB-TTL serial I have, I tried to use it to upload sketches to the 1284p. I tried to remove the ATmega328p from Uno and then connecting Rx, Tx, and Reset to 1284p - it didn't work. I also tried it without removing the ATmega328p, but connecting Uno's reset to GND and manually resetting the 1284p - no success. I always get a message from avrdude that the programmer is not responding(not out of sync). When I reset the 1284p, a LED connected to pin 1 blinks, so the bootloader is there. Original Mighty 1284p bootloader doesn't want to work either. I also tried to upload sketches via ArduinoISP, without bootloader, and it works fine. Even sketches using hardware Serial work fine, using Arduino Uno as USB-TTL serial. I'm using Arduino IDE 1.0.1 on Debian Wheezy amd64. I'm not sure if this is issue of Arduino Uno(and buying a FTDI cable would help) or the ATmega1284p. Has anybody ever tried to use Arduino Uno with Mega8u2 to upload sketches to standalone ATmega or Arduino without USB?
PS Sorry for mistakes in language, if any. English is not my native language.
I feel like I'm the expert at this type of problem with the 1284p =P!! Try my solution and if it doesn't work i'll try to help you in some other way. http://arduino.cc/forum/index.php/topic,80483.465.html See Post : #473
|
|
|
|
|
Logged
|
|
|
|
|
Poland
Offline
Newbie
Karma: 0
Posts: 11
|
 |
« Reply #13 on: August 19, 2012, 08:08:01 am » |
The Original Mighty 1284p bootloader doesn't work and Nick Gammon's sketch doesn't want to compile on Arduino IDE 1.0.1.
The UART1 solution seems to work fine with 115200 baud rate. Thanks! But, unfortunately, the UART1 pins are also interrupt pins. But I think I won't need to use more than one in my project.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Online
Brattain Member
Karma: 249
Posts: 16553
Available for Design & Build services
|
 |
« Reply #14 on: August 19, 2012, 10:33:56 am » |
Nick Gammon's sketch doesn't want to compile on Arduino IDE 1.0.1.
Did you put all the files into the same folder, Atmega_Board_Programmer? I did and then opened Atmega_Board_Programmer.ino, compiled just fine.
|
|
|
|
|
Logged
|
|
|
|
|
|