MC6809 Max board
Some introduction ...
MC6809 8 bit Motorola processors was one of the most advanced in its time. It comes in various versions (speed) including a Hitachi 3 MHz (C type). Having few 6809P chips laying around I set out to create a minimal system, including one with a peripheral chip (PIO, MC6821). Following is a prototype that I got working which is minimal in design in having basically 5 main chips and TTL-USB adapter for communication to a PC. This project is ongoing and where possible I used particular IC's (like GAL's) to minimize the construction and size of the design.
Prototype Board
It mainly consisted of the 6809P chip (1MHz), 6821 peripheral chip (PIO), Dallas DS1249AB-100 NVRam chip, 6850 ACIA serial chip and 24pin Atmel chip (GAL) to provide some of the decoding and interfacing. Additional things on the board are 14pin 1.8MHz resonator (for 68B50 UART), 4 MHz crystal (for system clock, divided by 4, to give 1MHz clock output). Flying wires are leads to a TTL to USB converter that connects to USB port of a PC. Example monitor code is SBUG v1.8 and XBasic (TSC Extended Basic) programming language that needs Flex sys files to run. GAL chip used is Atmel ATF22V10CQ/CQZ. No particular reason for this one (as any other GAL22v10 chip will do) .. but you can easily get them from RS components and not that expensive. I will provide the .pld and .jed file for the code to program these. See notes later on.Prototype board was constructed using a perforated/single solder-pin type board with a bank of tracks to place the IC's. Wiring was soldered point to point using wire wrap wire and also banks of IDC type pins for wire wrapping from top of the board (click on picture for larger image). After initial mounting of the components and testing for shorts etc the board was ready for use.
Power consumption
When powered up the board draws approximately 320mA. Note when using the PIO chip and connections to it .. current consumption would increase ... so make appropriate allowances for that.
Parts for construction
If you are an old micro buff ... you probably have some if not most parts to construct this mini board. In case you don't here is few suggestions for major parts.
6809P (P, A or B version) you might be lucky enough to get them from China supplies (via Alibaba or Ebay website) .. be prepared to wait 3-4 weeks at least.
Atmel (GAL chip) try RS components.. usually very quick delivery. If you cannot program GAL's I can supply the chip programmed.
4, 6 or 8 MHz crystal (depending on chip type) ... try RS components or Element14
1.8432 MHz resonator ... try RS components
TTL to USB adapter, many supplies from China via Ebay .. take 3-4 weeks
Dallas NVRAm chip .. try Ebay
32 pin Ziff socket ..for easy install of NVRAM (optional) .. otherwise use normal IC socket
Also look through some forums like this one.
Circuit Design
It basically follows from some of the designs you will find on the web with simplification of decoding logic with a GAL chip, and use of a single NVRAM chip (both for ROM/RAM type function). For minimal system you would need at least a Monitor program, some RAM and an I/O COMMs. Simplest would be to have RS232 type COMMs that you can connect to a PC and communicate to the board via terminal type program.The COMMs configuration settings are:
115200 Baud
NO parity
8 bits
1 stop bit
Bandshake none
I also added a 6821 chip to give extra 2 ports of I/O if needed. The GAL chip provides decoding and select chip lines as output .. together with ~WR and ~RD signals. Hence irrespective of the software .. you can configure the appropriate ~CS lines to work OK for any memory mapping needed.
Schematic and component functions
Following is a schematic of the design (~2MHz version). It is using Diptrace pcb software. Note I use point to point schematic (pin ID connections). It does reduce wires .. but for some people it gets bit harder to follow.
Other type of designs would have to be slightly different say as for "E" chip versions of the micro chip ... which have different type of clock input(s) .. and hence pin connections ... and some chips like Hitachi clones can run at higher frequencies( C version runs @ 3MHz). That can influence chips like the ACIA 68B50 and 6821 PIO .. so make sure to use a faster version of them that run @ 2 MHz... this is not so much for serial, I/O output .. but the data bus end that connects to the microprocessor.
So if you use a B version of 6809 (2MHz) .. use the B versions of 68B50 and 68B21 respectively.. Also change the system clock to 8 MHz (gets divided by 4 for 2 MHz operation). ... or use a single chip version for all the clocks (7.3728MHZ)
Caution: As with any circuit diagrams it is up to you to recheck and make sure it is OK before proceeding to any construction. To best of my ability this is representation of what I have used. So please check pin outs (especially against datasheets) to make sure all connections are correct. If there is any errors please email me.
Looking at the schematic here is bit of explanation of some of the component functions:
Resistors are basically pull up resistors for inputs to CPU that are not needed.
Led is just a power indicator for the board.
S1 (on board pb switch) is the manual reset input to 6809.
Note also reset is provided from external input via terminal power block.
On 6821, A0-A1 used for on chip CR/DDR/Ports addressing.
Chip selects for NVRAM and 6821 come from the GAL chip.
GAL chip provides address decoding and RD and WR signals .
I used the DS1245AB chip which is a 256Kx8 bytes chip .. so you only use 1/4 of it (64k) .. (although you could bank switch ..if redesigning in future). The main reason for this NVRAM chip is that it is 32 pin and gives you more RAM for same amount of pins and is reasonably cheap. Plus it was the one I was able to program with Wellon programmer.
Here is update of PCB made recently from the prototype
GAL Function
GAL is used to provide address decoding and read/write signals. Additional unused pins could be used for future GAL functions as needed e.g. floppy controller chip select .. etc. For more info see Atmel website and WinCupl software.
The code for the GAl chip is shown below:
6809MAX GAL code
Name 6809 max board,SBUGmON;
Partno 0001;
Revision Ver 1;
Date 11/10/17;
Designer mc;
Company mcoz;
Location oz;
Assembly manual;
Device g22v10;
/** Inputs **/
pin [3..11] = [a7..15] ;
pin 14 = a6;
pin 15 = a5;
pin 16 = a4;
pin 1 = eout;
pin 2 = rnw;
pin 17= naIRQ;
/** Outputs **/
pin 22 = !rd;
pin 23 = !wr;
pin 19 = !piaCS;
pin 21 = !acaCS;
pin 20 = !memCS;
pin 13 = !exCS;
pin 18 = sRTS;
/** Declarations and Intermediate Variable Definitions **/
field ioaddr= [a15..4];
acaCS_eqn = ioaddr:[E000..E0FF];
piaCS_eqn = ioaddr:[E1XX..E1FF];
sRTS_eqn = !naIRQ;
memCS_eqn = (ioaddr:[00XX..DFXX])#(ioaddr:[E2XX..F7XX])#((ioaddr:[F8XX..FFXX])& rnw & eout);
/** Logic Equations **/
rd = eout & rnw ;
wr = !rnw & eout ;
piaCS = piaCS_eqn ;
acaCS = acaCS_eqn;
memCS = memCS_eqn;
sRTS = sRTS_eqn;
Note (in above listing) the last WR equation .. should write protect the F800-FFFF (SBUG Monitor Ram area) from being overwritten by WR signal at any stage. Although spikes etc could rewrite any of the ram area and hence the NVRam chip would have to be programmed with a Programmer again.
The pin out for GAL chip is as follows:
Memory Map
The memory map is as follows:
F800-FFFF SBUG (write protected)
E000-E0FF ACIA
E100-E1FF PIA
Note that any other map areas are basically FREE ram .. .
Download Full Memory code
Following download is a full 64K image from 0000-FFFF that has XBasic in lower part and Flex and SBUG in top part.
It is an image that already has run XBasic in cold start .. so if you need to get back to it it is via $0003 warm startup address.
Testing the board
Obviously have the board connected to the PC and use appropriate COMMs software like Hyperterm (on XP) ... or RealTerm set to appropriate setting. Also set CAPS ON .... (reduces errors). If all OK after pressing the RESET button the response should be "<" open bracket ... where you can give monitor commands after that. Following is snapshot of sample commands in SBUG ....
From this point on you can explore some more of the monitor commands. Although part of Flex is loaded in RAM rest of the components like drives etc are not there .. so do not use any of the commands that make use of these devices ... like U and D.
Saving and loading code (via terminal)
So for example to save above code you would issue command
P 0200-0210
and before you press <CR>, set terminal program to "capture file" mode .. which will save text as it is output to the terminal.
Start capture mode and press <CR>
... the listing should follow .. once character output had stopped .. Stop the capture ...
To see what is captured open the captured file with Notepad ..it should look like something like this ...
To retrieve the code type in
L <CR>
and send the captured file as text using terminal program .. What you might need to do is delay the character and LF output to about 1ms DELAY ..so the board does not get swamped with incoming characters from the PC serial port. You can adjust the delay to smaller value till the sending of file stops working properly. Few ms+ is usually a safe bet.
Following is a snapshot of running Xbasic from the SBUG monitor ..
Step involved:
Change program counter to 003 <CTR>P 0003
type G command
Should get XBasic "READY" signal
Do what ever you need to program in basic.. e.g. list previous saved program
To get back to SBUG type ... EXIT
Now you back in monitor mode ..