A basic program for attiny 85 to demonstrate Aurduino-less development for this tiny board with processor.
SoC Atmel 1705 TINY85 20SU is:
- AVR based 8-bit microprocessor
- 8KB of flash memory
- 512 B SRAM
- 6 GPIO (HW PWM, AD converter)
- Complete TINY85 datasheet
- Opensource PCB layout
- With micro USB
- 5V stabilization
- 6 Breakout GPIO pins
- 3 power in/out pins
- TINY85's flash is preloaded with bootloader Micronucleus that makes it possible to laod main program via USB
1. USB drivers: Digistump.Drivers.zip
NOTE: Find the latest release at https://github.com/digistump/DigistumpArduino/releases/
Troubleshooting: Digispark ATtiny85 Download and install
-
GCC-AVR toolchain opensource 11.1.0 x64 win
-
NOTE: find the most up to date compilers at https://blog.zakkemble.net/avr-gcc-builds/
- unzip to dedicated folder somwhere where you store your compilers
- You will need to reference this folder multiple times in your project
-
-
GCC-AVR toolchain from microchip (registration needed)
-
NOTE: find the most up to date compilers at https://www.microchip.com/en-us/tools-resources/develop/microchip-studio/gcc-compilers
-
3. AVR DUDE
- A tool for uploading and downloading compiled binary to TINY85 microchip
NOTE: ISP = in-system programming; a technique to upload your code
TODO Do I really need it since micronucleus provides executable to handle the upload?
4. Micronucleus
an USB emaulating bootloader that has a counterpart on PC operating system allowing you to upload your program.
A good article for understanding the nucleus & Tiny85 flash life cycle
- Download micronucleus-cli-master-882e7b4a-x86_64-MINGW64_NT-10.0-17763.zip
-
NOTE: latest releases
- unzip it like you did with AVR-GCC somwhere comfortable for you to reference it within Your project
5. CMAKE
https://github.com/adigie/stm32-cmake-template/blob/example_l053/CMakeLists.txt
In root of this project execute to materialize cmake project ad have it ready for build
cmake -G Ninja -B ./build/
https://github.com/ninja-build/ninja/releases
Ninja is a replacement of Makefile.
In order to compile this project simply go to folder build and write ninja
cd build
ninja
Arduino Files - including linker script needed fro our chip/board
micronucleus --run build\src\CimaAttiny85.hex
Pretty nice article (https://www.iot-experiments.com/micronucleus-bootloader-upgrade/) gives a good description of how to upgrade your Digispark to the latest version.
-
Download latest HEX representation of the micronucleus firmware e.g. upgrade-t85_default.hex
-
Unplug device
-
Run
micronucleus.exe --run upgrade-t85_default.hex
-
Plug in your device
-
Upgrade tkaes a moment
NOTE: USB in windows will constntly detect plug-in and plug-off, this can be eliminated
- Unplugging the device
micronucleus.exe --erase-only
- plug in the device
-
Done!
- https://gist.github.com/Ircama/22707e938e9c8f169d9fe187797a2a2c
- https://blog.podkalicki.com/how-to-compile-and-burn-the-code-to-avr-chip-on-linuxmacosxwindows/
- https://blog.laskarduino.cz/zaciname-s-attiny85-digispark/
- ATtiny85: Introduction to Pin Change and Timer Interrupts -- tutorial to input pins and timer interrupts with extensive documentation
- ATtiny85: Blinking Without Clock Cycles -- utilization of timer built in operations (toggle port)
- Digispark wiring diagram