MegaTinyIDE
MegaTinyIDE is a Java & GNU-based IDE for the new MegaTiny chips (tinyAVR® 1-series and 0-series), such as the ATtiny212, attiny3217, etc.
Install / Use
/learn @wholder/MegaTinyIDEREADME
MegaTinyIDE (for 64 bit macOS, Windows & Linux)
MegaTinyIDE is a simple, GNU-based IDE that's derived from another project of mine called ATTiny10IDE, which I originally wrote to simplify writing code for the ATTiny10 Series Microcontrollers using C. C++ or Assembly language. This new version is intended to support coding for the new MegaTiny chips (tinyAVR® series 0, 1 & 2), such as the ATtiny112, which feature 4K of Flash memory and a greatly expanded set of features when compared to the original, Atmel-designed ATTiny series chips.
~~Note: native release for 64-bit Windows, Linux and macOS are available in the Releases section to the right of this page. These come with and embedded Java runtime and do not require you to first install a compatible Java runtime on your computer. However, this feature is still experimental.~~ This feature currently suspended due to Github's new file size limit. Please run as a Java app.
Project Goals
The tinyAVR® 0, 1 and 2-series chips introduce a single-pin Unified Program and Debug Interface (UPDI), which makes it possible to do away with the need for a bootloader and still make use of all the I/O pins except RESET, which is the pin used by UPDI. While UPDI is supported by Microchip's development tools, such a MPLAB, I wanted to develop a lightweight, alternative IDE similar to the Arduino IDE, but streamlined to support just this new tinyAVR architecture. In addition, I wanted to add other, special features such as those listed below:
- Now supports include of user files using
#include "file.h"notation - Automatically annotate interrupt vectors in listing file (optional)
- Interleave code and generated asm in listing file (optional)
- Pop Up Interfaces for:
- Viewing and Editing FUSE values (see below)
- Viewing and Editing EEPROM bytes
- Viewing and Editing USERROW bytes
- Viewing and Editing Variables in SRAM
- Identifying Target Chip
- Hardware Debugging (via the UPDI interface using compatible programmer/debugger):
- Set a Hardware Breakpoint by selecting the checkbox on an executable line of code in the Listing View
- Single Step while the highlighted line in the Listing View shows the next line to execute
- Right click on Registers and Status Flags in debugger pane to change value (I/O ports not currently supported)
- Watch the I/O ports, Registers and Status Flags change while stepping through code (changed fields are highlighted)
- Click on Links in Symbol table to view current state of variables
- Also, able to debug externally compiled ELF files (version 1.0.1)
- Built-in Pinout Reference Diagrams (with pin-level tooltips)
- Pop up AVR Instruction Guide tooltips in Listing Pane (hover over instruction name)
- A Console Monitor feature called OCD Messaging that can send text message to the debugger over UPDI
- Preliminary support for Arduino-style coding using the megaTinyCore library by Spence Konde (aka Dr. Azzy) See:
arduino412.cinexamplesfolder - Use a
#pragmain code to engage special compile time features, such as pop up dialogs that prompt for#definevalues or select the target chip part number. - Native Versions with an embedded JVM are now available (see "Releases")
As this project advances, I hope to add many more features designed to make uisng the tinyAVR 0, 1 & 2-series chips as easy as possible, such as:
- Improving the built-in documentation
- More example code for the tinyAVR® 0, 1 & 2-series chips
- Support for other UPDI-based programmers (and possibly debugging)
- Support for additional tabs to allow opening additional source or header files
Project status
While more testing is needed, I am declaring the code as operational (Beta status) on Mac, Windows 10 and Linux. However, MegaTinyIDE is still in development and likely has more than a few bugs, or rough edges. As this is a one-man project, I sometimes struggle to do adequate testing (especially on Windows and Linux) when I release a new version. If you do a spot a problem, please post in Issue,,, so I can investigate. If you have questions, or suggestions, please post in Discussions
Releases
- 1.0.0 - initial release.
- 1.0.1 - Refactor toolchain loading and add ELF file debugging
- 1.0.2 - Rework ELF file debugging to load from menu rather than from the command line
- 1.0.3 - Fixed cosmetic regression
- 1.0.4 - Fixed a few more cosmetic regressions
- 1.0.5 - Fixed build process (builds 1.0.1 - 1.0.4 did not package proper jar file)
- 1.0.6 - Added document table for multiplexed pins and peripheral address map
- 1.0.7 - Bug and Documentation fixes and enhancements
- 1.0.8 - Regression fix for #include problem in Linux version
- 1.0.9 - Added code examples embedded in markup-type documentation
- 1.0.10 - Added support for using UBB/Serial adapters as programmers
- 1.0.11 - Regression fixes for Flash programming functions and other changes
- 1.0.12 - Reworked Programmer menu, update to jssc-2.10.2 and added series 2 attinys
Debugging Interface
<p align="center"><img src="/resources/documentation/images/debugging.png"></p>MegaTinyIDE supports on-chip debugging of using the one pin UPDI interface. Currently, this requires using a UPDI programmer/debugger, such as the Atmel-ICE or PICKit-4, but MegaTinyIDE can also talk to the built-in debugger chips on the ATTiny3217-Curiosity-Nano, ATTiny416-Xplained-Nano and ATTiny817-XPlained-Mini and the ATTiny3217-Curiosity-Nano board can also be adapted to function as inexpensive programmer/debugger.
Debugger Limitations: The debugger can only set a breakpoint on assembly language instructions, not lines of C/C++ language code. And, because modern compilers perform a lot of optimization on the code to reduce the number of assembly language instructions needed to implement a statement in C/C++, it can sometimes be hard to tell which assembly instructions correspond to a given C statement, especially if you are not familiar with assembly language code generated by the compiler. There is an option (on by default) that tells the compiler to interleave the C/C++ statements with the generated assembly, but this can sometimes be more confusing than helpful, especially as modern compilers will sometimes reorder the code, such as to move invariant operations outside a loop.
Pinout Reference Diagrams
<p align="center"><img src="/images/MegaTinyIDE%20Pinouts.png"></p>MegaTinyIDE's built-in documentation pages include a complete set of pinout diagrams along with the basic specifications for each Chip. Note: this is a work in prograam, so some diagrams may be incomplete (currently, secondary I/O units are not listed), or incorrect.
Fuse Editor
<p align="center"><img src="/images/MegaTinyIDE%20Fuses.png"></p>MegaTinyIDE's built-in Fuse Editor lets you read the current fuse setting from a target device using the UPDI interface, change as needed and then write back the changed values. Note: changing the value of these fuses can alter the behavior of the target in unexpected ways and even "brick" it if you are not careful. Please be sure you consult the appropriate datasheet and know what you are doing before making any changes.
Universal JAR File supports 64-bit Mac, Windows and Linux
The Native code releases of MegaTinyIDE, which include an OpenJDM JVM are recommended (see "Releases" near the top right of this page.) However, I also maintain a pre-built, executable universal JAR file in the out/artifacts/MegaTinyIDE_jar folder. This version is designed to run on 64 bit versions of macOS, Windows 10 and Linux as long as you have Java 8, or later installed on your system.
To use the universal version on a Mac, simply double-click the MegaTinyIDE.jar file to run it once you've downloaded it, although you'll probably have to right-click and select "Open" the first time you run MegaTinyIDE due to the Mac OS X security check and the fact that I'm currently unable to digitally sign the JAR file. You should also be able to double-click and run using Windows, but some versions of Windows may require you to enable this ability first. You'll need to give the .jar file RUN permission to execute on Linux and using a USB-based device programmer, such as the AVRISP MkII, may also require you to create and install a rules file. The needed GNU-based AVR toolchains are built into MegaTinyIDE and the appropriate toolchain will be automatically installed when you run the MegaT
