Go Down

Topic: MegaCore - Arduino support for ATmega64/128/1281/2561 and ATmega640/1280/2560 (Read 7049 times) previous topic - next topic

hansibull

Mar 15, 2016, 11:48 pm Last Edit: May 25, 2017, 06:24 pm by hansibull Reason: Update text + add ATmega640/1280/2560
Hi everyone!
As some of you might already have discovered, the ATmega64 and ATmega128 can be bought for less than a dollar at eBay or Aliexpress. Too bad they're not supported by Arduino IDE, right?

That's why I've created MegaCore - an Arduino hardware package for a handful 64 and 100 pin AVR microcontrollers! It started out as an hardware package for ATmega64 and ATmega128, but have grown to become a package that includes several other microcontrollers.

Now that support for the ATmega640/1280/2560 is added, you can use MegaCore with your Arduino Mega or Arduino Mega 2560. All you have to do is replace the bootloader, and you're ready to go! There's also an alternative pinout for these microcontrollers - AVR pinout. This pinout matches the original "AVR pinout" much better, and let's you use all 86 IO pins.

Supported microcontrollers:
  • ATmega64
  • ATmega128
  • ATmega640
  • ATmega1280
  • ATmega1281
  • ATmega2560
  • ATmega2561



Supported clock frequencies:
  • 20 MHz external oscillator
  • 18.432 MHz external oscillator
  • 16 MHz external oscillator
  • 12 MHz external oscillator
  • 8 MHz external oscillator
  • 8 MHz internal oscillator
  • 1 MHz internal oscillator



MegaCore features:



Download links, pinout diagrams, boards manager URL, installation instructions and more is available at Github:
https://github.com/MCUdude/MegaCore
MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

john1993

finally!

many probably dont know m128 was the original arduino (before it was even called arduino).  long before the somewhat better known mega8 (ng).  m128, although snubbed by official arduino company, is definitely best bang for the buck with no other family member coming close.  this new core is definitely worth a try, thanks.

hansibull

I've found some ATmega128 related fragments in the original Arduino core, but it was far from complete. It seems like core support was dropped many years ago, but no one removed the fragments.

I knew the first Wiring boards where based on the ATmega128, but did the Arduino folks used the same microcontroller in their early prototypes as well?
MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

john1993

no.  seems in order to distance themselves from the wiring initiative they also abandoned the original hardware platform in favor of m8/ng.  probably a good thing because back then m128 was about 20x more expensive than now and few would have been inclined to get on board.  actually m8 was about 10x more than today but at least affordable.  added advantage of dip for those who fear smd.

unlike parallax it was open source, more powerful, and last but not least cheaper so diy crowd jumped.  not just for rich hobbyists and academics anymore.

edit: just took it out for a spin and preliminary blink tests look good.  pin numbers seem very consistent and easily reconstructed even w/o docs.   one question though, why go nuts after pin 44?

hansibull

just took it out for a spin and preliminary blink tests look good.  pin numbers seem very consistent and easily reconstructed even w/o docs.   one question though, why go nuts after pin 44?
I've done the same on the MightyCore standard pinout as well (though I just used Mainiacbug's standard pinout). The reason this is to match the internal ports as close as possible. I think it's nice that ADC0 is actually Arduino pin A0. It makes coding along with the data sheet easier
MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

mcnobby

This is most excellent news, I was talking about the 128 last year, but held off doing anything apart from buying loads at the silly cheap price !

Thank you for your work, I cant wait to get stuck in to my 24Bit Colour VGA driver !!
http://www.youtube.com/user/Recovered
http://www.smartshow.lighting

mcnobby

http://www.youtube.com/user/Recovered
http://www.smartshow.lighting

hansibull

I actually bought mine even cheaper; 0.92$ each at AliExpress!

I'm planning to design my own development board for the ATmega64/128, but I'm not sure what's the most optimal board layout. I'm quite happy with my MightyCore development board, but the ATmega64/128 got way more pins.. The breakout board are atleast going to look like this:


MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

john1993

it's nice that ADC0 is actually Arduino pin A0.
oh yeah, i agree.  now i see it was atmel engineers that decided to go backwards on portf.

btw thanks also for the excellent m32 package.  another one of my favorites.  by far best bang for the buck in dip-land.  these were a long time coming and i wonder why people were stuck on m328/m1284/m2560 which dont come even close in terms of features vs cost.




ps: there are some rather nice pcb available on ebay: http://www.ebay.com/itm/181943619671

1. besides m128 also works from m328 all the way up to m2560
2. less than 30 cents ea
3. silk numbers clearly visible outside headers unlike similar boards that cost more
4. extra pins handy for things like regulators, leds, etc
5. literally 3 minutes to install chip, cap, xtl, and minimum programming header

heres another breakout for up to qfp64 that is even cheaper & smaller:



i have purchased hundreds of both types over the years for business and hobby.  virtually impossible to make anything close myself considering features and cost.


CrossRoads

You're talking Atmega32A vs Atmega1284P?
"by far best bang for the buck in dip-land.  these were a long time coming and i wonder why people were stuck on m328/m1284/m2560 which dont come even close in terms of features vs cost."
          32A  1284P
flash  32K  128K
eeprom 1K  4K
SRAM 2K  16K
IO  32      32  both in 40 pin DIP
USART  1    2
PWM   4     6
1-lot price at Digikey $6.28  $8.51
So yes, a little less money, but there are times when the bigger SRAM, 2nd hardware UART, more PWM are needed.
If anything Atmega324P with all the benefits of 1284P but with smaller memory would be preferred, $6.15 each.




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.

CrossRoads

Couple of 1284P boards I offer. Will also take the 164, 324, and 644 variants. And the 32A.
http://www.crossroadsfencing.com/BobuinoRev17/

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.

hansibull

Ever bought AVRs from Chinese sellers at EBay or Aliexpress?
MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

CrossRoads

Never. I only buy AVRs from Digikey or Mouser. I need repeatability in purchasing and traceability.  Not potentially counterfeit or nonworking junk.
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.

CrossRoads

And 3-4 week delivery time for parts is not acceptable either.
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.

hansibull

I've bought a LOT of AVRs at Ebay and Aliexpress, and have never received a counterfeit, even if they where dirt cheap. Of course you don't have the traceability, but hey, it's 1/6th of the price.

It's just amazing (and ridiculous) that you can buy an Arduino duemilanove/UNO clone for less than 3$ including shipping. If you need it within a week; use DHL, EMS or UPS :) Same goes with bare AVRs to. I understand that reputable companies buy their components from [insert your favorite distributor here], but we're hobbyist! We want bang for the buck! And that's why we love prices that's so low the sellers must have hijacked a cargo ship or something :P
MightyCore -  ATmega1284, mega644, mega324, mega164, mega32, mega16, mega8535
Github.com/MCUdude/MightyCore

MiniCore - ATmega8, mega48, mega88, mega168, mega328
Github.com/MCUdude/MiniCore

Go Up