A 150MHz 6502 Co-Processor

If you are familiar with ARM processors, you may know of their early history at the 1980s British home computer manufacturer Acorn. The first physical ARM system was a plug-in co-processor development board for Acorn’s BBC Micro, the machine that could be found in nearly every UK school of the day.

For an 8-bit home computer the BBC Micro had an unusually high specification. It came with parallel, serial and analog ports, built-in networking using Acorn’s proprietary Econet system, and the co-processor interface used by that ARM board, the Tube. There were several commercial co-processors for the Tube, including ones with a 6502,  a Z80 allowing CP/M to be run, and an 80186.

As with most of the 8-bit generation of home computers the BBC Micro continues to maintain a strong enthusiast following who have not stopped extending its capabilities in all directions. The Tube has been interfaced to the Raspberry Pi, for instance, on which an emulation of original co-processor hardware can be run.

bbc-tube-screenshotAnd thus we come to the subject of this article, [Hoglet] and [BigEd]’s 150MHz 6502 coprocessor for the BBC Micro. Which of course isn’t a 6502 at all, but a 6502 emulated in assembler on an ARM which is in a way the very distant descendant of the machine it’s hosted upon. There is something gloriously circular about the whole project, particularly as the Pi, like Acorn, the BBC Micro, and modern-day ARM, has its roots in Cambridge. How useful it is depends on your need to run 8-bit 1980s software in a tearing hurry, but they do report it runs Elite, which if you were there at the time we’re sure you will agree is the most important application to get running on a BBC Micro.

We’ve featured the Tube interface before when we talked about an FPGA co-processor with a PDP/11 mode that was definitely never sold by Acorn. And we’ve also featured an effort to reverse engineer the primordial ARM from that first BBC Micro-based co-processor board.

BBC Micro image: Stuart Brady, Public Domain, via Wikimedia Commons.

The Dual-Core, ARM-Powered Commodore 64

There is no CPU that is better understood than the 6502 and its cousins the 6510, 6507, 6509, and whatever we’re calling the CPU in the NES. With this vast amount of documentation, just about anything can be done. Want a discrete and un-discreet 6502? Sure thing. It’s the NMOS version, though. Want an emulated version. Sure. With libraries porting the 6502 to every platform ever, there’s only one place left to go: putting a 6502 in a Commodore 64. Make it dual-core, too, so we can run CP/M.

This build is based on one of [telmomoya]’s earlier builds – a soft-core 6510 running on an ARM Cortex M3. The inspiration for this build came from a 6502 emulator running on an Arduino, which got [telmomoya] wondering what would happen if he attached some external RAM, CIA or a SID. Doing this on an Arduino is hard, but there are a few 5 Volt tolerant ARM chips out there, and with a few banks of SRAM, [tel] quickly had an emulated 6502 running EhBasic.

Running an emulated 6502 on an ARM chip is nothing new. What makes this build spectacular is the adaptation to the C64 motherboard. Since [telmomoya] was already breaking out the data and address lines to go to the SRAMs, it didn’t take much extra work to simply build an adapter for the DIP40 CPU socket on a C64. A few 74-series logic chips made the interface easy, and after a bit of soldering, [telmomoya] had a Commodore 64 powered by an ARM chip.

If you’re emulating one chip, you can emulate two, and with the Commodore 64, this leads to a few interesting possibilities. The C64 had a CP/M cartridge — a cartridge that contained a Z80 CPU, sharing the data and address bus with the 6510. This cartridge allowed the ‘toy computer’ C64 to run the ‘business’ CP/M operating system (and the Z80 made the Commodore 128 much cooler).  Since [telmomoya] was already emulating a CPU, emulating a second CPU wasn’t really that hard.

It’s a phenomenal build, and great if you’ve ever wanted to speed up VisiCalc.

How The Dis-integrated 6502 Came To Be

I made a bee line for one booth in particular at this year’s Bay Area Maker Faire; our friend [Eric Schlaepfer] had his MOnSter 6502 on display. If you missed it last week, the unveiling of a 6502 built from discrete transistors lit the Internet afire. At that point, the board was not fully operational but [Eric’s] perseverance paid off because it had no problem whatsoever blinking out verification code at his booth.

