HD6303 board

12/21/2015

The HD6303YCP Based mini-computer board

Built out of a collection of parts from the late 70's & early 80's, the board has 32K of EPROM, 32K of RAM and runs at just over 1MHZ. It has 3 8bit General I/O ports which include a serial port.

By connecting an inexpensive USB-TTL adapter It can communicate to my PC Using a terminal application.

I'm able to modify & view memory, list (dis-assemble) code and assemble code, even program in BASIC! 

With the help of a couple of PC command line utilities I'm also able to upload and download code to/from the board from Intel .hex files.

History:

 The project began on 12/21/2015 and I had an acceptable working 1.0 version on 12/29/2015

It all started when I was looking for "something" new to program. 

I'm a member of a robotics club that was gifted with a rather large collection of older components & hardware of which I volunteered to become curator of. Our collection has 126 of these CPUs, 16 32K EPROMS and 60 32K RAM chips. 

Looking over the specs on the CPU I was intrigued by the fact that it had built in IO ports, a Serial Port and 256 bytes of internal RAM. I concluded that minimally I'd only have to add the ROM to see if I could actually make it work, unlike a similar Z80 based project I had built a few years ago which required a clock circuit, and a PIO along with both RAM & ROM to get working.

So I began....

In spite of not having the proper 68pin socket for the CPU, and being the impatient sort, I decided to just solder wires directly to the pins on the chip (after all we had plenty of these chips....)

