The ATtiny85 is a small 8-bit AVR microcontroller. It has 8KB of Flash program memory, 512 bytes of SRAM, and 512 bytes of EEPROM.
|frequency||MCU clock frequency, in hertz. Common values: "1m", "8m", "16m", and "20m"||"8m"|
The code is compiled using the ATtiny Core for Arduino. This means you can use most of the standard Arduino functions and libraries in your code.
You can use the TinyDebug library to print debug messages from your code. These messages appear in Wokwi's Serial Monitor. To use the library, include "TinyDebug.h" in your project, call
Debug.begin() and then print your debug messages using
Similarly, you can use the
Debug object to read input from the Simulator's serial monitor:
For more information about the available methods, check out the Stream class documentation.
Debug interface consumes ~30 bytes of SRAM and 150 bytes of Flash memory, depending on which methods you use in your code. This can sometimes be an issue, since the ATtiny85 only has 512 bytes of SRAM.
That's why TinyDebug also provides an alternative, lightweight logging interface that doesn't use any SRAM. It provides two functions,
tdPrintln(). The downside is that you can only print c-style (
The TinyDebug library works out of the box in Wokwi, without any changes to your diagram. It uses an internal debug interface that is part of the Wokwi simulation engine, and does not use any MCU pins.
You can safely run code that uses TinyDebug on a physical ATtiny85 chip. The physical chip doesn't have the debug interface, so you obviously won't see the debugging messages, but other than that it shouldn't interfere with your code.
For a complete code example, check out the TinyDebug demo project on Wokwi.
The ATtiny85 doesn't have a dedicated UART peripheral, but it it still possible to get Serial Output using the Software Serial library. For more information and demo code, please see the Serial Monitor Guide.
For I2C communication use the TinyWireM library.
The ATtiny85 is simulated using the AVR8js Library. The table below summarizes the status of features:
|GPIO||✔️||6 GPIO pins (PB0...PB6), INT0 / PCINT support|
|USI||🟡||Only works in I2C mode|
|Timer0||✔️||PWM support for PB0/PB1|
|ADC||✔️||Used by analogRead()|
|GDB Debugging||✔️||See the GDB Debugging Guide|
🟡 Partial support
❌ Not implemented