ATMEGA 1284 - Definative Bootloader Solution....

Hello all,

I have read many threads about bootloaders for the 1284, and to be honest I am confused as to which solution is the best

Does any one have an up-to-date solution for 1.0.4+ please ?

Regards Bob

The best info I have found... but are a few years old...

http://forum.arduino.cc/index.php?topic=80483.570

Have you not seen the extensive 1284 discussion going on here in the forum?
http://forum.arduino.cc/index.php?topic=235521

The bootloader part is pretty basic - after all, it just watches the serial port and loads code into memory.
It's the info in boards.txt, pins-arduino.h, and the core files that are the interesting part.

And then the things you can do with the 1284P from, such as the boards I've created:
http://www.crossroadsfencing.com/BobuinoRev17/

Cracking work Sir !!
Thats some read, 29 pages !! It didnt show up when I did a search for 1284, so I missed it, it looks like just the info I need

Thank you

From what I can see its a whole heap of work to go down the bootloader route....
Is it easier to just program the 1284 via ISP ??

mcnobby:
From what I can see its a whole heap of work to go down the bootloader route....
Is it easier to just program the 1284 via ISP ??

Not really. Once a bootloader is installed it works pretty much automatically with the arduino IDE when doing normal uploading. There are two parts of that process, first the hardware that connects the USB serial converter chips DTR or RTS signal via a series capacitor that triggers a auto-reset on the 1284 which starts the bootloader and then the actual uploading of the sketch code via serial data.

But programming via the arduino IDE's upload using programmer option under the file menu is pretty simple requiring no USB serial converter nor auto-reset circuit, but does require a 'hardware programmer' which can be one of six different kinds supported by the Arduino IDE programmer selection menu.

I have no trouble installing a bootloader via ISP using Atmel AVR ISP Mlkii, and then downloading via serial just like an Uno afterwards.

I believe Nick Gammon's bootload installer sketch works with 1284Ps as well.

You can do use File:Upload Using Programmer if you want no bootloader installed.
I've only done that with a MKii programmer. In your Arduino folder, find "avrisp2.inf", that's the folder that has the needed MKii programmer install files.

I have a few cheapo ISP programmers and some normal usb/serial type programmers, I am going to have a go at both options this weekend as I have a few 1284's kicking around...

I was looking at this ....

there seems to be so many variants, I just dont know which to go for !!

Thanks for all the replies so far

The variants are just the software names to the pin mappings.
I like Bobuino because it puts Serial on D0,D1, SPI on D10-11-12-13, I2C on D18,D19, A0 in the middle of the chip going out to A5 (and then A6, A7) just like on an Uno.
The others have taken some other tack, starting at one corner and going around the chip or something.
Your call.

mcnobby:
I have a few cheapo ISP programmers and some normal usb/serial type programmers, I am going to have a go at both options this weekend as I have a few 1284's kicking around...

I was looking at this ....

GitHub - JChristensen/mighty-1284p: Mighty 1284P Platform for Arduino

there seems to be so many variants, I just dont know which to go for !!

Thanks for all the replies so far

That's the new update the other guys were talking about. Maniacbug is currently MIA, so Jack has taken over the updating process.

However, FWIW, for the past year and a half, I've been using the maniacbug 1284 optiboot bootloader with no problems, and I've written literally dozens of programs. There is a problem in that the IDE libraries and most 3rd party libraries do not fully support the 1284, so you should read the thread that Bob mentioned and look at Jack's github page to find details if using any libraries.

In regards variants, as Bob mentioned, they each have a pins_arduino.h file that dictates how the "chip" pins are wired to the "header" pins on the different boards, etc, so you choose a variant based upon how you want the headers mapped. Eg, Bob has his Bobuino variant which has a UNO-type header layout, so it's easy to mount standard Arduino shields on his board. The other variants are completely alien to Arduino layouts.

However, note that, in general, the "same" bootloader burned into the chip [ie, optiboot-1284] will be used for all the different board variants, and only the pin mapping will change when you compile a sketch.

