Skip to the content
PCBKitNew board
2 layers11.5 × 11.6 mmATTinyRTC, the printed circuit board in 3D

ATTiny85 RTC for Mac SE/30 (and possibly others), using universal serial interface (USI) peripheral

Size
11.5 × 11.6 mm
Copper layers
2
Thickness
1.6 mm
Parts
6
Nets
10
Pads
26
Tracks, vias
34, 5
Pours
2
Routed
Yes
KiCad
KiCad 6 (file 20211014)
Created
18 Nov 2022
Updated
4 Mar 2024

Overview

ATTinyRTC is an open-source printed circuit board by pgreenland, from the pgreenland/attinyrtcmodule repository on GitHub, published under the MIT licence. It is a 2-layer board of 11.5 × 11.6 mm with 6 parts on 10 nets, routed with 34 tracks and 5 vias.

It is built around the ATTINY85-20SU. Its parts include 3 capacitors, 1 IC, 1 connector and 1 crystal. It belongs with the interfaces and adapters boards and the AVR (ATmega, ATtiny) boards of this library.

Main components

1

README

README.md

ATTinyRTCModule

This repository contains my attempt at a real-time clock (RTC) replacement, specially for the Mac SE/30, untested (yet should work :-P) on others, using the Microchip ATTiny85.

It's specifically aimed at SE/30's that have suffered damage to their RTC circuitry due to battery leaks.

It therefore doesn't require a battery, storing the PRAM contents in the ATTiny's integrated EEPROM.

It also doesn't require a crystal, using the ATTiny's integrated RC oscillator as its clock source.

