Using the 1284p/664p (IDE, bread board and boot loaders)

I created a quick blog site and posted the pins_arduino.c file

http://mnmis.wordpress.com/

The rest is at the beginning of this forum post.

When I get time, I'll find a site that I can upload files to.

Hi,

I am starting to work on a project using Atmega1284p.

I tried to download the zip file from Cowasaki's website: http://www.cowasaki.co.uk/Arduino/1284p.zip But the link is down.

Is there a place where these files are still available ?

Thank you in advance, that would be really helpful!

I can post what I used for my Bobuino board on a PC with IDE -0022 when I get home.

CrossRoads,

Thanks a lot, that would be great.

CrossRoads: I can post what I used for my Bobuino board on a PC with IDE -0022 when I get home.

post it please!

it would be great, if you post your full arduino-0022\hardware\arduino folder, because it should contain modified *serial libraries, etc..

hello from russia and thanks in advance!

Here’s what you need & how I made it work.
http://www.crossroadsfencing.com/BobuinoRev17/Bobuino17.zip
http://www.crossroadsfencing.com/BobuinoRev17/Bobuino_directions.doc

right-click, save target-as, rename if needed after saving.

These three are what really make the 1284 useful.
boards.txt
pins_arduino.c << this sets the pin mapping I used, so you need to use the Dx as defined in the schematic.
avrdude.conf

Many many thanks.

Does anyone have the source code for a working bootloader? I think my Calunium board should be able to use the Bobduino bootloader as D0-D13 use the same mapping, except for D8 and D9 which are reversed. Unfortunately when I try it I get "yikes device error". I've tried others too without success. I'm uploading using the AVR dragon under linux if that makes any difference. At the moment I'm not bothering with a bootloader and using the dragon to upload sketches, which does work.

If anyone wants to use the ethernet shield with a '644 or '1284 you'll also have to modify libraries/Ethernet/utility/w5100.h, change the line

if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)

to read

#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega164P__) || defined(__AVR_ATmega324P__) || defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__)

Try asking Skyjumper, he wrote/modified the bootloaders for his TQFP 1284 board and for my DIP 1284 Bobuino.

CrossRoads: Try asking Skyjumper, he wrote/modified the bootloaders for his TQFP 1284 board and for my DIP 1284 Bobuino.

I tried, too. No response.

By the way, I found a bootloader posted here with source: http://ryanmsutton.com/2011/06/arduino-bootloader-for-atmega-1284p/

This week I am going to try and bring up a 1284p, and this looks like what I'll start with right now.

maniacbug: By the way, I found a bootloader posted here with source: http://ryanmsutton.com/2011/06/arduino-bootloader-for-atmega-1284p/

This week I am going to try and bring up a 1284p, and this looks like what I'll start with right now.

Let me know how you get on. I tried that one but no luck for me. I've tried several and I don't believe they are all bad so it must be something I am doing or not doing. Hard to figure out what when uploading sketches works but bootloaders don't.

stevemarple: I've tried several and I don't believe they are all bad so it must be something I am doing or not doing. Hard to figure out what when uploading sketches works but bootloaders don't.

i have same problem, but i use USBTinyISP v2 and it "Works with any AVR ISP chip with 64K of flash (or less) - does not work with Atmega1281/1280/2561/2560" i can upload small sketches like "blink" with it, but when i try to Burn Bootloader to Sanguino1284 there is some error after few minutes.. "debug" led start flashing on some bootloaders..

stevemarple:

maniacbug:
This week I am going to try and bring up a 1284p, and this looks like what I’ll start with right now.

Let me know how you get on. I tried that one but no luck for me. I’ve tried several and I don’t believe they are all bad so it must be something I am doing or not doing. Hard to figure out what when uploading sketches works but bootloaders don’t.


ATmega1284P on a breadboard by maniacbug, on Flickr

Works great. I used Ryan M. Sutton’s bootloader with a couple modifications:

  • 16MHz
  • 57600 baud (highest that works)
  • Enabled watchdog mods

Burned it with mega-isp #04.

Be sure to get the fuses right. This is a pretty BIG bootloader, which requires the maximum available bootloader size, so a ‘high’ fuse of D8.

I haven’t brought up the core yet, just testing with a real simple AVR blink:

#include <avr/io.h>
#include <util/delay.h>

#define LED_DDR  DDRB
#define LED_PORT PORTB
#define LED      PINB1

int main(void)
{
  LED_DDR |= _BV(LED);

  while(1)
  {
    LED_PORT |= _BV(LED);
    _delay_ms(500);
    LED_PORT &= ~_BV(LED);
    _delay_ms(500);
  }

  return 0;
}

maniacbug: Works great. I used Ryan M. Sutton's bootloader with a couple modifications: * 16MHz * 57600 baud (highest that works) * Enabled watchdog mods

Burned it with mega-isp #04.

Be sure to get the fuses right. This is a pretty BIG bootloader, which requires the maximum available bootloader size, so a 'high' fuse of D8.

I haven't brought up the core yet, just testing with a real simple AVR blink:

