8 Bit Force 8 bit microprocessors, computers, music and everything else.

Simon6809

SiMon6809 is a 6809 based educational computer. If you coded on 8-bit processors, you will remember the good-ol' days. If you never used an 8-bit processor, you can use SiMon6809 to go back in time.

Back in the days of Apple I/II and Commodore 64, 6502 and its derivatives were the most popular 8-bit microprocesor chips. Most of us spent hours coding in assembly, doing all sorts of tricks with about several kBytes(note k!) of memory and simple 8-bit move/add/subtract instructions. Those of us who coded on Commodore 64, will remember the underground competition about trying to come up with the best demos.

At the end of that era, Motorola designed the most powerful micro, 6809. It was fundamentally an 8-bit processor, but it had some support for high level languages and 16-bit operations, i.e. addition & multiplication. Unfortunately, 6809 came in little bit late; the world moved onto true 16-bit processors (like 68000 and 8086) and 6809 was forgotten.

My goal with SiMon6809 is to build a simple computer that will let you experience 6809. Yes, there are simulators on the web (and some of them are very good indeed), but running your code on real hardware is a different experience.

SiMon6809 has the following features:

  • Motorola 6809 processor, running @ 1.0MHZ
  • 8 KBytes of EEPROM (in-system writable)
  • 32 KBytes of Static RAM
  • FT245RL USB to Parallel FIFO chip
  • Powered from USB port.

One of my life principles is "to keep it simple", so is SiMon6809. You will need i) a computer (MAC or PC) with a USB port, ii) a terminal program and iii) SiMon6809 board.

I am making all the design files available for you to study and (hopefully) build one for yourself.

I used to have an email here for questions/comments/kits, but removed it.  Sorry I'm currently too busy to respond to emails due to work/life.

You can get the design files by clicking the links below. Enjoy, Erturk.

Schematics (PDF)
PCB Layout (PDF)
Express PCB Files
Monitor Code (OLD_CODEROM_D1_080404_0942ROM_D1b_20080404)
6809 Assembler

2011/02/01: IMPORTANT NOTE.  If you are going to burn your own EEPROM's using the bin files in the above zip files, you need to discard the two 2 bytes in the beginning of the bin file.  The two bytes are the left-over size fields for the initial bootloader I used to bring up simon6809.

2011/02/01:  I have uploaded D1 and D1b.  It's been 3yrs, they are probably same or very similar.  I'm shipping Simon6809's with D1b code.  Old_Code is probably old (it's dated 2008/03).

Acknowledgements

Before we get into details, I would like to acknowledge Lennart Benschop for writing his 6809 monitor code and making it available. His monitor code is a kick-ass monitor, with an assembler and disassembler included! I slightly modified it to run on SiMon6809.

6809 Features

Note: This list will make experienced 8-bit programmers salivate. Do not worry if some of these acronyms do not make sense. You will be able to try all of them on SiMon 6809.

  • Two 8-bit Accumulators (A,B) that can be combined to form one 16-bit Accumulator (D)
  • Two 16-bit Index Register (X,Y)
  • Two 16-bit Indexable Stack Pointers (S, U)
  • Direct Page Register (DP) allows Direct Addressing through-out memory
  • 10 Addressing modes
    • Direct Addressing anywhere in memory map
    • Long Relative Branches
    • Program Counter Relative
    • True Indirect Addressing
    • Expanded Indexed Addressing
    • 0, 5, 8 or 16-bit constant offsets
    • 8 or 16-bit accumulator offsets
    • Auto-increment/Decrement by 1 or 2
  • Improved Stack Manipulation
  • 8x8 unsigned multiply
  • 16-bit arithmetic
  • Transfer/Exchange all registers
  • Push/Pull any register or any set of registers
  • Load Effective Address

Block Diagram

SiMon has 4 major components.

  • 6809, the processor
  • 8 KByte EEPROM, contains the monitor code.
  • 32 KByte Static RAM
  • FT245RL, which is the link to the PC.
    • When FT245RL receives byte(s) from PC, it will assert FIRQ

SW Memory Map


0x0000 - 0x7FFF : System RAM (32K)
0x8000 - 0x9FFF : (Optional 2nd 8K EEPROM or RAM or I/O)
0xA000 - 0xCFFF : Unused
0xD000 - 0xD7FF : FT245RL
0xD800 - 0xDFFF : Unused
0xE000 - 0xFFFF : System EEPROM (includes monitor + assembler)

FT245R USB to Parallel FIFO Chip

FT245R is a single chip USB to parallel FIFO bidirectional data transfer interface chip. It has 256 bytes of receive buffer and 128 bytes of transmit buffer. Also, it will transfer data at ~300kBytes/sec. Unlike other designs where a ACIA (serial port) is used, the communication
link on SiMon6809 is very fast.

After installing the drivers on the host PC, SiMon 6809 will showup as a Virtual COM port. This way, a simple terminal program (i.e.Hypterminal) can be used to communicate with SiMon 6809.

SiMon6809 programs can access FT245R at address 0xD000.

  • Sending byte(s) to PC
    • Write byte(s) to address 0xD000 and they will be sent to the PC over USB port.
  • Reading byte(s) from PC
    • Any byte(s) received from PC, will be buffered at FT245R. Then FT245R will assert FIRQ input.
    • 6809 can read the bytes from FT245RL at address 0xD000. You can do in two ways:
      • using FIRQ handler
      • using SYNC instruction.

