2025 One-Hertz Challenge: ZX Spectrum Is Now A Z80 Frequency Counter

The ZX Spectrum is perhaps most fondly remembered as a home computer and a games machine. [Tito] has grabbed the faithful black plastic box and turned it into a frequency counter as an innovative entry to our 2025 One Hertz Challenge.

The code was prepared in assembly using ZASM—a Z80 online assembler. It works in quite a simple manner. The code runs for one second at a time, counting rising edges on the EAR port of the ZX Spectrum. Those edges are added up to determine the frequency in question, and the job is done. [Tito] has tested the code and found it’s capable of reading frequencies up to 20 KHz. Since it runs on a one second period, it’s thus eligible for entry by meeting the requirements of the One Hertz Challenge. Code is available on Github for the curious.

The ZX Spectrum has a clock speed of 3.5 MHz, meaning it’s not exactly the tool of choice if you’re reading faster signals. We’ve seen similar done before. In any case, this project was a great way to exercise assembly coding skills and to bust out some classic Speccy hardware—and that’s always a good time. If you’ve got your own retrocomputer hacks brewing up in the lab, don’t hesitate to let us know!

One thought on “2025 One-Hertz Challenge: ZX Spectrum Is Now A Z80 Frequency Counter

  1. I would love to enter the same contest. I am counting to 60 in binary, using the 5 fingers of the left hand and the thumb on my right, and chanting “one mississippi, one mississippi, one mississippi,…”. 60 is 63 (2^6-1) minus 3, so I reach 60 when the 4 most significant bits fingers are up (for one), and the remaining 2 lsb are down (for zero).
    As human error/variance of frequency exists, I propose adding a waterclock to each human clocks available, and using a comunicating vessels system, find out the mean of all water measurements for one minute and build a waterclock to match it. This way we are using the people as “breadboards”, allowing their multipurpose processor to be fully exploited by performing next the task of counting/doing/chanting something of interest until that could be mecanized also.

    Excerpt from “how to (re)build a civilization” chapter, Enyclopedia Galactica, early drafts.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.