It should work (although hasn't been tested) in a mac with a working RTC battery. If desired the EEPROM backup of the settings and time can be disabled via commenting out the definition ENABLE_EEPROM.

An effort has been made to limit the EEPROM writes. With only updates being written, and update only being considered when the RTC is marked as read-only by the host. However it isn't clear how long the EEPROM will last in the ATTiny's using this approach. Time will tell.

It's based on the good work by other folks:

https://www.reddit.com/r/VintageApple/comments/91e5cf/couldnt_find_a_replacement_for_the_rtcpram_chip/ https://pastebin.com/baPZ4nN4 https://github.com/quorten/macsehw/blob/master/firmware/rtc/MacRTC.c

The ATTiny85 was identified previously as a candidate for a drop-in replacement for some of the classic Mac family of RTC chips.

Previous versions of the firmware focused on the Mac Plus, which has a serial clock of between 1 and 20Khz (based on comments in the code).

The Mac SE/30 has a serial clock of 250Khz, requiring a substantial rewrite to get things working.

This version makes use of the universal serial interface module (USI) to ensure the original timing of the Apple RTC is always met.

My original drop-in replacement attempt ATTinyRTC worked but was often a little close to violating the protocol timing. Using the USI module these problems are avoided and the timings exhibited by the original Apple RTC module are met.

See my blog for additional notes on how the software works / its development:

New Timepiece for a Classic Mac - Part 1

New Timepiece for a Classic Mac - Part 2

Hardware

PCB may be ordered from yoru favorite supplier.

The BOM for this project was ordered from RS Components in the UK and consists of the following:

ReferencePartQuantityRS Part No
U1Microchip ATTINY85-20SU, 8bit AVR Microcontroller, ATtiny85, 20MHz, 8 kB Flash, 8-Pin EIAJ SOIC1133-1674
Y1Abracon 16MHz Crystal Unit ±20ppm SMD 4-Pin 3.2 x 2.5 x 0.8mm1171-2803
C1,C2KEMET, 0805 (2012M) 18pF Multilayer Ceramic Capacitor MLCC 50V dc ±5% , SMD C0805C180J5GACTU2648-0935
C3KYOCERA AVX, 0805 (2012M) 100nF Multilayer Ceramic Capacitor MLCC 50V dc ±10% , SMD 08055C104KAT2A1464-6688

Building

  1. Ensure avg-gcc, cmake, make and avrdude are installed.

  2. Build with cmake

    text
    cd software
    mkdir build
    cd build
    cmake ..
    make
  3. Flash

    text
    make upload
    make upload_eeprom
  4. Set fuses

    text
    make fuses

Note

The programmer I'm using is a usbasp programmer, search eBay for USBasp, they all seem pretty much the same. Remember to head over to USBasp to drop them a tip. Alternatively any programmer supported by avrdude can be selected via configuration in the CMake file.

If flashing using the external pins, remember that PB0 and PB1 are swapped (I definately didn't make that mistake).

As part of setting fuses the reset pin is reconfigured as GPIO.

Once this has been done the only way to re-program the chip is by using high voltage programming.

During development, as a workaround I've been re-assigning one of the unused crystal pins to fullfil the role of the PB5, with the help of a small adapter. Thereby allowing standard ICSP programming with no high voltage funny business required.

After the initial programming I found this guide helpful. Using a spare Arduino and minimal components to rewrite the fuses using HV programming, such that the reset pin is again enabled and regular ICSP programming can be performed again.

If resetting fuses using the external pins, note that PB0 and PB1 are swapped as noted above. Also note that PB3 is not accessible via the headers and must be accessed directly on the ATTiny.

Parts

6
QtyValueFootprintReferences
218pCapacitor_SMD:C_0805_2012MetricC1, C2
1100nCapacitor_SMD:C_0805_2012MetricC3
1ATtiny85-20SUATTinyRTC:SOIC-8W_5.3x5.3mm_P1.27mmU1
1Conn_02x04_Counter_ClockwiseATTinyRTC:DIP-8_W7.62mmJ1
1Crystal_GND24Crystal:Crystal_SMD_Abracon_ABM8G-4Pin_3.2x2.5mmY1

Questions

How big is the ATTinyRTC PCB?

It measures 11.5 × 11.6 mm and has 2 copper layers, 1.6 mm thick.

What parts does the ATTinyRTC use?

6 parts, built around the ATTINY85-20SU. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the ATTinyRTC KiCad files?

From the pgreenland/attinyrtcmodule repository on GitHub, at the commit this page was made from: the board is hardware/ATTinyRTC.kicad_pcb and its schematic hardware/ATTinyRTC.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the ATTinyRTC design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).

Similar boards

  • 2 layers65 × 56.5 mmSuperPower RPi KiCAD, the printed circuit board in 3D

    SuperPower RPi KiCAD

    SensorsIot/SuperPower

    Here you should find the best power supplies for your low-power projects

    122 parts600
  • 2 layers18.8 × 8.1 mmDell charger emulator, the printed circuit board in 3D

    Dell charger emulator

    KivApple/dell-charger-emulator

    Emulator of original Dell charger using ATTINY85

    6 parts154
  • 2 layers14 × 17.3 mmSnopf, the printed circuit board in 3D

    Snopf

    snopf/snopf

    snopf USB password token

    18 parts145GPL-2.0
  • 2 layers43.9 × 29 mmC64Saver2-addon, the printed circuit board in 3D

    C64Saver2-addon

    bwack/C64-Saver-bwack

    C64 Saver v1 and v2 - Overvoltage protection for the C64 and its power brick.

    43 parts124
  • 2 layers61 × 36.8 mmKeebcard, the printed circuit board in 3D

    Keebcard

    rsheldiii/Keebcard

    Home of the KeebCard project - Kicad files, code, and more!

    15 parts112
  • 2 layers200 × 100 mmRegalodilara, the printed circuit board in 3D

    Regalodilara

    valerionew/very-good-uc-doggos

    A special graduation present for a special friend. Six microcontrollers in one devboard

    91 parts50
  • 2 layers134.3 × 140 mmAerospace badge, the printed circuit board in 3D

    Aerospace badge

    AerospaceVillage/avBadge_2020

    Aerospace Village Badge 2020

    20 parts28
  • 2 layers50 × 25 mmLoRa Environmental Sensors, the printed circuit board in 3D

    LoRa Environmental Sensors

    spielhuus/LoRa-Environmental-Sensors

    ATtiny85 based LoRa atmospheric sensor board with BME280

    5 parts28