Skip to content
idunmorePublic

About

A collection of breadboard-buildable clocks and clock-generators for retro/homebrew computers (e.g., 6502 and Z80 based builds), using various microcontrollers and SBCs as flexible, feature-rich, multi-frequency sources.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

26 Commits

Folders and files

Repository files navigation

phi2 - Retro/Homebrew Computer Focused Clock Generators

Static Badge License

phi2 is a collection of breadboard-buildable, highly-flexible, clock generators for retro/homebrew computers, using a minimal number of inexpensive and readily available micro-controllers, SBCs and other parts.

Why "phi2"?

This is a reference to the clock input on my favorite early CPU/MPU, the 6502. While 6502-based builds are my current focus, the clock generators here can be used with effectively any CPU/computer build.

Structure of this Repository

A simple mono-repo, with sub-projects on a per-build basis.

Due to the typically resource-constrained nature of the smaller microcontrollers, and significant differences between architectures and, even within a common architecture, different capabilities and pin-outs, shared code is likely to be limited. Thus each project may be considered a self-contained whole, unless otherwise noted. This helps minimize code size and complexity and improves code readability by avoiding the otherwise-necessary multiple levels of conditional compilation that would otherwise be required.

Each individual project will include both hardware build details and diagrams along with ready-to-run firmware/software.

Clock Features

These will vary per-project.

This is the first project in the series.

nano-clock breadboard layout

It has single-step and clock modes, run-stop toggle, selectable frequencies across three bands (Hz, kHz and MHz) in various increments from 1Hz to 8MHz, auto and manual reset functionality (with auto-reset on start option, configurable at run-time), a 14-segment 4-character LED status/info display (in keeping with the "retro" theme) with brightness control and run-time indicators. This is a simple build, using just an Arduino Nano (an inexpensive clone will work fine) and four tactile buttons.

Advanced variations of this will incorporate different display technologies including tiny OLED and TFT color displays, and rich menu/graphical interfaces.

This 2nd, and almost the simplest (just the core capabilities), "phi2" project provides run-time selectable (and saveable) 1MHz, 2MHz, 4MHz and 8MHz clock frequencies, auto-starts when powered on, and offers a compile-time flag to enable/disable auto-reset behavior, and indicates operations using the built-in Arduino LED. It requires only an Arduino Nano (or clone) and a single tactile button, which can be removed once an operating frequency has been selected and saved.

nano-clock-core breadboard layout

nano-clock-core is not much bigger than a standard 4-pin crystal oscillator can.

The third clock build in the "phi2" series, and to date the simplest, departs from the typical "Arduino Board" based model and instead makes direct use of a "raw" microcontroller; in this case the ATtiny85.

tiny-clock breadboard layout

The simplest build is just the ATTiny85 IC itself, an 8-pin DIP part that is smaller than the 4-pin crystal oscillator can in the standard BE6502 setup. Optional, basic components (1 or 2 tactile buttons, and/or 1 resistor and LED), expand the basic clock generator behavior with run-time selectable (and saveable) 1MHz, 2MHz, 4MHz and 8MHz clock frequencies, an LED to indicate clock state/speed, and a single-step clock mode.

Settings can be saved by adding a button temporarily, and then can be removed.

AI Usage

None for these projects, unless noted otherwise.

The goal wasn't to build them quickly, it was to have fun doing so and learn as much about the low-level hardware as possible. That often means hand-optimized coding based on information buried deep in the datasheets for the raw microcontroller cores.

In most cases it also required a fair degree of manual tuning, changing values on the fly while observing output performance across several physical devices on a high-speed oscilloscope. Variations within quoted tolerance are readily visible here.

About

A collection of breadboard-buildable clocks and clock-generators for retro/homebrew computers (e.g., 6502 and Z80 based builds), using various microcontrollers and SBCs as flexible, feature-rich, multi-frequency sources.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages