All paths

Tiny chips: ATtiny85 and CH32V003

The eight-pin ATtiny85 and the ten-cent CH32V003 RISC-V: six pins and their fuses, an 8 KB budget with no multiplier, sleep and the watchdog for coin-cell life, I2C bit-banged by hand, a race between the two chips, and a twinkling star ornament.

ATtiny85Free7 lessons6 h3 chapters1,595 XPEmbedded engineering · Intermediate+150 XP

0 of 7 done

What you will build

2 projects, built step by step

7 lessons in 3 chapters, about 6 hours on a simulated ATtiny85. Free, in your browser, every step checked by the simulator.

Chapter 1 project

8 KB budgets

Flash, SRAM and time on a chip with no multiplier: a temperature conversion in fixed point fits in 3.4 KB and runs 100 times in 144 microseconds; the same in floating point needs 7.3 KB and 1872 microseconds.

Open it in the simulator
Chapter 2 project

RISC-V for cents

The ten-cent CH32V003, a 32-bit RISC-V at 48 MHz, races the ATtiny85 on the same CRC-32: 6.4 ms against 131 ms, the same answer, and what 32 bits and six times the clock buy you.

Open it in the simulator
The map

Chapter by chapter

Each lesson opens when the one before it is done, and each chapter ends in a project.

Chapter 1

Life in eight pins

Why tiny, which pin does what, and what fits in 8 KB.

  1. Open156 XP

    Why tiny

    An eight-pin ATtiny85 on a coin cell’s 3 V: six I/O pins, 8 KB of flash, 512 bytes of SRAM, 8 MHz from its own oscillator, a serial port it makes itself, and two lamps blinking for about a dollar.

    0 of 4 steps

  2. Locked187 XP

    Pins and fuses

    Six pins doing four jobs: a knob on the ADC, two PWM lamps, a button on the pin-change interrupt and a software serial port, plus the fuses that set the clock and can turn the RESET pin into a seventh.

    0 of 5 steps

  3. ProjectLocked312 XP

    8 KB budgets

    Flash, SRAM and time on a chip with no multiplier: a temperature conversion in fixed point fits in 3.4 KB and runs 100 times in 144 microseconds; the same in floating point needs 7.3 KB and 1872 microseconds.

    0 of 4 steps

4 questions, graded as you go.
Chapter 2

Tiny chip skills

Sleep for battery life, I2C by hand, and the RISC-V alternative.

  1. Locked205 XP

    Sleep and wake

    A coin cell lasts as long as the chip sleeps: the watchdog wakes the ATtiny85 every half second to flash a lamp, the button wakes it at once, and the datasheet’s currents say 63 days, or 669 at eight seconds.

    0 of 5 steps

  2. Locked187 XP

    Bit-banged I2C

    I2C by hand on two ordinary pins: open drain by switching the pin direction, a START and a STOP, eight bits and an ACK, a scan that finds a PCF8574 at 0x20, and a byte written to its pins and read back.

    0 of 5 steps

  3. ProjectLocked312 XP

    RISC-V for cents

    The ten-cent CH32V003, a 32-bit RISC-V at 48 MHz, races the ATtiny85 on the same CRC-32: 6.4 ms against 131 ms, the same answer, and what 32 bits and six times the clock buy you.

    0 of 4 steps

4 questions, graded as you go.
Chapter 3

Boss project

A coin-cell star ornament that twinkles and sleeps.

  1. Locked236 XP

    Boss: a coin-cell star ornament

    A twinkling star ornament on an ATtiny85: two lamps twinkle at random in PWM, the button steps through twinkle, steady and off, and off is a deep sleep that only the button ends, with the battery sums from the datasheet.

    0 of 6 steps

3 questions, graded as you go.
Syllabus

Every lesson in the course

All 7 lessons, in order, each with what it covers. Any of them opens in the editor right away.

Chapter 1

Life in eight pins

  1. Why tinyAn eight-pin ATtiny85 on a coin cell’s 3 V: six I/O pins, 8 KB of flash, 512 bytes of SRAM, 8 MHz from its own oscillator, a serial port it makes itself, and two lamps blinking for about a dollar.
  2. Pins and fusesSix pins doing four jobs: a knob on the ADC, two PWM lamps, a button on the pin-change interrupt and a software serial port, plus the fuses that set the clock and can turn the RESET pin into a seventh.
  3. 8 KB budgetsFlash, SRAM and time on a chip with no multiplier: a temperature conversion in fixed point fits in 3.4 KB and runs 100 times in 144 microseconds; the same in floating point needs 7.3 KB and 1872 microseconds.
Chapter 2

Tiny chip skills

  1. Sleep and wakeA coin cell lasts as long as the chip sleeps: the watchdog wakes the ATtiny85 every half second to flash a lamp, the button wakes it at once, and the datasheet’s currents say 63 days, or 669 at eight seconds.
  2. Bit-banged I2CI2C by hand on two ordinary pins: open drain by switching the pin direction, a START and a STOP, eight bits and an ACK, a scan that finds a PCF8574 at 0x20, and a byte written to its pins and read back.
  3. RISC-V for centsThe ten-cent CH32V003, a 32-bit RISC-V at 48 MHz, races the ATtiny85 on the same CRC-32: 6.4 ms against 131 ms, the same answer, and what 32 bits and six times the clock buy you.
Chapter 3

Boss project

  1. Boss: a coin-cell star ornamentA twinkling star ornament on an ATtiny85: two lamps twinkle at random in PWM, the button steps through twinkle, steady and off, and off is a deep sleep that only the button ends, with the battery sums from the datasheet.
Kits

Build it on your bench too

Every lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.

Have a kit already?

Find your kit

Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.

See every kit
Questions

About Tiny chips: ATtiny85 and CH32V003

Is Tiny chips: ATtiny85 and CH32V003 free?

Yes. All 7 lessons of Tiny chips: ATtiny85 and CH32V003 are free and run in your browser, with nothing to install and no parts to buy before you start.

Do I need a real ATtiny85?

No. Every lesson runs on a simulated ATtiny85 with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.

How long does Tiny chips: ATtiny85 and CH32V003 take?

About 6 hours: 7 lessons in 3 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.

What will I build?

Each chapter ends in a project that puts it together: 8 KB budgets and RISC-V for cents.

Where do I start?

With "Why tiny", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.