LittleFS: The Emphasis Is On Little

It used to be that developing for microcontrollers was relatively relaxing. These days, even a cheap micro like the Raspberry Pi Pico has multiple cores, networking (for the W, at least), and file systems. Just like desktop computers. Sort of. I found out about the “sort of” part a few weeks ago when I decided to embark on a little historical project. I wanted a file system with a large file that emulates a disk drive. The Pico supports LittleFS, and I figured that would be the easy thing to do. Turns out the Little in LittleFS might be more literal than you think. On the plus side, I did manage to get things working, but it took a… well — dare I say hack? — to make it all work.

History

I’m an unabashed fan of the RCA 1802 CPU, which is, of course, distinctly retro. The problem is, I keep losing my old computers to moves, natural disasters, and whatnot. I’ve had several machines over the years, but they seem to be a favorite target of Murphy’s law for me. I do currently have a small piece of hardware called an Elf Membership Card (by [Lee Hart]), but it lacks fancy features like disk drives, and while it could be expanded, there’s something charming about its current small size. So that led me to repurpose a 6502 emulator for the KIM-1 to act like an 1802 instead. This is even less capable than the membership card, so it was sort of a toy. But I always thought I should upgrade the Arduino inside the emulator to a processor with more memory, and that’s what I did.

I started out with a Blackpill STM32F board and called the project 1802Black. The code is a little messy since it started out as [Oscar’s] KimUNO code, and then my updates layered with new updates. Also, for now, I shut off the hardware parts so it won’t use the KimUNO hardware — you only need a Blackpill (or a Pico, see below) and nothing else, although I may reenable the hardware integration later.

It wasn’t that hard to get it running with just more memory. Still, I wanted to run [Mike Riley’s] Elf/OS operating system and I also had a pair of Raspberry Pi Picos mocking me for not using them in a project yet. The chip has excellent Arduino board support. But what sealed the deal was noticing that you can partition the Pico’s flash drive to use some of it for your program and the rest for a file system. You can get other RP2040 dev boards with 16 MB of flash, which would let me have a nearly 15 MB “hard drive,” which would have been huge in the 1802’s day. Sounds simple. If it were, though, we wouldn’t be talking.

Continue reading “LittleFS: The Emphasis Is On Little”

Old Style 1802 Computer Has MMU

When you think of an MMU — a memory management unit — you probably think of a modern 32-bit computer. But [Jeff Truck] has a surprise. His new RCA 1802 computer has bank switching, allowing the plucky little processor to address 256K of RAM. This isn’t just the usual bank-switching design, either.

The machine has several unique features. For example, an Arduino onboard can control the CPU so that you can remotely control the bus. It does not, apparently, stand in for any of the microprocessor support chips. It also doesn’t add additional memory or control its access.

The 256K of memory is under the control of the MMU board. This board generates two extra address bits by snooping the executing instruction and figures out what register is involved in any memory access. Memory in the MMU stores a table that lets you set different memory pages for each register. This works even if the register is not explicit and also for the machine’s DMA and instruction fetch cycles. If you know about the RCA “standard call and return technique,” which also needed a little patching for the MMU. [Jeff] covers that at the end of the video below.

This is a very simple version of a modern MMU and is an impressive trick for a 50-something-year-old CPU. We were surprised to hear — no offense to [Jeff] — that the design worked the first time. Impressive! There’s also some 3D printing and other tips to pick up along the way. But we were super impressed with the MMU. You might never have to do this yourself (although you could), but you can still marvel that it can be done at all.

We have a soft spot for the 1802s, real or emulated. The original ELF was great, but 256K is a lot better than the original 256 bytes!

Continue reading “Old Style 1802 Computer Has MMU”

New Zealand’s First Microcomputer May Be This 1802

Hardware hackers of a certain age likely got started with microcontrollers via the RCA 1802 — a relatively easy-to-use processor that was the subject of several excellent articles in Popular Electronics magazine back in the late 1970s. [Al’s Geek Lab] has an interview with [Hugh Anderson], who saw the articles and eventually designed the HUG1802, which may be the first microcontroller kit designed and sold in New Zealand.

The 1802 was very attractive at the time since it was inexpensive, static, didn’t require exotic voltages, and had a DMA system that allowed you to load software without complex ROMs. He initially marketed a kit unsuccessfully until an Australian company convinced him to create a proper PC board — the resulting kit was sold to about 100 customers.

The HUG1802 reminded us somewhat of the Quest Super Elf since it had a keypad, a cassette interface, and even a TV output. The 1802 had a DMA-enabled chip that made crude memory-mapped video output. The computer eventually morphed into the ETI 660, which they talk about at the end of the interview.

A lot of people built 1802 computers back in those days. If you don’t have an 1802, but you have an Arduino… ell, there’s always emulation.

Continue reading “New Zealand’s First Microcomputer May Be This 1802”

Mystery 1802 Computer Was A Homebrew Project

[CelGenStudios] has an impressive collection of vintage hardware. One that really struck us came from a thrift store in Canada, so the original provenance of it is unknown. It looks like someone’s handmade interpretation of a SOL-20. There’s a wooden and sheet metal box containing a keyboard looted from an old dedicated word processor (back when a word processor was a machine, not a piece of software). Inside? Some vintage-looking hand-drawn PC boards, including a backplane with two boards. One contains an RCA 1802 and a little bit of memory. There’s also a video card with more memory on it than the CPU.