I interviewed [Eric] in the video below about the design process. It’s not surprising to hear that he was initially trying to prove that this couldn’t be done. Unable to do so, there was nothing left to do but devote almost six-months of his free time to completing the design, layout, and assembly.

What I’m most impressed about (besides just pulling it off in the first place) is the level of perfection [Eric] achieved in his design. He has virtually no errors whatsoever. In the video you’ll hear him discuss an issue with pull-up/pull-down components which did smoke some of the transistors. The solution is an in-line resistor on each of the replacement transistors. This was difficult to photograph but you can make out the soldering trick above where the 3-pin MOSFET is propped up with it’s pair of legs on the board, and the single leg in the air. The added resistor to fix the issue connects that airborne leg to its PCB pad. Other than this, there was no other routing to correct. Incredible.

The huge schematic binder includes a centerfold — literally. One of the most difficult pieces of the puzzle was working out the decode ROM. What folds out of this binder doesn’t even look like a schematic at first glance, but take a closer look (warning, 8 MB image). Every component in that grid was placed manually.

I had been expecting to see some tube-based goodness from [Eric] this year. That’s because I loved his work on Flappy Bird on a green CRT in 2014, and Battlezone on a tube with a hand-wound yoke last year. But I’m glad he stepped away from the tubes and created this marvelous specimen of engineering.

Hackaday Links: May 22, 2016

Lulzbot’s TAZ 6 has been released. Lulzbot’s printers consistently place in the top three of any 3D printing list, and the TAZ 6 will likely be no exception. [James Bruton] was one of the lucky ones who got a review unit, and first looks are promising. The TAZ 6 has the auto bed leveling found in the Lulzbot Mini, and a ‘power tower’ for all the electronics. There are completely unconfirmed rumors (or someone told me and I forgot who) that the power tower will be available separately at some point.

The most impressive circuit we’ve seen this week month year is the dis-integrated 6502. It’s a discrete 6502 CPU, about a square foot in size. It’s slow, but it works. RAM and ROM is easy to make embiggened, which means someone needs to build a dis-integrated 6522 VIA. Who’s game?

[Jeremy Cook] wanted to learn another CAD package, in this case Onshape. Onshape is the ‘first cloud-only CAD package’, which has one huge bonus – you can run it anywhere, on anything – and one huge minus – it’s in the cloud. He designed a bicycle cupholder.

Last week, several thousand Raspberry Pi Zeros shipped out to retailers in the US and UK. For a time, Pi Zeros were in stock in some online stores. Now? Not so much. Where did they all go? eBay, apparently. It’s called arbitrage, and it’s the only risk-free form of investment.

Remember those ‘bed of nails’ toys, that were basically two sheets of plastic, with hundreds of small pins able to make 3D impressions of your face and hands. No, there is no official name for these devices, but here’s a Kickstarter for a very clever application of these toys. You can use them to hold through hole parts while soldering. Brilliant.

You should not pay attention to 3D printers on Kickstarter. Repeat after me: you should not give money to 3D printers on Kickstarter. Here’s a 3D printer on Kickstarter, promising a 3D printer for $74. I own several hats, and will eat one if this ships by next year.

Remember bash.org? It’s being reimplemented on hackaday.io.

A Dis-Integrated 6502

The 6502 is the classic CPU. This chip is found in the original Apple, Apple II, PET, Commodore 64, BBC Micro, Atari 2600, and 800, the original Nintendo Entertainment System, Tamagotchis, and Bender Bending Rodriguez. This was the chip that started the microcomputer revolution, and holds a special place in the heart of every nerd and technophile. The 6502 is also possibly the most studied processor, with die shots of polysilicon and metal found in VLSI textbooks and numerous simulators available online.

The only thing we haven’t seen, until now, is a version of the 6502 built out of discrete transistors. That’s what [Eric Schlaepfer] has been working on over the past year. It’s huge – 12 inches by 15 inches – has over four thousand individual components, and so far, this thing works. It’s not completely tested, but the preliminary results look good.

The MOnSter 6502 began as a thought experiment between [Eric] and [Windell Oskay], the guy behind Evil Mad Scientist and creator of the discrete 555 and dis-integrated 741 kits. After realizing that a few thousand transistors could fit on a single panel, [Eric] grabbed the netlist of the 6502 from Visual6502.org. With the help of several scripts, and placing 4,304 components into a board design, the 6502 was made dis-integrated. If you’re building a CPU made out of discrete components, it only makes sense to add a bunch of LEDs, so [Eric] threw a few of these on the data and address lines.

