Simon6809 Educational Computer | 8 Bit Force (2024)

Simon6809 Educational Computer | 8 Bit Force (1)

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.

This project is retired and shown for educational value. Check out RetroShield for Arduino instead.

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 Educational Computer | 8 Bit Force (2)

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.

Design files are available for you to study and (hopefully) build one for yourself:

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

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

Simon6809 Educational Computer | 8 Bit Force (3)

SW Memory Map

0x0000 - 0x7FFF : System RAM (32K)0x8000 - 0x9FFF : (Optional 2nd 8K EEPROM or RAM or I/O)0xA000 - 0xCFFF : Unused0xD000 - 0xD7FF : FT245RL0xD800 - 0xDFFF : Unused0xE000 - 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:

ECHOORCC #%0100_0000 # Disable FIRQ interruptRECVSYNC # 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

  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

  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:

PASSWelcome 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}.
  • Loading and saving code is done using S-records. For example, SS1000,100 to dump memory contents in S-record format. Then you can copy/paste this text back into the terminal to load binary images.
  • Assembler/Disassembler are pretty powerfuly to use, thanks to Lennart.
Simon6809 Educational Computer | 8 Bit Force (2024)
Top Articles
Latest Posts
Article information

Author: Sen. Ignacio Ratke

Last Updated:

Views: 6207

Rating: 4.6 / 5 (56 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Sen. Ignacio Ratke

Birthday: 1999-05-27

Address: Apt. 171 8116 Bailey Via, Roberthaven, GA 58289

Phone: +2585395768220

Job: Lead Liaison

Hobby: Lockpicking, LARPing, Lego building, Lapidary, Macrame, Book restoration, Bodybuilding

Introduction: My name is Sen. Ignacio Ratke, I am a adventurous, zealous, outstanding, agreeable, precious, excited, gifted person who loves writing and wants to share my knowledge and understanding with you.