AM9511 APU interface module for the 6502

I was inspired by Phillip Stevens’s AM9511 module for the RC2014 and after getting my hands on several AM9511A units from a new-old-stock cache, I wanted to make a similar module that would allow the use of an AM9511 with the 6502. The interface for the 8080/8085/Z80 is really pretty easy, and I somewhat naively assumed that an interface to the 6502 shouldn’t be too difficult. The interface between the CPU and the AM9511 is asynchronous (no shared clock signal) and the AM9511 has strict timing requirements. It so happens that the exposed discrete timing states within each machine cycle of an 8080/8085/Z80 makes it relatively easy to satisfy the AM9511’s timing requirements. Not so with the 6502!

The few examples I found in cursory searches all resorted to bit-banging the AM9511 using the VIA. The overhead in doing so would dramatically complicate the use of the AM9511 and might even negate a significant part of the advantage of having hardware that can do fast multiplications, divisions, etc. What followed was a much more involved research project, studying prior art in Kissel and Currie’s work with the AM9511 and the 6502 at NASA around 1985, as well as Hart’s MICROCRUNCH published in a magazine article in 1981. Subsequently, I spent hours with a jumble of breadboarded parts and the oscilloscope to work out the timing of those designs.

After many missteps, I came up with a design that combines elements of the work in the above-cited prior art, and allows the AM9511 to successfully participate on the 6502 bus like any other I/O device, with just a few components that are readily available. I put the KiCad source and a slew of documentation up on GitHub with a Creative Commons (CC BY 4.0) license for anyone else who’s interested in using an AM9511 with the 6502. You can find it all at github.com/ceharris/am9511-6502.

I’ve been able to use the AM9511 directly in Forth programs for fixed point operations, and it is quite cool to see Forth cranking out results for transcendental functions that would be agonizingly slow if written in Forth or 6502 assembly, or even just blazing through 32-bit multiplications and divisions. I’ve been considering creating mods for Microsoft BASIC or EhBASIC to allow it to use the AM9511 for floating point, too. The approach would essentially be the same as what Stevens did for the Z80/8085, which converts the Microsoft BASIC floating point representation to the AM9511 equivalent, passes off each floating point operation to the AM9511 and then transforms the results back into BASIC’s floating point format.

7 Likes

Lovely work - and it’s great to hear that caches of these chips are still (somewhat) available. It sounds a difficult project.

At least it wasn’t a National MM57109 “RPN Number Cruncher” calculator chip you were trying to talk to. It’s a 9 V chip, so will only output compatible signals if you feed it +5 V / -4 V. It’s also remarkably slow. If that wasn’t enough, they’re quite rare, so are not cheap. Some RCA 1802 users have been reverse-engineering a special board/BASIC interpreter that used one of these chips plus the COSMAC cpu to get slightly more peppy calculations.

Some other computers had add-ons that allowed an MM57109 to be used:Non-COSMAC applications and docs of the National MM57109

2 Likes

Hi,
my CP/M Z80AS assembler has native support for AM9511 floating point…
See Z80AS/Z80AS Manual v4.7.pdf at main · Laci1953/Z80AS · GitHub

Ladislau

2 Likes