Thanks, I'll give that a try again. Can you please upload the relevant section from boards.txt?

stevemarple: Thanks, I'll give that a try again. Can you please upload the relevant section from boards.txt?

At the moment, I cut out the IDE so no boards.txt needed. When it's all done and working perfectly, I'll bring it into the IDE and craft a working boards.txt file.

Setting fuses:

$ avrdude -p m1284p -P /dev/tty.usbserial-A40081RP -c avrisp -b 19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xfd:m -Uhfuse:w:0xD8:m -Ulfuse:w:0xFF:m -Ulock:w:0x0F:m

Burning bootloader:

$ avrdude -p m1284p -P /dev/tty.usbserial-A40081RP -c avrisp -b 19200 -F -U flash:w:ATmegaBOOT_1284P.hex

Uploading sketch:

$ avrdude -V -F -D -C /usr/local/avrtools/etc/avrdude.conf -p atmega1284p -c stk500v1 -b 57600 -P /dev/tty.usbserial-A600eHIs  -U flash:w:16000000/Blink_Simple.hex:i

Ok, here it is. Posted a full set of hardware platform files, compatible with 1.0, tested against RC1, as Mighty 1284P.

There are surprisingly few changes needed to the 1.0 Arduino core files. I will see if I can interest the development team in taking them, and then the 1284p platform would be simpler still because it wouldn't need to duplicate the core files.

I still have to do some more exhaustive testing of PWM pins, SPI, ADC's, etc. Basic sketches uploaded and tested fine. Bootloader was programmed fine from the IDE.

maniacbug: There are surprisingly few changes needed to the 1.0 Arduino core files. I will see if I can interest the development team in taking them, and then the 1284p platform would be simpler still because it wouldn't need to duplicate the core files.

The pin mapping doesn't belong in the core libraries and adding yet more mappings only increases the mess. The SD library supports the ATmega644P Sanguino, but it won't work with my Calunium. Why? Because I chose to use a different pin mapping, one which placed the SPI interface in the same place as the standard Arduino. I recently asked (on the issues page on Google code) what needs to be done so that all the pin mapping information is held in pins_arduino.h, and no processor or board specific assumptions are made by the main libraries, but I haven't yet received an answer.

stevemarple: The pin mapping doesn't belong in the core libraries

Indeed. But it's not in the core anymore, it's in 'variants'. So what specifically is the problem? Just the SD library?

stevemarple: adding yet more mappings only increases the mess.

Totally agree. If I could have found something that worked end to end, I would have used that. Wish I would have found your calunium platform on github originally. But it doesn't include a bootloader :| So still more work needed to bring together an end-to-end solution.

Also, there are plenty reasonable points of view on how 1284P pins should be laid out. Really the core should be agnostic to that, and in my couple days of experience with this, pins_arduino.h lets you control the pins plenty well. I found only one hard-coded pin reference that needed to be fixed in the core, and submitted a patch for it issue 727.

stevemarple: I chose to use a different pin mapping, one which placed the SPI interface in the same place as the standard Arduino.

Right, this is the classic problem faced in this situation. I looked at what the Mega did, and the Mega completely doesn't maintain SPI pin compatibility in any way. So Mega already breaks SPI & I2C shield compat, making this beahviour kind of 'standard' though certainly debatable.

stevemarple: I recently asked (on the issues page on Google code) what needs to be done so that all the pin mapping information is held in pins_arduino.h, and no processor or board specific assumptions are made by the main libraries, but I haven't yet received an answer.

What further board-specific assumptions do you want to get rid of? Perhaps a more effective approach would be to send in a patch that accomplishes it.

Mihail_: i have same problem, but i use USBTinyISP v2 and it "Works with any AVR ISP chip with 64K of flash (or less) - does not work with Atmega1281/1280/2561/2560" i can upload small sketches like "blink" with it, but when i try to Burn Bootloader to Sanguino1284 there is some error after few minutes.. "debug" led start flashing on some bootloaders..

I ran into that problem about two weeks ago and contacted adafruit industries to update their store and usbtiny support pages. Fwiw, ladyada knew of the problem already but I guess she hadn't seen the need yet to update her website pages.

As far as uploading stuff goes, my guess is that success depends on how big your program is and where in the memory space it is being stored. Boot loaders are impossible to be burned at the present time with the usbtiny, ladyada stated that hardware and software issues are the reason. In other words, do not expect a firmware update to make your usbtiny 1284p-compatible.

I had good luck uploading the brewtroller boot loader, etc. onto my tqfp-form factor 1284p using the avr ISP mk2.

Ok, here it is. Posted a full set of hardware platform files, compatible with 1.0, tested against RC1, as Mighty 1284P.

Awesome! In the end, I used maniacbug's files and it worked like a charm. Only tested blink and PWM on an LED so far. Serial0 is working too. Managed to first burn the bootloader using the IDE on a macbook and then to upload sketches without any trouble.

Is the second hw serial port supported ?

And also, what are the changes to the core files ?

Thanks a lot!