Hi,
The 65c51 arrived yesterday and it is running fine!
For the moment, as I don't have some glue logic IC's yet (74HC30 and 74HC138) to do Daryl's SBC 2.5 address decoding and now I am only using one I/O IC I am using the one that Garth shows in his primer, modified for my system:
Attachment:
gluelogicv1.png [ 31.33 KiB | Viewed 4242 times ]
I have tried it up to 4Mhz and it works well, despite the mess of long wires I have and that the 65c51 it's a 2Mhz part.
The bootstrap code I'm using is that simple:
Code:
.org $8000
BOOT_START = $E800 ; start of atmega mapped ROM
BOOT_END = $0000 ; end of atmega mapped ROM+1
STZ $8888 ; tell ATMega we are at boot start point
BOOTSTRAP_INI
LDA #<BOOT_START
STA $E2
LDA #>BOOT_START
STA $E3
LDY #<BOOT_END
LDX #>BOOT_END
BOOTSTRAP_LOOP
LDA ($E2) ; read from ROM
STA ($E2) ; write to RAM
INC $E2
BNE BOOTSTRAP_LOOP2
INC $E3
BOOTSTRAP_LOOP2
CPY $E2
BNE BOOTSTRAP_LOOP
CPX $E3
BNE BOOTSTRAP_LOOP
STZ $8889 ; tell ATMega we finished
JMP ($FFFC) ; jump to reset
The ATMega have virtually mapped this code into their flash in $8000 and Daryl's SBC monitor into $E800, during the boot process the atmega drive phi2 manually and controls the glue logic so all the read from bootstrap and ROM ranges are made to it, and all the writes to $E800-$FFFF are made to RAM, all the rest are ignored and the 65C02 is feeded with NOP if it issues a read from any other memory range.
Once the boot is complete the ATMega enable permanently his glue logic output and puts his OC1A output (it is the phi0 input of 65C02) into CTC mode at 4Mhz frequency and enter in a endless loop doing nothing.
By the way I have upgraded the reset circuit with a DS1813.
I'm very happy that although I had not this updates in mind when I built the sbc it adapted very well without doing changes to the original board, I'm waiting impatiently for the rest of the pieces to continue.