MiniCore - An Arduino core for the ATmega8/ 48/ 88/ 168/ 328

Hi!
Last year I accidentally ordered an ATmega328 instead of an ATmega328p. I thought there wouldn't be a problem using the ATmega328 in Arduino IDE, but I was completely wrong. All Atmel microcontrollers have a device signature, and in this case, ATmega328 and ATmega328p don't share the same signature. This means that the ATmega328 isn't officially supported (the same goes for the ATmega168).
I started searching for 3rd party cores that would add support for this, but I couldn't find any. That's why I decided to create one myself! :slight_smile:

Why use other chips than the ATmega328P?

  • You might not need 32kB flash and 2kB ram for your project
  • Some chips are dirt cheap and can be bought for under a dollar at Ebay or AliExpress
  • Less is more :slight_smile:

Core features:

  • All microcontrollers have the option to run the Urboot bootloader, which is smaller, faster, and more feature-rich than Optiboot. If you already have a board that has Optiboot installed, you can still use the latest version of MiniCore without any compatibility issues. (FYI, Optiboot was replaced by Urboot in version 3.0.0)
  • Extra keywords highlighting (Like DDRA, PORTB, PINC, and so on)
  • Selectable clock frequency, microcontroller variant, and brown-out option in the Tools menu
  • Possible to use the XTAL pins as digital IO pins if the internal oscillator is enabled
  • Boards manager URL for easy installation
  • Excellent PlatformIO support
  • Support for ATmega48PB, ATmega88PB, ATmega168PB and ATmega328PB

Supported clock frequencies:

  • External 16 MHz oscillator
  • External 20 MHz oscillator
  • External 18.432 MHz oscillator
  • External 14.7456 MHz oscillator
  • External 12 MHz oscillator
  • External 11.0592 MHz oscillator
  • External 8 MHz oscillator
  • External 7.3728 MHz
  • External 6 MHz oscillator
  • External 4 MHz oscillator
  • External 3.6864 MHz oscillator
  • External 2 MHz oscillator
  • External 1.8432 MHz oscillator
  • Internal 8 MHz oscillator
  • Internal 4 MHz oscillator
  • Internal 4 MHz oscillator
  • Internal 1 MHz oscillator

What the core doesn't have:

  • Support for the older Arduino 1.5.x and 1.0.x versions (Arduino IDE 1.8.x or 2.x.x required)

The core and more information are available at my Github repository:
GitHub - MCUdude/MiniCore: Arduino hardware package for ATmega8, ATmega48, ATmega88, ATmega168, ATmega328 and ATmega328PB

3 Likes

No interest? I am surprised :frowning:

Hello i just tried to give your core a test spin on a old atmega8 i had lying around but when i try to burn the boothloader i get this ""efuse" memory type not defined for part "ATmega8"
Fel vid bränning av bootloader." i have tried on 1.6.8 and 1.6.5, (core installed with the boards manager link)

I tried usbasp and stk500 board same message sorry.

I totally forgot to make a specific rule for the ATmega8, which doesn't have an extended fuse. I just tested it and pushed a fix. Try download the latest zip :slight_smile:

Oh awesome - I'd somehow never realized that you could deal with the efuse problem like that, nice! I know a lot of people have been running into that issue, particularly users in deprived foreign lands where the atmega8 is the best micro they can scare up.

I've had a look over at the Arduino Github repo to see how they deal with this on the Arduino NG. It doesn't seems like they are doing anything at all! Are some people having efuse issues with the NG option selected with the atmega8?

I've used this platform.txt modification on the Atmega 16, 32, and 8535 as well! Quick and dirty :smiley:

Yes, they have problems quite often. Just this week I told someone to manually do it with avrdude...

Just tested it again and its working perfect no more e-fuse problem, now i can finally get rid of all those messy single cores. Thank you!!!

Another thing do you have any idea how to make the boothloader work at 3.3v with internal 8 or 1 MHz?, that might be usefull from time to time , i know i have been looking for one other times with no luck.
Or that problem might be with the atmega8 and not the boothloader?

The 8 MHz and 1 MHz option should work just fine on 3.3v, at least with the ATmega8L. I haven't tried running my ATmega8 on 3.3v, but I guess it's possible. Don't the ATmega8 boot at 3.3v, or is it just unstable?

If i load it at 5v it runs OK 3.3v, the problem is that i cant upload at 3.3v i have tried FT232RL,CP2102 and CH340G. a bit annoying if i have to remove the nrf24l01 or similar every time i upload something.

If you have the time try uploading at 3.3v so i know if its just some local problem with my setup.

Any way nice work with the core i will give the 12mhz external a try on a usbasp later on.

If i load it at 5v it runs OK 3.3v, the problem is that i cant upload at 3.3v i have tried FT232RL,CP2102 and CH340G. a bit annoying if i have to remove the nrf24l01 or similar every time i upload something.

