A complete starter solution for ATtiny85 based hardware projects. This project is released under a Creative Commons Attribution-ShareAlike 4.0 International License.
The project provides the following features:
- Schematics (in Fritzing format) for two variations of an ATtiny85 breakout board for rapid development. See this post for more information.
- Hex files and support tools for the Microboot bootloader.
- A library of support functions for the ATtiny providing features suchs as single pin serial communications, 'printf()' like formatted serial output, helper functions for digital and analog pin control as well as a collection of useful support functions for common embedded tasks.
- A Makefile configured to use an installation of avr-gcc to compile, link and flash your application.
The project contains three top level directories, the 'firmware' directory contains the Makefile and the source for the support library, the 'hardware' directory contains the Fritzing project files for the breakout boards and the software directory is reserved for any desktop software that forms part of your project.
To set up the template for your own project after cloning you simply need to edit the Makefile in the 'firmware' directory to set your preferred target file name. For simple projects all you need to do is modify the code in 'main.c', if your project requires additional sources you need to add them to the SOURCES definition in the Makefile.
Some common usage patterns are:
# Do a clean build
make clean; make
# Do a debug build (set DEBUG for source files and enables PRINTF(),
# PRINT() debug output functions)
make DEBUG=true
# Flash the code to the chip (by default uses Microboot tools and expects the
# device to be on /dev/ttyUSB0 - change the Makefile for different behaviour)
make flash
The support library is an ongoing project and not all functionality is implemented and tested yet. In some cases planned functionality has been added to the header files but is not yet implemented. The current status is:
Feature | Implemented | Tested |
---|---|---|
1 Pin Serial | Yes | Yes |
Formatted Output | Yes | Yes |
Digital IO | Mostly | No |
Analog IO | Yes | Yes |
PWM Control | No | No |
Software SPI | Yes | No |
This table will be updated to reflect changes in the implementation and testing status of the features. Check back to see if what you are looking for has become available.