Go Down

Topic: 1284p library compatibility (Read 168 times) previous topic - next topic


Oct 02, 2015, 08:53 am Last Edit: Oct 03, 2015, 02:15 am by DaveEvans
I have a breadboard 328p project that's been running for a couple years with the following peripherals:
  • Chronodot real-time clock - Wire.h & Chronodot.h
  • microSD card - SD.h
  • LCD - LiquidCrystal.h
Sketch size=21,010 bytes (FWIW, I'm using the 1.0.5 version of the IDE.)

I plan to upgrade it to include the following:
  • Chronodot real-time clock - Wire.h & Chronodot.h
  • Adafruit TFT w/ microSD card - SPI.h, Adafruit_GFX.h, Adafruit_HX8357.h, SD.h
  • Adafruit I2C LCD w/ buttons - LiquidTWI2.h
  • RS485 - RS485_protocol.h & SoftwareSerial.h
The sketch balloons to 31,864 bytes just updating the new libraries and adding some simple tasks: check buttons, draw a line and put some text on the TFT, and do some simple RS485 comm. 

So I'm pretty sure I will need either a 1284p or a Mega2560 for the final project.  Since I'm a cheap SOB, I'm leaning toward a breadboarded 1284p.

I've done some reading on the 1284p and know about:
  • Nick Gammon's bootloader page
  • that I need fuses set for full-swing oscillator...but never set fuses before
  • the 1284p has two hardware serial "ports," so I won't need SoftwareSerial.h for the RS485
I'm concerned about the compatibility of the libraries with the 1284p.  This website says the SPI and Wire libraries are ok with the 1284p, but in addition to the simple header fix, the SD library "requires serious attention."  What does that mean?  I didn't find anything on the subject via Google.

Also, does anyone have any experience using the 1284p with the other libraries: Adafruit TFT, Chronodot, LiquidTWI2, RS485_protocol?

I'm open to other suggestions and comments, too.

Thank you,


Oct 02, 2015, 06:14 pm Last Edit: Oct 02, 2015, 06:18 pm by Budvar10
I don't think that there should be a problem to use 1284P. Yes, there are some differences but nothing which couldn't solved. Look at my clone here http://forum.arduino.cc/index.php?topic=277260.0. It is UNO like. Most important thing is how the pins are mapped. There are several  pin mapping variants beside of mine: Mighty, Bobuino... All things you mentioned work without problems and in a case of problems with the library compatibility you can modify library and I'm sure that there are people whose are prepared to help.
So, go for it!
Arduino clone with ATmega1284P


y can't u use 2560 breakout and burn boot loader at


The site you reference that discusses the SD library issue was last updated ~2 years ago, it may be out of date now.

I'm pretty sure Crossroads sells a 1284p board that has an SD card slot on it, so that makes me think that there's a working SD card library....

Honestly, I'm baffled as to how that could have been considered a significant road block - the SPI peripherals on the two chips are identical, so short of changing a few pin assignments, I'm not sure how there could be a problem making the SD library work...

The same pretty much goes for other libraries - all that might be different is pin assignments, and often you don't even need to do that (on AVRs, when you tell it to use a peripheral, it automatically takes over the appropriate pin, without the code needing to know which pin that is)
ATtiny core for 841+1634+828 and x4/x5/x61/x7/x8 series Board Manager:
ATtiny 841/1634/828/88/861/167 breakouts, mosfets, touch sensors and prototyping board in my store http://tindie.com/stores/DrAzzy


You want fat16lib's sdfat.h library.
Pricing & options, other form factors at:
1284P, Bobuino signal fanout to Arduino located headers, signal-power-gnd at each header location on 0.1" pitch, all 32 IO broken out, RS232 driver for 2nd serial port if needed (jumper selectable), DS1307 battery backed RTC, fully buffered SD socket. Onboard or offboard USB/Serial connections, prototype area for RF cards or other components, 3.3V and 5V (not installed yet in this picture) regulators.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


Oct 02, 2015, 11:32 pm Last Edit: Oct 02, 2015, 11:32 pm by bperrybap
The original post and topic subject was asking about the 1248p over and over again including in the title.
But then points to a link about the 1284.
I assume this is a Dyslexic typo?

In terms of something with extra room that is "cheap". Can you really build something with a 1284 cheaper than some of the Teensy boards? Especially if you don't have any of the other required parts needed in your tool box and are looking at a single unit?

Teensy LC being under $12
48Mhx,62k flash, 8k of ram.
It is ARM based rather than AVR, but Paul has great library support for his products.
It can be programmed using the Team Arduino IDE with the teensy addon.

It might be worth taking a look at.

If you really want a cheap chip, and you have a few parts in your toolbox you could look at the pic32 DIP based chips.
Something like the PIC32MX250F128B (just under $4 quantity 1)
You get a chip that is 28 pin dip that runs at 40Mhz, has 128k of flash and 32k of RAM.

The draw back is that you will need to use MPIDE rather than Team Arduino's IDE for programming and you might run into a few library issues (most libraries will just work, but you might run into some that might need some slight tweaking)

--- bill


Argh - yes, I meant 1284p!   :smiley-confuse:

Thanks to everyone for their comments!


If you need to modify any of the libraries here are some Arduino libraries made compatible with ATmega1284P that may help you see what changes need to be made: https://github.com/JChristensen/mighty-1284p/tree/v1.6.3/avr/libraries

For example, just taking a quick look at the Adafruit TFT library it seems like it might need ATmega1284P defines added to https://github.com/adafruit/TFTLCD-Library/blob/master/pin_magic.h


ok - thanks - I'll check it out

Go Up