I have followed in detail Maniacbugs forum posting for developing on the ATMEGA1284, I checked all my hardware and made sure the oscillator was working, I checked all voltages. The hardware seems correct. I tried using the Arduino as ISP and although the tx/rx lights flicker, it says it burned a bootloader, but it hasn't. I can't see blinking on LED on pin 1 upon power cycle. I also can't upload a program to it using a working FTDI programmer. So I tried Gammon's Atmega_Board_Programmer and although it claimed success, I see no LED blink and cannot download to the board either. So I abandoned Arduino 1.0.1 and moved to 1.6.8 and followed the instructions here. Still no success. The latest issue is when using ArduinoISP, avrdude says avrdude: Expected signature for ATmega1284P is 1E 97 05
Double check chip, or use -F to override this check.
Wrong microcontroller found. Did you select the right board from the Tools > Board menu?
Mr Gammon's board programmer tells me the signature is in fact 0x1E, 0x97, 0x05, so I don't understand that error. what I do understand is that after about 9 hours I still haven't downloaded a bootloader and I don't understand why. I have tried it on an ATMEGA328 and it worked like a champ, so I don't think I am doing much wrong there. I also have ripped up and redid the breadboard twice following Maniacbug's schematic to eliminate that I made a pin error. My ATMEGA is a ATMEGA1284P-PU. I am using a 16MHz resonator and an Arduino UNO as the programmer. Does anyone have any idea why this isn't working at all?
The error "Double check chip, or use -F to override this check" frequently means what is written there: double check your connection but do not use -F. Second case, if the bootloading process pass, the problem could be in inappropriate bootloader or mismatch in ports/pins.
Provide photos or schematics of your setup for bootloading and for downloading and also which bootloader you are trying to use.
Hi, the schematic is the one on Maniacbug's site. It's attached. Within JChristensen's 1284 library there are 6 or so variants on the bootloader, I have tried them all, the goal being to use "Maniacbug" mighty 1284P 16Mhz using optiboot. I have used Gammon's Atmega_Board_Programmer, which also seems to write a bootloader, but I still cannot download to the ATMEGA1284P. A link to that is here: Gammon Forum : Electronics : Microprocessors : How to make an Arduino-compatible minimal board.
When the bootloader is correct, on the 1284 should a LED blink upon power up on pin 1 ( maniacbug site) or on PB7 (somewhere in the forum)?
I'm bummed, because it seems like this is supposed to be simple, but I am having no success.
I would diode clamp the RESET (e.g. diode in parallel with R1 pull) up so there was no chance it could put the MCU into parallel programing mode though I don't think that is the problem. Do some continuity test of the wiring between ATmega1284p and the Arduino as ISP. That is where I've had problems.
A link back to image so others don't have to download to see:
Hi, clamped the resistor and double checked all the continuity. Also replaced the Arduino Uno I was using in case it was something there. Still no success.
I get: avrdude: verification error, first mismatch at byte 0x0000
0xfa != 0xfd
avrdude: verification error; content mismatch
Error while burning bootloader.
So I loaded Gammon's board programmer and it goes into programming mode, but gets something like this:
Writing bootloader ...
Committing page starting at 0x1FC00
Committing page starting at 0x1FD00
Written.
Verifying ...
Verification error at address 1FC00. Got: 0x00 Expected: 0x0F
Verification error at address 1FC01. Got: 0x00 Expected: 0x92
Verification error at address 1FC02. Got: 0x01 Expected: 0xCD
Verification error at address 1FC03. Got: 0x01 Expected: 0xB7
etc..
Verification error at address 1FC65. Got: 0x32 Expected: 0x34
503 verification error(s).
First 100 shown.
Programming mode off.
which isn't encouraging. But this all implies to me that the connections are good, doesn't it?
Please post a picture of your physical setup, it makes troubleshooting a lot easier.
I don't have any experience with JChristensens core, I'm the maintainer of the MightyCore. You should edit the programmers.txt file and add -v (increase verbosity level) like this:
arduinoisp.program.extra_params= -v
Open Arduino IDE settings, and turn on verbose upload. Now hook up your Arduino as ISP programmer, and hit "Burn bootloader". Please post the output from Avrdude.
Hi, Attached is a picture of the setup. I also tried downloading the bootloader again, I reinstalled Arduino 1.6.8 to see if some magic happened there. Sometimes it will give me various, non repeating errors. Occasionally, I get to pretend that I am installing a bootloader, but I am not. I then tried Gammon's Atmega_programmer and saw nothing was there. Upon trying to use that to download a bootloader, I get 2 verification errors. Since this was the first time I got so few, I tried again, and got the usual 502 verification errors. Doing it again got me back down to two, and then it took multiple tries and I was back to 502. I'd feel like I could debug this if I could get a consistent failure mechanism.
Where would I find that programmers.txt file, I have searched all over and have nothing, maybe that's my issue?
Also, I made a programming board some time ago to program bare ATMEGA328 as pro minis. I can still burn the bootloaders on those with no issue and swapped the arduino uno that was attached to it and still have no success with the ATMEGA1284s. Is it possible I have bad MEGA1284s? I only have 3 of them.
Try downloading the MightyCore instead. Then the possibility of me being able to figure this out is greatly increased! It does everything JChristensens core does, but brings you even more features and are monthly updated with updates from the official Arduino core.
You'll find instructions on how to install there. Don't use the boards manager install link; it makes modifying files really hard.
After you've installed this core, go to MightyCore/avr ang you'll fine the programmers.txt file there. Modify the one that says "Arduino as ISP (MightyCore)" by adding -v
Turn on verbose upload in the Arduino settings, and hit OK. Choose the correct microcontroller and hit "burn bootloader" (no need to use gammons loader). Please post you output after the bootloader failed. I'm not able to help without the exact error message.
When I tried to program it, it failed, that output is also attached.
I also cycled power on the ATMEGA1284 and with a LED on pin 1 or pin 8, I don't see it flash a couple times, which if all the other posts I have read, means I didn't load a bootloader. Any ideas? Did the picture of the hardware/breadboard help at all?
The bootloader seems to be loaded finally correctly so it should not be a problem. You can check it with avrdude dump or read command from command line. The last 1024 bytes should be the same as BIN (do you know hex2bin ?). Also fuses.
The problem should be (just thinking what to try next):
Some bootlader setting like LED pin, upload speed, F_CPU could cause the problem (some is clear from the image name). The LED is very helpful visual indicator at the reset and bootloader start so it is good to get it working. The LED is on Arduino's D13. Usually (don't beat me, I'm working with my own variant), if standard variant - ATmega's PD5, Bobuino has it on PB7. It depends on hex image which you have. Check this carefully. In the worst case you can go throughout pins to find it.
MCU is not running - oscillator not working, bad crystal etc. Very simple verification is to check the voltage on XTAL1 pin with the DMM, should be ~2.5V cca, if it works. I remember such case discussed on the forum.
Correctly connected USB/Serial FTDI. According the schematics seems to be OK, but...
BTW: About the chip damage question, I don't think so. You will not be able to burn the bootloader if so.
If you're using the standard MightyCore pinout, the LED should be attached to Digital pin 0 (PB0). Try to connect a reset button (or just use a wire) to pull the reset line down to ground. When you release the button the LED should blink twice.
It's also good practice to place the crystal/oscillator as close to the pins as possible. The upload speed (115200 baud) isn't the best for devices running at 16MHz, and long leads may cause problems.
You should try to burning the 1MHz bootloader, and see if you're able to upload your code. The upload speed is much slower (9600 baud)
Ha, you are not using crystal but ceramic resonator, you have set it - not the full swing. Try to change low fuse byte to 0xDE for ceramic resonator (ceramic resonator, slowly rising power) or use a crystal.
Hi, I'm away from the project today but I will try all these ideas tomorrow first thing, unless I get back early enough tonight. Thanks for the ideas. I usually do have the crystal right next to the pins, but on the breadboard that gets harder, unless I soldered a wire to the ground pin, then I could plug into the two leads on the breadboard.
How would I change the low fuse byte to 0xDE?
I did have a scope on pins 12 and 13 and checked frequency, I forget the amplitude. But it's definitely oscillating.
Well, thanks. With a 1MHz internal clock, I was able to successfully load blink and it worked. I'm still seeing issues at 16MHz, but I'll play about. What this implies (IMHO) is the hardware is all wired correctly, there still may be an issue with the long leads on the resonator, I'll solder a ground lead to the existing one and move it next to the pins, I guess a breadboard isn't the most noise free environment. I also see that on a standard Arduino Uno the clock on pins 9 and 10 is pretty solid at 16.01 Mhz at a peak voltage of about 1.19 V. The 1284 seems to be hunting around and hitting resonance at >30MHz and is just under a volt.
I'll keep playing this weekend and post the results.
Like Budvar10 said, If you're using a resonator instead of a crystal, you shouldn't use the full swing oscillator option. what is the result if you change your low fuse and burn the 16MHz bootloader again?
With the low fuse set to 0xDE, it still doesn't download a program and the LED doesn't flash on the bootloader pin. I made a board and submitted to OSH park with the resonator soldered down and very close to the pins, so I am hoping that might work. I haven't ever had an issue with using ATMEGA328s and this resonator, so it's new ground for me.
Check the wiring carefully again. Simplify the circuit to minimum - just power, decoupling 100nF as close as possible, resonator (wires about inch are not so long) and pull-up to reset. Clock must start at normal frequency, duty cycle with peak voltage near to Vcc on XTAL1 against GND.
So, here's a boggle; I used a resonator, that I had from a board made by modern device. He uses that in his bare bones board. It's based on ATMEGA328. I had one of the Modern Device boards assembled and put the scope on pins 9 and 10 and saw pretty much the same thing as I see on the ATMEGA1284P on my breadboard. That board works and I can upload files to it with no issues. I do have my fuses set for the 16MHz external as we discussed. I did shorten the leads on the resonator and soldered a ground wire to it, so now it's right next to 12 and 13.
I found references to setting the fuses on the Atmel site WRT to 1284 but can't seem to figure out how we arrived at a setting of oxDE, I'd like to understand.
It may be that nobody is using a resonator with the ATMEGA1284P? I ordered Crystals and caps to arrive Friday, and see if 16MHz is going to happen for me.
The good news is, I can use this at 8MHz, which would work ok, but I have learned a whole lot of other things thanks to the forum.