We loved the 1802, and we disagree with [CelGenStudios] that it “wasn’t that popular.” It was super popular in some areas. The CMOS processor was popular in spacecraft and among homebrew builders. There were a few reasons for that. Unlike some early CPUs, you didn’t need much to bootstrap a system. It would run on 5V and had a “DMA” mode to key data in with just a few simple switches and buttons. You didn’t need a ROM-based monitor to get the system to work. In addition, the design could be low power, and the static design meant you could slow or stop the clock for very low power compared to many other systems of the day.

Continue reading “Mystery 1802 Computer Was A Homebrew Project”

Queen Victoria’s Secret (Teletype And COSMAC Elf)

We don’t really think anyone in the Victorian era had a COSMAC Elf — the homebrew computer based around the RCA 1802 CPU. But if they did, it might have looked like [Daniel Ross’] steampunk recreation of the system that includes an appropriate-looking teletype device. You can see the thing in a series of videos, below. There are actually quite a few videos showing different parts of the system, along with several blog postings stretching back a few months.

A magic eye tube doesn’t look out of place in this build. We especially liked the glass tube displays and the speaker, although we thought the USS Enterprise looked out of place with the technology based on stone knives and bearskins, to paraphrase Mr. Spock. On the plus side, the VFD displays have the right glowing look, although a Nixie would have been pretty good there, too.

The videos don’t have much detail, but the blog posts do if you wanted to attempt something similar. Honestly, 1802 system design is pretty easy thanks to the its on-chip DMA that allows you to load memory from switches with no actual software like a monitor. The teletype started out life as a Remington #7 from around 1900, although another newer machine donated parts to get everything working. It is a testament to how well things were built then that it took as much abuse as it did and still has working parts.

We have a soft spot for the 1802 — it was a very good design for its time. We’ve even gone as far as to simulate it.

Continue reading “Queen Victoria’s Secret (Teletype And COSMAC Elf)”

Universal Chip Analyzer: Test Old CPUs In Seconds

Collecting old CPUs and firing them up again is all the rage these days, but how do you know if they will work? For many of these ICs, which ceased production decades ago, sorting the good stuff from the defective and counterfeit is a minefield.

Testing old chips is a challenge in itself. Even if you can find the right motherboard, the slim chances of escaping the effect of time on the components (in particular, capacitor and EEPROM degradation) make a reliable test setup hard to come by.

Enter [Samuel], and the Universal Chip Analyzer (UCA). Using an FPGA to emulate the motherboard, it means the experience of testing an IC takes just a matter of seconds. Why an FPGA? Microcontrollers are simply too slow to get a full speed interface to the CPU, even one from the ’80s.

So, how does it actually test? Synthesized inside the FPGA is everything the CPU needs from the motherboard to make it tick, including ROM, RAM, bus controllers, clock generation and interrupt handling. Many testing frequencies are supported (which is helpful for spotting fakes), and if connected to a computer via USB, the UCA can check power consumption, and even benchmark the chip. We can’t begin to detail the amount of thought that’s gone into the design here, from auto-detecting data bus width to the sheer amount of models supported, but you can read more technical details here.

The Mojo v3 FPGA development board was chosen as the heart of the project, featuring an ATmega32U4 and Xilinx Spartan 6 FPGA. The wily among you will have already spotted a problem – the voltage levels used by early CPUs vary greatly (as high as 15V for an Intel 4004). [Samuel]’s ingenious solution to keep the cost down is a shield for each IC family – each with its own voltage converter.

Continue reading “Universal Chip Analyzer: Test Old CPUs In Seconds”

KIM-1 To COSMAC Elf Conversion — Sort Of

In the mid-1970s, if you had your own computer, you probably built it. If you had a lot of money and considerable building skill, you could make an Altair 8800 for about $395 — better than the $650 to have it built. However, cheaper alternatives were not far behind.

In 1976, Popular Electronics published plans for a computer called the COSMAC Elf which you could build for under $100, and much less if you had a good junk box. The design was simple enough that you could build it on a piece of perf board or using wire wrap. We featured the online archive of the entire Popular Electronics collection, but hit up page 33 of this PDF if you want to jump right to the article that started it all. The COSMAC Elf is a great little machine built around a 40-pin RCA 1802 processor, and for many was the first computer they owned. I lost my original 1802 computer in a storm and my recent rebuild in another completely different kind of storm. But there is a way to reclaim those glory days without starting from scratch.  I’m going to repurpose another retro-computing recreation; the KIM-1.

I’ll admit it, Rewiring a real KIM-1 to take an 1802 CPU would be difficult and unnecessary and that’s not what this article is about. However, I did have a KIM UNO — [Oscar’s] respin of the classic computer using an Arduino mini pro. Looking at the keyboard, it occurred to me that the Arduino could just as easily simulate an 1802 as it could a 6502. Heck, that’s only two digits different, right?

The result is pretty pleasing. A “real” Elf had 8 toggle switches, but there were several variations that did have keypads, so it isn’t that far off. Most Elf computers had 256 bytes of memory (without an upgrade) but the 1802 UNO (as I’m calling it) has 1K. There’s also a host of other features, including a ROM and a monitor for loading and debugging programs that doesn’t require any space in the emulated 1802.

Continue reading “KIM-1 To COSMAC Elf Conversion — Sort Of”