This is the NMOS version of the 6502, not the later, improved CMOS version. As such, this version of the 6502 doesn’t have all the instructions some programs would expect. The NMOS version is slower, more prone to noise, and is not a static CPU.

So far, the CPU is not completely tested and [eric] doesn’t expect it to run faster than a few hundred kilohertz, anyway. That means this gigantic CPU can’t be dropped into an Apple II or commodore; these computers need a CPU to run at a specific speed. It will, however, work in a custom development board.

Will the gigantic 6502 ever be for sale? That’s undetermined, but given the interest this project will receive it’s a foregone conclusion.

Correction: [Eric] designed the 555 and 741 kits

Hackaday Links: January 24, 2016

The RepRap wiki was spammed this week. Everything is fine now, but I feel I should call attention to the fact that the RepRap wiki needs some people to contribute, organize, and maintain everything. The wikis for obscure anime shows are better than the RepRap wiki, so if you’re looking to contribute to an important open source project, there ‘ya go.

The 200cc, 5.5HP, 4-stroke OHV Honda GX200 engine is found in a whole lot of tools, and is a fantastic power plant to build a go-kart around. It also costs about $350. There are clones of this engine available direct from China for about $100. Here’s how you add a turbo to one of these clone engines.

Freescale makes some pretty cool sensors and [Juan Ignacio Cerrudo] figured they needed breakout boards. He has some boards for a low-power three-axis accelerometer, an accelerometer and magnetometer, and a pressure sensor.

The Tektronix TDS744A is an older but still extremely capable 500MHz, 2Gsps, 4-channel scope. You can upgrade it to the 1GHz TDS784A by desoldering a few resistors. Very cool if you’re looking for a cheap-ish 1GHz scope.

[TheBackyardScientist] hung out with some cub scouts a few weekends ago and launched a high altitude balloon over Florida. The payload included a game camera, APRS tracker, GoPro, and a few other bits and bobs. The balloon reached 106,000 feet and landed only a few miles from Cape Canaveral.

Big RC planes – UAVs especially – are a pain to launch. Flying wings above a certain size are just dangerous to launch by hand, and landing gear is heavy and for the most part unnecessary. What’s the next best solution? A trebuchet, of course. It mounts on a car and is able to give a UAV a little bit of altitude and some speed. A pretty good idea that could be easily implemented with some load-bearing PVC pipe.

Everybody likes the Game of Life, so here’s one built with a 6502. It’s built around a Western Design Center 65c816 board we’ve seen before, nine MAX7219 LED controllers mapped to the VIA, and nine 8×8 LED matrix displays. Here’s a video of it in action.

About a month ago, a search of AliExpress turned up Apple’s A8 CPU. I bought one. Here’s what I got. It’s a stupidly small pitch BGA, and I don’t have a datasheet. What am I going to do with it? Make a non-functioning board with a few ports, resistors, no traces, and the A8 chip planted square in the middle.

A Teensy Logic Analyzer For A 6502

[John] has an interesting, if old piece of tech sitting on his workbench. It’s an Ohio Scientific C3-8P computer from the late 70s by way of a few garages, basements, and attics. As with most tech of this vintage, there are some problems, and [John] found debugging a little frustrating without the ability to trace and watch the programs. He needed a logic analyzer, and found one in an unlikely piece of hardware. [John] built one using a Teensy microcontroller, and further refinement of this project could turn it into a full in-system emulator.

The old Ohio Scientific computer [John] is trying to bring back from the dead is based on the 6502 CPU. That’s sixteen address lines to monitor, eight data lines, and four control lines. These were wired directly to a Teensy 3.1.

Reading and controlling all the signals from a 6502 is a task that falls to Linux. A command line program controls the Teensy and is capable of reading memory, setting trigger addresses, dumping the entire address space to a file, or just recording the last 5,000 clock cycles. This kind of tech existed back in the late 70s and early 80s. It also cost a fortune. Now, with a $20 Teensy and probably another $30 in ribbon cables and test clips, anyone can build a logic analyser for a very old computer system.

Videos below.

Continue reading “A Teensy Logic Analyzer For A 6502”