I bought a fresh ATmega1284P. I burned the optiboot bootloader from maniacbug with Uno R3 as ISP. Now I can read out the right signature and the fuse settings with Nick Gammon's board detector. I also see that data is in the flash ROM. So far, everything is fine. When I want to upload a sketch using the Uno board without controller as USB to serial interface (and connected correctly) I can't upload a sketch. When I want to communicate with avrdude having the setting "arduino" as programmer I see the right signature but don't see the fuses: avrdude -P /dev/ttyACM0 -b 28800 -c arduino -p m1284p -v
avrdude gives no error. When I select "avrisp" neither signature nor fuses are displayed (erverything 00).
When trying to upload a sketch via arduino IDE (1.0.5) I get the error:
avrdude: Expected signature for ATMEGA1284P is 1E 97 05
Double check chip, or use -F to override this check.
So it's a avrdude communication problem but I have no idea how to get it running.
The ATmega1284 runs on a breadboard with a 16MHz crystal. With 115200 baud I get the same result. The last lines of the avrdude output are:
Programmer Type : Arduino
Description : Arduino
Hardware Version: 3
Firmware Version: 4.5
Vtarget : 0.3 V
Varef : 0.3 V
Oscillator : 28.800 kHz
SCK period : 3.3 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e9705
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK
avrdude done. Thank you.
I did the same some time ago with a ATmega328P (standalone with internal 8MHz) with the line:avrdude -P /dev/ttyACM0 -b 19200 -c avrisp -p m328p -v
and everything worked well.
What confuses me is that I get the same result with two different baudrates. On some other speeds it doesn't work at all (=expected). Also why does it read only the signature but not the fuses?
So, are you using the Uno as an ICSP programmer or have you removed the 328P chip to just use as a serial programmer?
If a serial programmer then I doubt you'd be able to read fuses anyway so that doesn't sound wrong.
You would defintely neeed the right baud rate to communicate with the 1284P bootloader.
You've shown another avrdude output but not showed us the command kine you used. Then you have shown a command line for 328P but no output. Please post the command line and corresponding output so it's clear exactly what you are doing.
Also a diagram of how you are connecting and how you have your 1284P wired up. We don't even know if the 1284P is wired up correctly, especially the reset circuit. Is it on a breadboard?
What you want is a full description of what I did. As I began writing the answer I looked into the blog post I wrote about reading and setting fuses on the ATmega328P. Now I saw the mistake I did: When reading and writing fuses the Uno board acts as the programmer, has the controller on it and is connected as when burning the bootloader. My fault was that I removed the controller on the Uno board, connected Tx, Rx and RESET to the ATmega1284 as when uploading a sketch. This cannot work!! Typical late-in-the-evening-problem :~
So, here is the correct version for reading the signature and fuses of the ATmega1284P (running with 16MHz crystal):
How have you burnt the bootloader? Nick Gammons sketch, through IDE with Arduino as ISP, or manually using the Arduino as an ISP and command line avrdude?
I'm suspecting you have burnt the bootloader manually, rather than through IDE or Nick's sketch, and not explicitly programmed the fuses.
Have you installed the 1284 cores?
Your fuses don't look right at all.
I use
Lfuse 0xf7
Hfuse 0xd6
Efuse 0xfd
The standard Mighty1284 boards.txt is slightly different but I changed these for a reason:-
Lfuse 0xf7 for full swing oscillator - solves a problem that you can get with serial uploads due rxt/tx coupling with adjacent crystal pin. Full Swing gives a 'stronger' oscillator signal. Mainly encountered on breadboard builds and can be helped by pcb with proper crystal surrounding ground plane for isolation.
Hfuse 0xd6 to preserve EEPROM through Chip Erase. Needed if you program via ICSP, use Eeprom and don't want saved Eeprom data lost every time you load a new versiom of your sketch. I don't think it's required if only programming via serial and boot loadloader OR you don't use the Eeprom.
I loaded the zip file from GitHub - maniacbug/mighty-1284p: Mighty 1284P Platform for Arduino, copied the contents to the hardware folder and restarted the IDE. Then I uploaded the ArduinoISP sketch of the IDE to my Uno R3 board and then burned the bootloader with the IDE. Didn't check the fuses before. My 1284P was brandnew. First I had it running without external clock as it is shipped running on internal 8MHz (divided by 8, according to datasheet). I got a error message after burning the bootloader (optiboot). Then I added the 16MHz crystal and burned the bootloader again. This time it worked without errors.
Have you installed the 1284 cores?
Do you mean anything other than what is in the mighty-1284p file from maniacbug?
Your fuses don't look right at all.
I use
Lfuse 0xf7
Hfuse 0xd6
Efuse 0xfd
I will check this as soon as possible and give you further information. Thanks for the additional hints about the fuses!
Something still looks wrong as you should have a boards.txt entry that has the fuse setting. When you burn via IDE with Arduino as ISP it should burn the bootloader AND set the fuses based on what is in boards.txt.
The fuses you report are definitely NOT what should be in boards.txt for a 1284P
So, when looking at the fuses the difference is to take 'full swing oscillator' instead of 'ext. crystal osc.' The EEPROM thing isn't important to me. It looks like you are right with what you wrote about running the chip on a breadboard instead of a well-done PCB. From where do you know this? Your own experience or where can one find these infos?
Thanks a lot for your support. I probably wouldn't have found this.