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};

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

    gets(buf1);

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

    for (i=0; i<10; i++) {
       POKE(0xC000,0);
       my_pause(2000);
       POKE(0xC000,0xFF);
       my_pause(2000);
    }
    POKE(0xC000,0);

    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.

12/9/2015
MK

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.
11/25/2015
MK

Reset And Panic Buttons, Buttons Debouncing

Reset And Panic Buttons, Buttons Debouncing The monitor program in my home brew computer has a nice debug feature. The NMI (Non-Maskab...