This time, I'm attempting to create a system using the 6809 microprocessor. It's one successor to the original 6800 architecture, but adds lots of 16 bit features, such as two 16 bit index registers, another 16 bit stack pointer, and the ability to combine the two accumulators into one 16 bit register. These characteristic make the 6809 very versatile.
Part list
- MC6809 (NMOS, 4 MHz)
- MC68B21 (NMOS, 2 MHz) 'PIA' (Peripheral Interface Adapter)
- MC6840 (NMOS, 1 MHz) 'PTM' (Programmable Timer Module)
- MC6850 (NMOS, 1 MHz) 'ACIA' (Asynchronous Communications Interface Adapter)
- W27C020 (256 KiB) EEPROM
- AS6C62256 (32 KiB) SRAM
- SN74LS00N NANDs
- SN74LS04N Hex Inverters
- SN74LS393N Binary Counters
Memory map
The memory map of this breadboard computer is similar to the 6502 project. It consists of:
0000 - 3FFF :SRAM (16k)4000 - 7FFF :I/O (16k)8000 - FFFF :EEPROM (32k)
The I/O space is lazily decoded with three devices being present on the bus:
4800 - 4807 :6840 Programmable Timer Module (PTM)5000 - 5001 :6850 Asynchronous Communication Interface Adapter (ACIA)6000 - 6003 :6821 Peripheral Interface Adapter (PIA)
Now, I don't have much to show you yet, but I always start these projects by getting something rather simple to work. The first task was to write output data to a Peripheral Interface Adapter (PIA). However, oddly enough (and after verifying every connection and details of the datasheets), the output to the PIA were... sporadic. Unlike the CMOS versions of the 6502 and Z80, the 6809 is not a static design, and you therefore cannot halt the clock to single-step instructions and monitor the bus, which I used to do with a very ad-hoc Arduino setup.
After a lot of headscratching, I decided to buy a cheap logic analyser with a resolution up to 24 MHz and record it with Sigrok. I inspected the address lines, data lines, and some control lines. It turns out that everything ran perfectly for maybe a millisecond. Inspecting the E (enable) line, which is the last signal in the picture, everything starts going wrong after it pulses a tiny bit shorter than usual. This made me realise that I accidentally used ever so slightly larger load capacitors in the crystal circuit than spec (27 pF vs. 24 pF). Even single-stepping wouldn't have caught this.
Just as an end note, after getting the basic microprocessor setup to work on the 4 MHz crystal, there was something more odd that I noticed with this system. I turned off the lamp on my desk, in order to get ready to leave, but the output of the PIA changed. Somehow, somewhere, signal noise or a current surge generated from the lamp indirectly channels into the PIA to change its state. How peculiar.
I haven't been able to work on the 6809 for quite a while, as the last update was around a month ago, but I finally did spend a couple nights on getting all the peripherals wired up. The Programmable Timer Module (PTM) has been terrible to get working in particular. Somehow, the Motorola datasheets are really horrible at explaining little details as it's quite all over the place. For example, to get timer 3 working, it's required to first initialise timer 1 (or so I found).
On another note, which is more my own fault, I thought I could use the PTM as baudrate generator for the Asynchronous Communications Interface Adapter (ACIA) like I did with the Z80 project. For the Z80 CTC and SIO, it was advertised like this. However, unlike the asynchronous Z80 CTC, the PTM synchronises external clocks with the system (E) clock. This introduces shifts and glitches in the baudrate clock which I planned to use for the ACIA.
In an attempt to work around this, I had to create a baudrate generator
circuit myself, as the 6800-family ACIA doesn't have one of its own,
contrary to the 6551 ACIA. I'm using a 1.8432
MHz crystal oscillator, so I need to divide its signal in 12, together
with the internal 16x divider by the ACIA, which results in
1843200 / 12 / 16 = 9600.
This post
sums up the circuit quite well, as the picture on the right. Now, I
finally have a working system with all the periphals that I want right
now; it's time to port Wozmon to it.
It has become a little tradition to port Wozmon to all the CPU projects that I've created. Firstly, it was QMon (for the QCPU 2 project), and then it was ZMon (for the Z80 family), and now, I introduce to you 6809Mon. I know; it's such an original name.
6809Mon is available
at address 0x8000 and takes up just over 256 bytes of
EEPROM space. Maybe when I'm a bit more familiar with the 6809, I'll be
able to fit it in the original size constraints.


