Wednesday, December 9, 2015

Update on MKHBC-8-R 6502 computer (now on revision #2) - prototyping RTC and banked RAM.

I had very productive 2 weeks or so with this project. 

To make long story short:

  • I assembled CPU and UART cards.
  • I discovered and mostly corrected errors in my design and technical problems in manufactured boards (bus contention, wrong address decoding scheme, bad solder joints/electrical contact problem on CPU bus, connector B2).
  • I built and tested RTC circuit prototype (based on DS1685 and Chris Ward's design of connecting this multiplexed bus type chip to 6502 bus).
  • I built and tested prototype of RAM bank switching register (based on 74LS374 latch register).

More details in my YouTube video: MKHBC-8-R2 - part 4.

My address decoding circuits design incorporated Phi2 signal in the decoding scheme. I consulted literature and expertise of knowledgeable people on the 6502 subject and decided this is not the correct approach. I removed the Phi2 signal from address decoders input. The Phi2 signal is now only used to synchronize reading/writing access cycles.


I tested two variants of RTC circuit:



and decided to go with 2-nd one (seems to be more reliable and less susceptible to problems resulting from long propagation times).

My I/O bus (data lines) was not properly separated from CPU bus resulting in bus contention and data corruption. Here is the corrected circuit:

I also have a concept of banked RAM:

The code testing the 74LS374 latch register alone (I just had LED-s connected to the data outputs):

#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <peekpoke.h>
#include "mkhbcos_serialio.h"

char buf1[10], buf2[10];

void my_pause(uint16_t delay)
    int i = 0;

    for(i=0; i < delay; i++);

int main(void)
    int i = 0;
    unsigned char n = 0;
    char buf[5] = {0};

    puts ("Hello! Testing port I/O #0 and latch 74LS374.\n\r");
    puts ("Press ENTER and observe the blinking lights...\n\r");


    for (n=1, i=1; i<256; n++,i++) {
       buf1[0] = buf2[0] = 0;
       strcpy(buf1, itoa (i, buf2, 10));
       puts(buf1); puts("\r");

    for (i=0; i<10; i++) {

    puts ("Test finished.\n\r");

    return 0;

Pictures of my prototype for your enjoyment (electronics hardware porn :-)) and some screenshots of serial command interface:



That would be all for today.

Thanks for visiting my blog.


Wednesday, November 25, 2015

Update on MKHBC-R1, 6502 based home-brew computer: UART - finished!

I finished assembling the UART card. At this time I test the system outside of the mother-board. I also added (temporarily) ZIF sockets to CPU card for EPROM (since the system is still in development, this will be very useful) and for CPU. You may be wondering why did I have a need to have a ZIF socket for a CPU? Well, some time ago I bought from e-bay a lot of eighteen R6502P chips very cheap. I have never had a chance to test them. Now came their time. I dropped each in the ZIF socket and tested them in my system. All worked fine, so future looks bright for any new 6502 based projects.
I've published a short demo on youtube of my working system.

Working system with one of R6502P CPU-s I've been testing in the ZIF socket and CPU speed jumper set to 0.9 MHz (my standard configuration is R6502AP with 1.8 MHz clock). The voltage is a bit low here (4.6V). I improved the connections a little bit and later got 4.8V, a bit more acceptable and within tolerance.
I use my port of Meadow Operating System (which is really a monitor program working over serial port) to control the system, upload and run programs on it. Above - Tiny BASIC is being uploaded to RAM.
Tiny BASIC uploaded and running. Time to play some game. Euphoria is a small kingdom simulator written in Tiny BASIC.
Lot of 18 6502 CPU-s.

Monday, November 23, 2015

Update on MKHBC-R1, 6502 based home-brew computer: UART

I made some changes to the circuit diagram. In order to generate proper net list, I replaced labels connected to CPU bus with labels connected to buffered I/O bus in slot #4. I included detailed comments on the diagram drawing. The UART card of course can be connected to any I/O slot or directly to the CPU card, with proper programming changes. The concept is explained in design document that I referenced earlier in this blog.
I also corrected PCB layout as I missed two components when I updated it last time: jumper JP8 and resistor R7.
I started to assemble the board, it should be finished soon. I made most of the GND connections for now. Updated circuit diagram, PCB layout and pictures of the board are included below.


Thursday, November 12, 2015

Update on MKHBC-R1, 6502 based home-brew computer: UART

I made some modifications to the circuit diagram (added jumper switches) and created a PCB component layout for my UART card. The layout is not too elegant and appears wasteful, because I will make the circuit on the slightly over-sized prototyping board which has some traces and padded holes on the bottom side. I originally planned to make all expansion cards for my computer on such boards, since they have some traces in addition to pads and padded holes (which BTW do not cover all the board's surface evenly). Due to that they are suitable for less dense component placement than is required on CPU bus cards. If you care to compare this one to my CPU card board, which is made on the different prototyping board, smaller but equipped with padded holes spread evenly across the entire surface and no traces, you will understand why. I simply can make more point to point connections and pack components closer together on the board with padded holes only versus a bigger board but with less holes and with some traces on the bottom.
Next step - point to point soldering of the UART card. This should be far less work than CPU card.


Testing CPU card in the mother-board. The "mobo" still lacks power supply, interrupt controller and I/O port - just passive CPU bus and buffered I/O bus (black slots in the back).

In front, the prototyping board which will host UART circuit.