Electronics Tinkerer
Projects 'N Stuff

The "Squrill" Computer

Last Updated: 2023-06-02 Squrill? Squirll? Squrillel??? (All names found in the source code) Apparently, 9th grade me did't know how to spell "Squirrel"

Background

The Squrill computer is a 65C02-based system running at 2MHz with 32K ram, 8K ROM, one 65C22 VIA, and one 65C51 ACIA, all built into a slightly-smaller-than-typical ATX power supply case. The system was designed to be an "always-on" general purpose bench machine that could be remotely logged into over telnet to control various bench experiments or just act as an automatic plant waterer. It represents my first attempt at designing a PCB that was to be manufactured. (There are some relay logic boards that I did in middle school using Robot Room's software, but there was no change those were going to be manufactured.) As things go, the largest board I could order and still have it resonablly affordable was a whopping 100x80mm with two copper layers. The result of this combination eventually lead to trying out the Eagle auto router (oh boy...) It was unable to complete the board but with some tweaking, I managed to get all the signals into the space. At the time, I barely knew how timing worked (despite having completed the HackBrick Pro computer the previous year) and as a result, the computer unsurprisingly did not work. Among other issues, the data bus going to one of the chips was flipped and there tons of silk errors. A few years went by and I pulled the system back off the shelf and patched in a quad NOR gate on top of the 32k ram IC to correct the address decode logic. After this, the system was stable enough for some software development. The kernel is based on the Apple 1 Woz Monitor, as many of my early systems were. This one was modified to support ring buffers on the input and output for the ACIA to support interrupt-driven IO. It also added a few features such as listing a help menu and "write protecting" the monitor's memory area. Since the goal was to use the ESP module as an internet interface, the send/receive routines were modified to output the AT command set expected by the module. This works fairly well but does not handle error conditions well (usually requiring a hard reset). This worked well enough to do some basic things like manually writing to memory through the monitor and controlling the VIA's timers. The system was still incredibly unstable and would crash randomly. Onto the shelf it went again. Fast forward to Sophomore year of college, the course Statistical for Experimenters needed us to design an experiment and collect data to compare how different independent variables affected some dependent variable. After deciding that oatmeal viscosity was too hard to measure, I decided on testing out different parameters in electrical generator design. To do this, I needed a way to control a motor's speed when loaded. Seeing as I had a few Arduinos and the like, the obvious choice was to pull out the squrill again and use it :) The first task was to fix the stability issues, which were quickly resolved by the realization that the board had almost no power supply bypassing capacitors. Adding one across each chip significantly increased the stability to the point where the system could run for over an hour without problems. From there, I bumped the original 1MHz clock to 2MHz and increased the maximum length of the input line buffer, allowing a small python script to do over-the-air program uploads to the system. The speed control system consisted of a black and white banded paper wrapped around the motor's shaft with a photo diode and a lamp to generate pulses. These were fed into the VIA's counter which was also running a timer interrupt. This allowed the motor's speed to be adjusted. The timer interrupt also doubled as the PWM frequency which allowed the CPU to bit bang a stable PWM throught the a VIA IO pin. Overall, the system worked OK but I eventually switched to an Arduino to make code development faster. The serial port has two SPDT switches on board to allow swapping of the TX/RX lines in case a cross-over configuration is needed. Also, the power supply has a small thermistor mounted on it along with a realy to turn on the fan when the temperature gets high.

Software development

At the time I developed the system, I was still using DASM as my primary assembler. Since I was running the 65C02 varient of the processor, I wanted to make use of some of the new opcodes. This lead to the tangent of modifying DASM to support the new opcodes, which eventually got merged into the main branch (woo).

Photos!

Outside of PSU case. Right: IO connectors for parallel port and serial port. Top view of computer with lid removed. The system fan is to the left, the PCB is mounted in the center and the power supply takes up the remaining space on the right side. A side profile view of the computer, showing the angled mounting brack for the PCB. Another side view of the computer, showing the IO cables wrapped under the board.
That's all!
© 2021-2024 — Electronics Tinkerer — All rights reserved.
Top | Home | Privacy | Terms of Service