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;
}
That would be all for today.
Thanks for visiting my blog.
12/9/2015
MK