Board

ATtiny85 simulator, the chip in the breadboard

Mokxi models the ATtiny85 as what it is: a bare eight-pin chip that pushes into the breadboard across the center channel. Six I/O pins, timer 0 and the high-speed timer 1, a four-channel ADC, the USI, INT0 and the pin-change interrupt, 512 bytes of SRAM and 8 KB of flash, on the internal 8 MHz oscillator. Wire the supply yourself, because nothing else will.

Start building free
  • 7peripheral areas modeled
  • 3projects ready to run
  • Real timeon your own machine
ATtiny85: blinklive0.000 s 0.00x
Click to open it in the editor
The board is running real firmware right now. Click it to open the circuit in the editor.
The model

What is modeled

Taken from the board's own contract document and put in plain words, with what is missing beside it.

Modeled

Core
The tinyAVR instruction set, with the datasheet cycle count of every instruction. No MUL, no JMP, no CALL: this part has none of them, and reaching for one is an illegal opcode here as it is on silicon
Port B
PB0 to PB4 with the internal pull-ups, and PB5 held as the reset pin
Timer 0
All four waveform modes, including hardware PWM on PB0 and PB1
Timer 1
The high-speed timer: OCR1C as TOP, a fourteen-entry prescaler, and complementary outputs on two pairs of pins
ADC
Four channels with the 1.1 V and 2.56 V references, measured against the supply the chip is actually on
USI
The shift register, the four-bit counter and the datasheet clock table, three-wire mode driving DO
Interrupts, EEPROM and sleep
INT0 on PB2, the pin-change interrupt on every pin, 512 bytes of EEPROM, and SLEEP that really does park the core

Not modeled

  • The 64 MHz PLL. PLLCSR reports a lock so firmware that waits for one gets going, but timer 1 keeps counting at the system clock.
  • The analog comparator, the clock prescaler and the differential ADC channels with their gain stages.
  • The USI in two-wire mode as a bus driver: it counts, shifts and reports start and stop conditions, but it does not drive SDA.
  • The ATtiny25 and ATtiny45, which are the same part with less memory, and the ATtiny84 and friends, which are not.
Start here

Open one and press Run

Each of these opens in the editor exactly as it is drawn here.

Projects

Every built-in project on the ATtiny85

Each has its own page with the circuit running, the code and a parts list.

Libraries

Arduino libraries that compile as they are

Paste a tutorial that includes one of these and it builds. For any other library, the build names the Mokxi header that does the same job.

Servo.h
attach, write, writeMicroseconds, read, detach, on any pin
Wire.h
I2C as a master; Wire.begin() puts it on PB0 (SDA) and PB2 (SCL)
SPI.h
transfer and transactions, on the board’s usual SPI pins
EEPROM.h
read, write, update, get, put and EEPROM[i], kept in the chip’s own 512 bytes of EEPROM
LiquidCrystal_I2C.h
the 16x2 LCD behind its I2C backpack
Adafruit_NeoPixel.h
WS2812 strips and panels
DHT.h
the DHT11 and DHT22; one reading printed fits, but the whole heat-index tutorial is bigger than the 8 KB of flash
Bounce2.h
debounced buttons: update, pressed, released, fell, rose and how long a state lasted

And 1 more, 9 in all: HX711.h.

Learn

Tutorials that use this board

Each one ends in a running circuit, on this same board.

Questions

Is it free?

Yes. Every board and every part is on the free plan, with no account needed.

Why does it need a supply wired when the other boards do not?

Because it is a chip, not a board. There is no regulator and no USB socket on an ATtiny85: pin 8 wants 5 V and pin 4 wants ground, and until they have them nothing runs. That is also why it works on 3.3 V: wire it to 3.3 V and its logic levels and its ADC reference move with it.

How does the serial monitor work with no USART?

The chip bit-bangs 8N1 on PB3 and PB4, and Mokxi watches those two pins the way a USB-serial adapter clipped to them would. Printing costs real time: about a millisecond a byte at 9600 baud, exactly as it does on the bench.

Will my sketch run on a real ATtiny85?

Yes. Every register is at its datasheet address and the firmware runtime is ours rather than the Arduino core, so a build from here runs on a real part with the CKDIV8 fuse unprogrammed.

Which ATtiny?

The ATtiny85, in the 8-pin DIP package.

Try it on your own firmware

What you build here runs on the board on your desk, unchanged. Nothing to install and no account needed.