TinyCore - a new Arduino core for classic ATtiny chips

Hi!

I'm the creator of several popular 3rd party Arduino cores such as MiniCore and MightyCore. Recently I've been working on a new project I'm excited to share with you!

ATtinyCore has been the go-to 3rd party Arduino core for support for "classic" ATtiny chips such as the ATtiny84 and ATtiny84. However, ATtinyCore hasn't seen meaningful contributions in years, and a new major version (ATtinyCore 2.0.0) remain untested and unfinished.

I have quite a lot of experience when it comes to 3rd party Arduino cores, so I decided to fork ATtinyCore and continue the work as a new core TinyCore.

TinyCore is a new Arduino core for the ATtiny25/45/85, ATtiny24/44/84, ATtiny441/841, ATtiny261/461/861, ATtiny87/167, ATtiny48/88, ATtiny2313/4313, ATtiny1634, ATtiny828, ATtiny43U and ATtiny26.

TinyCore brings lots of new improvements that's worth looking into!

  • Arduino IDE 1.8 and 2.x supported!
  • Optiboot have been fully replaced by the rock-solid Urboot bootloader with have lots of features, including "brick prevention" built-in. The bootloader itself only occupies only 256 bytes of flash, and is optional.
  • Greatly improved documentation with new pinout diagrams and minimal setup schematic diagrams for all chip families
  • Full hardware debugger support in Arduino IDE 2.x using PyAvrOCD (bundled in the boards manager installer)
  • Uploading is done using the latest and greatest Avrdude v8.1 (also bundled in the boards manager)
  • Built-in support for simple internal oscillator calibration using a USB to serial adapter
  • The IDE tools menu have been updated and is now way less cluttered with fewer obscure options
  • Lots and lots of bugs have been tracked down and fixed

You can read more about TinyCore here!

Installation can easily done through the boards manager

Please give it a try, and let me know what you think! I'm open to suggestions, and ideas for improvement! TinyCore is still very much a work in progress, so please report any bugs or issues you may find, here, or on Github.

I want to thank @fogg for providing and implementing the excellent cross-platform PyAvrOCD GDB server, and extensive help with performing systematic tests on real hardware.

Also, big thanks to Spence Konde for all the work put into the ATtinyCore project over many years. TinyCore would not have existed if it weren't for ATTinyCore.

Got it! Thanks.

It's sad that Spence Konde is no longer maintaining ATtinyCore for whatever reason. Life changes, that's the usual reason.

I have used ATtinyCore for several years and recommended it to others many times. I would also like to send my thanks to Spence for his excellent work.

But I'm very glad that @hansibull has taken up the responsibility of maintaining and improving the project. I have also used and recommended MiniCore many times, so I know that the project is in good hands. Thanks @hansibull !

Glad about this also. I am still using 1.8.19. I will get around to installing 2.x sometime soon. The noise and complaints about it seem to be diminishing. I must also update my Ubuntu version...

On the matter of the history of the ATtinyCore I want to also emphasise my thanks for the incredible amount of work that Spence Konde (@DrAzzy) put into it and that I have found this very valuable. It amazes me that some people are prepared to, and are capable of, producing huge amounts of useful resources for the community without any obvious reward (apart from a few karma points). This simply amplifies what I said when the TinyCore was first mentioned Attiny by SpenceKonde - #30 by 6v6gt including an acknowledgement that the work that we have already seen from @hansibull makes him an ideal candidate for this activity.

Having said all that, I no longer use the ancient ATTiny AVR series chips and have only one active application which uses an ATTINY85. For low power non-wifi projects I now use the newer TinyAVR series 1 and 2 chips and, of course, Spence's megaTinyCore.

Spence, however, appears not to have quit scene entirely and his Github page SpenceKonde (Spence Konde (aka Dr. Azzy)) · GitHub shows a recent burst of activity, focussed mainly on the DxCore . However, this does highlight the issues which can occur when major contributors do actually, for one reason or another, abandon (even temporarily) their work.

I've seen the most satisfactory results when the previous major contributor announces a successor to carry on the good work and it all seems friendly. Bad is when major work just gets lost or where there is fragmentation because multiple people grab hold of it or where those who do get hold of it, at least initially, appear not to have the necessary skills that the task demands.

Thanks you did a great job it is very much appreciated.

Thanks for the kind words!

I no longer use the ancient ATTiny AVR series chips and have only one active application which uses an ATTINY85. For low power non-wifi projects I now use the newer TinyAVR series 1 and 2 chips and, of course, Spence's megaTinyCore.

This absolutely makes sense, as the newer chips are cheaper and more capable. However, there are a lot of existing products and projects out there that is runs on "classic" ATtiny chips.

