ATTiny10IDE
A Streamlined IDE for Coding and Programming the ATtiny10 and other ATTiny Devices
Install / Use
/learn @wholder/ATTiny10IDEREADME
Update: As of July 29, 2020, In order to support the 64 bit-only Catalina release of macOs, I have revised the code to use thinned versions of Microchip's 64 bit GNU Toolchains rather than using 32 bit GNU toolchains extracted from the Arduino project.
Update: As of Dec 16, 2020 - I have revised the toolchain loader code to fix some GNU compile errors.
ATTiny10IDE (for 64 bit macOS, Windows & Linux)
ATTiny10IDE is a simple, GNU-based IDE I originally wrote to simplify writing code for the ATTiny10 Series Microcontrollers using C. C++ or Assembly language. This new version is a greatly expanded and updated version I started working on in 2014. See this article for some additional details on how this project started. For this new release, I've added support for the ATTiny25/45/85 and ATTiny24/44/84 series of microcontrollers, as well support for programming them using an ICSP Programmer. And, there's also an experimental feature for automatic generation of function prototypes.
If you just want to try out the program, you don't need to download and compile the source code, as I maintain a pre-built, executable JAR file in the out/artifacts/ATTiny10IDE_jar folder from which you can download and run ATTiny10IDE as long as you have Java installed on your system. On a Mac, simply double click the ATTiny10IDE.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 ATTiny10IDE 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 an install a rules file.
Recent Updates
- Now using thinned versions of Microchip's 64 bit GNU Toolchains
- Reorganized Action menu and added Target menu
- Switched TinyX5 and TinyX4 cores and libs to ATTinyCore by Spence Konde
- Now uses .d files to determine dependencies for included library files
- New Programmer selection dialog replaces menu-based selection and configuration
- Fixed a regression that prevented Windows version from working properly
- Fixed linker command so passing string literals as parameters now works (long-standing bug)
- Added ability to save HEX file and LST file
Help Requested
So far this is just a one man project and I struggle at times to do adequate testing, especially on Windows and Linux, when I release a nw version. So, if anyone spots a problem, or has a question or a sugegstion, please post an issue so I can investigate. You can also email me at questions4wayne at gmail dot com.
Requirements
I suggest using Java 8 JRE or JDK, or later for ATTiny10IDE, but the code also seems to run under the OpenJDK Java on Linux. Note: I wrote ATTiny10IDE on a Mac Pro using the Community version of IntelliJ IDEA from JetBrains and OS X is the only environment where I have extensively tested and used ATTiny10IDE . I've included GNU/AVR toolchains for Mac and 64 bit Windows and 64 bit Linux, but have not extensively tested the code under Windows or Linux. Feel free to report any issues you discover. I'll do my best, when time permits, to investigate them, but I cannot guarantee fixes, timely or otherwise.
Using ATTiny10IDE
ATTiny10IDE supports coding for the ATTiny10 Series of Microcontrollers in C and C++ using the GNU AVR-C++ compiler to generate code. In addition, ATTiny10IDE supports two ways to write and assemble code the ATTiny10. One method uses the GNU AVR-AS assembler using a non Atmel-type syntax. The other uses a homebrew assembler I wrote that supports an Atmel-like syntax. The file extension you choose for your code file tells ATTiny10IDE how to process the code:
.c - Compile as C file using avr-gcc
.cpp - Compile as C++ file using avr-g++
.s - Assemble using avr-as and link with avr-ld
.asm - Assemble with my homebrew assembler (Note: only supports the ATTiny10)
So, this means you'll have to save your source file with the appropriate extension before you can compile, or assemble it. In addition, you can also write inline assembly code in a C/C++ (.c) file. You'll find examples of these different approaches to writing code in the examples folder.
Programming ATTiny10 Chips
ATTiny10IDE supports several different ways to program your compiled code into an ATTiny10 chip. One is to build and use the Arduino-based, High Voltage programmer/emulator I designed for the original version of my IDE. However, ATTiny10IDE also now supports a way to generate an Arduino Sketch (program) which, when run, can directly program an ATTiny10 chip using only Arduino I/O lines 2 - 6, like this:
<p align="center"><img src="/images/TPI-Prog-Socket.png"></p>Here are the steps you can follow to program an ATTiny10 using this method:
- Use "
File->Open" to load the source file, or type your code into the "Source Code" pane and save it using the appropriate file extension. - Select "
Actions->Build" to compile. or assemble the code. - Select "
Actions->Generate Arduino Programmer Code" and save to a .ino (Arduino Sketch) file when prompted. - Quit ATTiny10IDE so it does not interfere with the Arduino IDE's access to the Arduino's serial port.
- Load the file you generated into the Arduino (it will prompt you to create a folder for this file. Choose Yes.)
- Program the Sketch into the Arduino using the "Upload" Button.
- Open the "Serial Monitor" window in the Arduino IDE (upper right button) and set the baud rate to 115200.
- Follow the istructions the Sketch prints to connect the Arduino to the ATTiny10.
- Verify the ATTiny10 is properly connected by using the Identify ATtiny10 command by typing '
I' and pressing "Send". - If Identify ATtiny10 responds with "Device: ATtiny10", you are clear to program the ATtiny10 by typing '
P' and pressing "Send"
You can use this Sketch to program as many ATTiny10s as needed, but you can also use it as a general-purpose ATTiny10 programmer to upload and program other code, like this:
- First "Quit" the Arduino IDE so ATTiny10IDE will have access to the Serial Port on the Arduino running the Sketch.
- Start ATTiny10IDE and use "
Settings->Programmer" to open the Programmer dialog and select the "Arduino TPI" option. - Open, or write the source code you want to compile and program into the ATtiny10.
- Select "
Actions->Build" to compile. or assemble the code. - Connect the Arduino to the ATTiny10 using the same connections shown above.
- Select "
Actions->Read Device Signature" to verify the ATTiny10 is properly connected. - Select "
Actions->Program Flash and Fuse(s)" to upload and program the code into the ATtiny10.
I've also created a small, inexpensive PCB that implements the wiring shown in the above photo. You can order it from OSH Park, for $1.10 for three copies of the PCB. Note: I don't receive anything from OSH Park for offering this. I do it just to make it a bit easier for you to program ATTiny10 chips using ATTiny10IDE. In the following photo, the ATTiny10 is soldered to an SOT-23-6 to DIP 6 adapter PCB. This kind of SMD to DIP adapter is widely available from many sources, or you can order 3 copies of a SOT-23-6 to DIP 6 adapter I designed from OSH Park. To complete the first adapter PCB you'll need two, 3 pin, .1 inch spacing female headers, which serve as a socket for the SOT-23-6 to DIP adapter PCB, and a 5 pin strip of .1 inch spacing male headers, which you can snap off from a 40 pin, .1 inch breakaway header strip. You also need two, 3 pin strips of the male header for the SOT-23-6 adapter PCB, too.
<p align="center"><img src="/images/OSH%20Park%20Adapter.jpg" width="600" height="458"></p>To use the programming adpater, simply plug it in to data pins 2 through 6 on the Arduino and then plug the SOT-23-6 to DIP adapter into the female headers on the programming adapter PCB being careful to align pin 1 to pin one on both boards. Once programmed, the SOT-23-6 to DIP adapter makes it easy to plug it into a breadboarded circuit to test your code.
Include Arduino.h to code "sketches" in ATTiny10IDE
When coding in C or C++, ATTiny10IDE expects you to put your code in a function named main() and handle all the details of using the low-level ATTiny10 architecture which involves ading and writi