If you choose the FIRQ handler solution, the handler should receive each byte and put it in a FIFO in the RAM. Then you can implement getc() and putc() type functions to access this FIFO in a controlled way. Memory is precious and FT245RL already has a FIFO in it, so I don't see any good reason to keep a second FIFO in SiMon6809.

SiMon6809 uses the SYNC method. Here is an example of how to read character and echo it back to the PC:

 

 

ECHO	ORCC #%0100_0000    # Disable FIRQ interrupt
RECV	SYNC                # 6809 will wait for FIRQ
        LDA $D000           # read byte from FT245
        STA $D000           # Echo back to PC
        BRA RECV

 

The problem with the above code is SYNC blocks the processor (i.e. 6809 will wait for the interrupt to occur). This means this code can not just check if there is a byte waiting or not.

In SiMon6809 monitor code, I actually do a trick. I enable the FIRQ interrupt, wait a few cycles and disable the FIRQ. Then I check if my FIRQ handler fired or not. If it fired, that means FT245RL was asserting the FIRQ line, which means there is at least one byte in its FIFO. Otherwise, there was no character received. Go thru the monitor code for details.

WARNING! The programmer must ensure FT245R has a byte in FIFO before reading from $D000, otherwise data read will be invalid (I believe you will read the last byte sent again, but don't quote me on this.).

Installation

You can use SiMon 6809 on either a PC running Windows or a MAC.

Windows Installation

  1. Before inserting the USB cable into the PC, copy or download FT245R drivers to your computer.
  2. Insert USB cable into PC.
  3. Windows will detect FT245R and ask for drivers. Point to the driver folder you just copied.
  4. After drivers are installed, run terminal program*.
  5. Create a new connection, using 115200 kbps, 8-bit, no parity, 1-stop bit.
  6. Hit reset on SiMon 6809 and check for the monitor prompt.

MAC OS X installation

  1. Before inserting the USB cable into the PC, please install the FT245R drivers. You may need to restart your MAC.
  2. Start your favorite terminal program*.
  3. Create a new connection using 115200 kbps, 8-bit, no-parity, 1-stop bit.
  4. Hit reset on SiMon 6809 and check for the monitor prompt.

Note: Some terminal programs will give you faster baud rates with FT245RL. Choose the fastest option available.

* At the time of writing this manual, there were several terminal programs available on the net:

  • Hyperterminal(Windows, not the best)
  • RealTerm (Shareware, Windows)
  • ZTerm (Shareware, Mac)
  • Minicom (Open source, Windows & MAC)

Monitor Program

After reset, 6809 runs the monitor program stored in the EEPROM. With the monitor program, you can:

  • Examine/change memory contents & 6809 registers
  • Assemble/Disassemble 6809 mnemonics
  • Download/upload programs from host PC
  • Execute programs

Upon reset, you will get the following message in the terminal
program:

 

 

PASS

Welcome to BUGGY version 1.1 - D1
        by Lennart Benschop
 ported by Erturk Kocalar

.

 

The "PASS" indicates the monitor code checked the first 32Kbytes of memory and all addresses are good. While SiMon6809 checks the memory, it will save the memory contents, so if your program crashes and you need to reset, your program will still be there.

The dot "." is the prompt. Type h [ENTER] for help.

 

 

Commands list
---------------
Asm       {A<addr>}
Unasm     {U or U<addr> or U<addr>,<length>}
Dump      {D or D<addr> or D<addr>,<length>}
Enter     {E or E<addr> or E<addr> <bytes> or E<addr><string>}
Inp       {I<addr>}
Break     {B or B<addr>. B displays, B<addr> sets or clears breakpoint}
Regs      {R or R<letter><hex>}
Go        {G or G<addr>}
Jump      {J<addr>}
Step Over {P}
Calc      {Chexnum{+|-|*hexnum}}
Find      {F<addr> <bytes> or F<addr>"ascii"}
Move      {M<addr1>,<addr2>,<lenght>}
Srec      {SO<addr> or SS<addr>,<len> or S1<bytes> or S9<bytes>}
Help      {H}
.

 

Extending Simon6809

I have a few ideas about improving Simon6809. If you can do some soldering, you can hook up additional hardware.

Hardware Projects

If you look at the schematics, pin11 of U08 decodes the address range from $8000-$9FFF. This is available as a test point between U08 and U138. In addition, the databus and the address bus are available on the RAM (U62256) pins. So, if you can carefully solder a socket on top of the RAM and bring the additional CS# to it, you will end up with an extension port :)

  • 28C64 programmer (See pictures side and top. Compare the pin-out between 62256 and 2864. Then solder a socket on top of the 62256, connecting only the common pins. For EEPROM CS, use the EEPROM chipselect signal on the testpoint near the 74LS138 decoder.)
  • 65C22 extension card
  • LCD + keyboard card
  • Harddisk interface

For the courageous, one could attach a 40pin socket on top of the processor to get access to more signals. 6809 chips are very difficult to come by, so I don't want to damage the chip by doing this.

Software

Last, since the usb is a fast link, we might be able to use the PC as, say, a graphics LCD screen. We can come up with a protocol so that SiMon6809 can update a virtual screen that shows up on the PC.

To-Do

- The monitor code is a hack put together to see if SiMon6809 works or not. I want to clean-up the code and make it more readable.

Second, I am thinking about implementing either a FORTH or BASIC interpreter.

Last...

 

This page has been visited simon6809 times.