The goal for this core is not to keep adding new functionality, but to provide a stable, efficient and reliable framework for projects to be built upon or ported to. Once most bugs have been found and eliminated, This core will go into the same kind of "maintenance mode" as my other core. Not necessarily under "active development", but in a state where I will be responding to reported issues and submitted pull request. I will also make sure tools such as Avrdude and PyAvrOCD is kept up to date.

I have also deliberately removed functionality I think clutters the source code, makes the documentation harder to follow and the project harder to maintain. Most noticeably, TinyCore won't support the Digispark, its bootloader or any of the emulates USB libraries. The ATtiny family is heavily memory constrained, the software USB implementation is flakey and something I don't want to support or troubleshoot. If you own a Digispark there are several other Arduino cores you can use.

Is there a specific one you would recommend?

I am aware of these:

The official Digistump AVR Boards is abandoned. ArminJo deprecated their fork in favor of ATTinyCore.

These as the ones I know about too. However, ATtinyCore does not include any Digispark (USB) related libraries, which is IMO what makes the Digispark so neat. In my opinion, a dedicated Digispark Arduino core would be better than combining everything. I would root for the ArminJo fork.

Just to clarify, is it just the Digispark bootloader that isn't supported in TinyCore on the ATtiny85? Or is there no bootloader for the 85 at all?

If I have uderstood correctly --
The Digispark bootloader supports sketch uploading without the need for an additional hardware, as the bootloader emulates a USB port in ATtiny85 to communicate directly with the PC/IDE.

The @hansibull bootloader also supports sketch uploading, but it requires additional hardware, such as a USB-to-TTL converter.

TinyCore provides the option to use the ATtiny85 with the urboot bootloader. You must select one of the "Yes" options from Arduino IDE's Tools > Bootloader menu in order to configure the board definition to use the bootloader.

If you have "No" selected from that menu, then the board definition is configured for use without a bootloader. In this configuration, you must use an ISP programmer to upload to the ATtiny85 target. With this configuration, a Tools > Burn Bootloader operation only sets the configuration fuses on the ATtiny85.

Does that bootloader communicate with the PC/IDE using a software UART port, for which a TTL-to-USB converter is required?

That's what the README says under the heading Bootloader.

Then the @hansibull bootloader is exactly similar to UNO R3's bootloader??

It is a UART bootloader just like the Optiboot bootloader used by the UNO R3.

I think the difference in bootloaders won't have any effect on the user's workflow. However, there are some differences between the two. You can learn about the urboot bootloader used by TinyCore here:

https://github.com/stefanrueger/urboot/#urboot

Can the urboot bootloader be used to send UART data back to the Serial Monitor from the ATtiny?

No. The bootloader is only active during the upload process. At that time, the upload tool has control over the board's serial port and Serial Monitor is disconnected from the port.

Communication between the ATtiny and Serial Monitor can only be done via the sketch program. You can use the usual Serial.println("Hello, world!") type approach for that. This is true even for the parts like ATtiny85 that don't have a hardware UART. The reason is that TinyCore provides a special software serial implementation for these parts:
https://github.com/MCUdude/TinyCore#spi-i2c-and-uart

It defines an object named Serial that uses its internal "TinySoftwareSerial" implementation when using one of the parts that doesn't have a hardware UART.

That software serial implementation is available for use by the sketch even if you don't have the bootloader installed on the chip (i.e., Tools > Bootloader > No).

Well, the core is still under active development, and I have some exciting news to share!

First, we now have support for PlatformIO, for those who prefer to use this (like me!). This means that you can flash your sketch, set fuse bits and burn the exact bootloader you want. Since Avrdude creates the bootloader binary on request, you can specify the exact bootloader variant that fits your exact application. This is IMO one of the most impressive features in the latest Avrdude (8.1) release. There have also been lots of under-the-hood improvements. Your average sketch will be smaller in size when compared to ATtinyCore, and especially if you're using Serial.

Another big thing is that @fogg and I have spent lots of time to test all core functionally (digitalRead/Write, analogRead/Write, Serial, Wire, etc.) to make sure it properly works on all supported chips. We found a bunch of bugs dating back to ATtinyCore 2.0.0 and even 1.5.2, and we have also done some significant improvements that lots of users will benefit from, mostly in terms of reduce flash and RAM usage

  • We have switched to a non-buffered hardware serial TX impementation that acts similar to the TinySoftwareSerial implementation that non-UART chips already uses. Doing this saves a whopping 226 bytes of flash and 18 bytes of RAM! The old, buffered implementation can be enabled when using PlatformIO
  • It's now an option to disable Serial RX on chips with hardware serial. This saves another 162 bytes of flash and 18 bytes of RAM!
  • Added support for the MH-Tiny ATtiny88 board
  • Lots of documentation improvements and other bug fixes

Download the latest TinyCore version from the boards manager and give it a try!

If you find any issues or bugs, please create an issue or a pull request on Github. I'm grateful for every contribution!