while (z--) { snore; }

Ummm, try sleeping on your side.

Right, thanks Dan I have I have all that now, and that has cleared up some of my confusion now, also thanks to Crossroads-Bob and retrolefty.

I am going to have a bash at this today... :slight_smile:

Hi All, got things working with my 1284's although I had a few issues...

I didnt go down the bootloader route, just went for ISP

I have 5 atmega1284 chips - ALL NEW, bought from different sources, only 3 of them would program over ISP - is this a known issue with variants of 1284 ??

I am trying out my software (which worked on my 328's) and there seems to be an issue with EEPROM.write/read, my software crashes for some reason, is there a known problem here ?

apart from that - SUPERB !!

I think I found out what the eeprom issue was.... my IDE was set to erase the EEPROM on upload or new software, its ok, I made a work-around as I have no idea how to fix this properly !! (unless anyone can help me out here !)

Change the High Fuse, bit #3, in boards.txt:

EESAVE, bit 3: EEPROM memory is preserved through the Chip Erase
Default: 1 (unprogrammed, EEPROM not preserved)

Yeah I read that somewhere and changed it... this is what I have now, but I still dont think its working (after rebooting IDE)

mighty_opt.name=Mighty 1284p 16MHz using Optiboot
mighty_opt.upload.protocol=arduino
mighty_opt.upload.maximum_size=130048
mighty_opt.upload.speed=115200
mighty_opt.bootloader.low_fuses=0xff
mighty_opt.bootloader.high_fuses=0xd6
mighty_opt.bootloader.extended_fuses=0xfd
mighty_opt.bootloader.path=optiboot
mighty_opt.bootloader.file=optiboot_atmega1284p.hex
mighty_opt.bootloader.unlock_bits=0x3F
mighty_opt.bootloader.lock_bits=0x0F
mighty_opt.build.mcu=atmega1284p
mighty_opt.build.f_cpu=16000000L
#mighty_opt.build.core=arduino:arduino
mighty_opt.build.core=standard
mighty_opt.build.variant=standard

high fuses was 0xDE and now is 0xD6, unsetting Bit3, which should cause the eeprom to be retained during programming.
Shame it doesnt work for me though :drooling_face:

mcnobby:
Yeah I read that somewhere and changed it... this is what I have now, but I still dont think its working (after rebooting IDE)

mighty_opt.name=Mighty 1284p 16MHz using Optiboot

mighty_opt.upload.protocol=arduino
mighty_opt.upload.maximum_size=130048
mighty_opt.upload.speed=115200
mighty_opt.bootloader.low_fuses=0xff
mighty_opt.bootloader.high_fuses=0xd6
mighty_opt.bootloader.extended_fuses=0xfd
mighty_opt.bootloader.path=optiboot
mighty_opt.bootloader.file=optiboot_atmega1284p.hex
mighty_opt.bootloader.unlock_bits=0x3F
mighty_opt.bootloader.lock_bits=0x0F
mighty_opt.build.mcu=atmega1284p
mighty_opt.build.f_cpu=16000000L
#mighty_opt.build.core=arduino:arduino
mighty_opt.build.core=standard
mighty_opt.build.variant=standard

For this to work just restarting the IDE does not implement it. You have reburn the bootloader using the IDE as that is the only time the IDE takes the new fuse values and burn them to the chip.

Is that even though I dont want to use the bootloader ?
I shall try then...

... and it works !!!

THANK YOU

mcnobby:
Is that even though I dont want to use the bootloader ?
I shall try then...

... and it works !!!

THANK YOU

Great. And don't worry about the bootloader being installed, the next time you upload a sketch via ISP the bootloader will be erased but the fuse values will remain.

Yep, changing fuses, I find easiest way is to burn the bootloader with the IDE, vs using some avrdude command string that I can never make work.
When I build a new board and forget to do the bootloader and go right to sketch, seems to take me a half hour of wondering why things are running so slow before it dawns on me that fuses are set for 8 MHz/8 operation! Haven't done that in a while luckily.