Many thanks to Daniel Tufvesson  (http://www.waveguide.se/) for code and circuit examples.

 

Problems Encountered:

1. Failed to wire up MP1 & MP0 pins correctly per datasheet.

2. HALT & STBY pins not properly pulled up.

3. Solder bridge between RES & STBY made getting it to reset properly tricky.

4. Reversed RXD & TXD when trying to get the serial port working.

5. For a good period of the software development it appeared that the assembler simply did NOT like the HEX value 0x1A.  Every time my code contained this value, whether as data, a branch offset, or part of an address, the HEX file would be corrupted.  I thought it was a bug in the assembler and got pretty good at detecting when it was there and working around it.  Strangely enough the listing output was OK. Finally I traced the issue back to the utility that created the HEX files. It seems that ASCII x1A is an EOF character and the utility was not opening the input file in binary mode.  
  (the attached version of ftohex.c includes that correction)

Tools:

 Thankfully I was able to locate an assembler that targeted this cpu here: https://dasm-assembler.github.io/

I needed to slightly modify and compile a utility to convert the output into Intel Hex files (attached below in ftohex.zip)

Of course you'll need an EPROM programmer and UV lamp to erase them. 

I happened to have built my own programmer and needed only to make an adapter to support the 27C256 used in this project.

(for details click here)

Updates:

11/27/2016:   I had put this away for a while but pulled it out again recently. I started playing with different crystals and discovered it would run with a 14.383MHz crystal (at 28000 baud) This is of course out of spec for the chip so I didn't plan to leave it that way but it got me thinking about higher baud rates.
With the 4.9152MHz crystal, the datasheet says the next higher baud when using the FRC (Timer1) as the source is 76800 (not exactly a common rate). However, using Timer2 as the source 19200 and 38400 are available. Problem: I found was my BEEP routine used Timer2 to measure beep duration and that messed with the serial I/O.  So I re-wrote BEEP to use Timer1 instead then added an option to switch to 19200 baud from the user menu. I even upgraded the PC tools so they would upload .hex files using that speed.

 While making this change I discovered a serious bug in my ROM code for inputting assembler code. So that's fixed.
Next I found BASIC was really buggy. I discovered spots in code where the original programmer made the code modify itself. This was fine when the code was running from RAM but not so good when re-located to the EPROM. I improvised a hack to get around this. Then I added a couple new BASIC commands SYS, PEEK & POKE. Now BASIC can call a machine code routine and read or set any byte in the memory space. For instance now BASIC can execute my spiffy new BEEP routine or blink the on board LEDs. In the process of testing the new commands I found & fixed a couple more bugs in BASIC.

Next on to the hardware.  The reset circuit was a simple R/C circuit and the board rarely powered up without the need to press the reset button afterwards. Since switching from an 8K RAM to 32K i freed up a couple of gates on the 7404 that I re-wired to better handle the power on reset delay. This uncovered a need to move a startup delay around in the code.

My new interest in this project moved me to order the correct PLCC-68 socket for the CPU chip so it looks like a re-build in in the near future.   Stay tuned... 
BTW look for updated code & schematics at the bottom of the page.

12/02/2016:

Anticipating the arrival of the sockets, I started to plan a layout for the re-build on Thursday 12/1.
Using the chip labels worked great on the first attempt so I worked on getting some better ones.
By working with the pinout images from the datasheets for the EPROM and RAM chips I was able to get them sized appropriately, then printed and cut them down to fit inside the pins on the bottom of the board. Hard to see with the wires covering them but  the images included the pin numbers and the pin functions.  This was a huge help. 
The sockets actually arrived Thursday afternoon so I started on the project at about 4:00pm. 
Here's the timeline of the re-build:

                4 pm        -     Parts layout & board labels

                5 pm        -     Finished soldering the power connections to all chips.

                7:30 pm   -     A0-A15 connections from address bus connector to EPROM & RAM

                8:40 pm    -    All connections to EPROM & RAM complete

                9:15 pm    -    CPU to Address & Data bus connections finished

               11:00 pm   -    First power up test.  (not working OH NO!!!)  (oops forgot we need R/W & E hooked up)

               12:05 am   -    It Blinks the LED!!!   After connecting the control signals it still didn't work. Pulled out he scope

                                        and there was action on address & data bus so that's good. Finally decided to ring out the 

                                        address lines and found A14 & A15 reversed from the CPU.    Went to bed once the LED blinked.

     12/2    8:00 am    -    Wired the remaining I/O ports and added data connections to the serial port connector

                10:00 am   -    Added on board LEDS and full reset circuit. Tested with full ROM. added labels.  

                10:40 am    -   Done.  The re-build took about 10 hours and used  over 18 feet of wire wrap wire. 

Everything else is pretty much the same. A couple of new pictures posted below.

You'll notice the position of RAM & ROM is reversed. I did this thinking that the EPROM gets removed more frequently than the RAM so I thought it should be at the end. In retrospect, this turned out to be a mistake. Better to have it the original way so it is inline with the center board supports. The board flexes a lot when you push the EPROM into the socket.

3/25/2016

Corrected a error in the schematics involving pin 45 on the CPU (new versions are listed below)
Thanks to Steve B. for pointing this out.

5/19/2019

It had been quite a while since I played around with this project but I pulled it out recently and wondered how it could be improved.  While considering expanding the storage with a serial flash chip I decided it might be a nice idea to replace the EPROM with a parallel flash EEPROM.  I found some AT28C256 pretty cheap on ebay  (which turned out to be a minor mistake) and built this Flash Programmer to program them. 
  Since the AT28C256 is close but not EXACTLY a pin for pin replacement for the M27C256 EPROM I had to add a couple of jumpers to allow me to switch between the two types of chip. This was a pretty simple modification and worked quite well. Now the update process is a lot simpler as I don’t have to wait for the chip to be erased under a UV lamp before applying an update. I even stashed a game on the ROM since there’s a lot of free space left there.

6/21/2023

Recently someone contacted me and shared photos and details of his build of the HD6303 board.
This re-kindled my interest in this old project so I dusted it off and fired it up.
I have written a few command line tools to transfer data to/from the CPU board and wondered what
users of other operating systems  would do if they didn't have access to a windows PC.
So I fired up a virtual LUBUNTU box and translated those tools to run under LINUX.
(this was probably not my best work but they get the job done)
I found that DASM is available for linux so one could develop right from the linux box.
See 6303_linux_tools.zip in the downloads section at the very bottom of this page.
Ive also made available a couple of other PC tools I had not shared before.  (6303_pc_tools.zip)
Besides the 6303pgmr* utility to upload .hex file from the host to the board there's a complementary
6303save* utility to save memory from the board to a .hex file on the host and 6303Bload* to load BASIC source onto the 6303 board. I'll admit these last two utilities are not very useful but since I had them I thought I'd share.  Enjoy...


Software:

The current code takes up a tad over 8k of the ROM space (including BASIC).

Here's a shot of the main menu on my terminal program.

 

Some more screenshots with examples of various functions:

List function

Assemble, List, Enter Text, Go(2000)  functions

Dump 256 function

BASIC Example

Ugly wiring

V1.6 running an LCD demo

The rebuild complete.

Bottom of the rebuild
(not as ugly as the original )

Flash ROM version with jumpers.

File Descriptions:  (see links below for to view/download)

6303_linux_tools.zip                                 Data transfer tools for linux (with source)
6303_pc_tools.zip                                      Data transfer tools for windows  (with source)

 6303Rom21_source.zip                         Source, .hex and listing for the ROM (v2.1) 

  6303pgmr.zip                                               Source & binaries for the PC program to load iHEX files to the board RAM

  ftohex.zip                                                         Source & binary for the assembler output to iHEX file converter

  HD6303YCP_CPU_BOARD_V2.pdf             Board schematic

  HD6303YCP_CPU_BOARD_V2F.pdf           Board schematic - Added Flash ROM support jumpers

  HD6303YCP_datasheet.pdf               HD6303YCP datasheet

 Othello.zip                                                      Othello another fun game to play on the 6303 board.

  MasterMind.zip                                          The 1970s Game Mastermind for the HD6303 board (Source , Listing & iHEX)