Arduino can be used to program ATTiny 45/85. In order to get any debug messages from ATTiny you can use Arduino UNO also as a serial monitor. “Coding Badly” did an excellent job to create a communication bridge between Arduino and ATTiny. Software serial and his Knock-Bang protocol are supported. The usage of the Knock Bang protocol is described here.
Prepare the Arduino
- Download TinyISP https://github.com/Coding-Badly/TinyISP/
- Copy the extracted folder to Arduino sketch folder
- Start Arduino (Software). Click File -> Sketchbook -> TinyISP
- Switch to “_TinyISP_BuildOptions” (Tab)
- Add the line “#define RELAY_KNOCK_BANG_ENABLED 1” before “#endif”
- Switch to “TinyISP” (Tab). Make sure to have selected the Arduino UNO board and upload the sketch.
- To test the monitor:
- Open “Serial Monitor”, ensure baud rate 19200 is set
- Enter “!” to start/stop monitoring
Install Knock-Bang library
- Download Kock-Bang library from https://github.com/Coding-Badly/TinyDebugKnockBang
- Copy the extracted folder to Arduino sketchbook library folder
- Start Arduino (Software).
Test ATTiny Arduino communication
Select ATTiny 45/85 board and upload the following test to your ATTiny.
#include <TinyDebugKnockBang.h> void setup( void ) { Debug.begin( 250000 ); } void loop( void ) { Debug.println( F( "Hello G! " ) ); delay( 1000 ); }
Open Serial Monitor and enter “!”. You should see “Hello G!”