You can still have 5v Rx and Tx line even though the microcontroller is running at 3.3v. The FTDI/CP2102/CH304G will handle this fine. I'm actually doing this on the DIP-40 AVR/Arduino board I've designed. I have a 3.3v/5v jumper to select the microcontroller voltage. The CH340G are always running at 5v, but doesn't seem to care about the 3.3v line. Your nRF24L01 will still get its 3.3v :slight_smile:

Yes, they have problems quite often. Just this week I told someone to manually do it with avrdude...

I just tested this, and there is indeed an efuse error. According to other users it hasn't been working since 1.6.0. Why haven't anyone created a pull request to fix this? Can't be THAT hard :stuck_out_tongue:

A new release of the core is now available!

Changelog:

  • Efuse error on the ATmega8 resolved
  • Lock bit error on the ATmega48 resolved
  • Support for Arduino Eclipse IDE added!

If you're using the boards manager URL you can just upgrade in the IDE directly :slight_smile:

I'm really excited about the Arduino Eclipse support. The latest nighty builds lets you change the clock frequency and Brown out fuse bits; just like in Arduino IDE.
Download the Arduino Eclipse plugin (or complete IDE, your choice) here: http://eclipse.baeyens.it. Instructions on how to install MiniCore (or any other particular core with a boards manager URL) can be found HERE: MiniCore - Eclipse

Please let me know if you have any questions or belive you've found a bug :smiley:

What has to be done to support the Eclipse IDE in a third party board package?

Not really. First this is to get yourself a boards manager URL, which you have :wink: then you need to add the file externalprogrammers.txt to your avr folder. The reason why it doesn't accept programmers.txt is that it would require all 3rd party cores to have their own set of programmers. If not there wouldn't be possible to use them in Eclipse. In other words, Eclipse can't use programmers from other cores.

Still, if I added a full set of programmers to this core, it would mess up Arduino IDE completely with duplicated programmers everywhere! I had a discussion with the author of this plugin, and decided to call the file externalprogrammers.txt, to prevent interfering with Arduino IDE.

hansibull:
No interest? I am surprised :frowning:

Well, I have not forgotten putting that "P suffix" into my Mouser orders! Had I, I'd be jumping for joy over your core effort :slight_smile:

But, I took some time with my coffee this morning and looked over your effort - excellent.
Any reason you decided to not include the 85P?

Ray

Any reason you decided to not include the 85P?

85P? Haven't heard of that one before! :wink: Are you thinking about the ATmega8?

hansibull:
85P? Haven't heard of that one before! :wink: Are you thinking about the ATmega8?

I'm an idiot until after my second cup of coffee...
Meant ATTINY85-20PU

Ray

Why would you expect a core meant for the 32/28 pin ATmega x8 series to support an ATtiny chip?

There are many other cores available that support the tiny x5 series. I suggest you try mine - it supports pretty much all chips in the ATtiny line that are interesting to Arduino users except the ATtiny13 (which is covered by a different core) GitHub - SpenceKonde/ATTinyCore: Arduino core for ATtiny 1634, 828, x313, x4, x41, x5, x61, x7 and x8

Unlike most cores for the 85, it gives proper tone support and PWM output on 3 pins (many ATTiny cores for the 85 don't support the amazing timer Atmel gave us) and I'm working on a number of features to further improve support for these parts.

DrAzzy:
Why would you expect a core meant for the 32/28 pin ATmega x8 series to support an ATtiny chip? <...>

The question, is not why, it is why not?

The solution being offered by hansibull is flexible enough to offer a uniform "non-Arduino" core-set ... for 8-bit Atmel uC's... regardless of pinout. IMO, there are simply too many cores... the time is ripe for someone to publish a uniform approach to all of the Atmel castoffs that never became officially supported.

If not hansibull, someone else will... will not be me 'cause I'm too lazy and have been off in 32-bit land for a couple of years. Any 8-bit stuff I'm prone to do can be done with IDE 1.0.6.

Ray

I just used the core for the first time with an ATmega328P @8MHz internal, worked great thanks!

I frequently recommend that people put the Uno bootloader on their ATmega328P 16MHz boards like Nano and Pro Mini. If a bit-more-advanced-than-beginner user has no need of majek's flash write modification, are there any other improvements in the version of Optiboot used in MiniCore vs the old one used for the stock Uno bootloader that warrant the extra complication of installing MiniCore? I did look at the comparison of majekw/optiboot/supermaster vs Optiboot/optiboot/v4.4 but I'm not sure how significant those commits are to this application.

It might be a good idea to add a link to the majekw/optiboot repository branch and commit that you got your bootloader source from to https://github.com/MCUdude/MiniCore/blob/master/avr/bootloaders/optiboot_flash/README.TXT(and your other cores) so that users can easily see if there have been any significant changes to majekw's fork or Optiboot/optiboot since that time. For example, I can see that your version is at least one commit behind majekw/optiboot/supermaster: Workaround for gcc 4.7/4.8 bug #50925 making unnecessary stack frame. · majekw/optiboot@6262a28 · GitHub.