Don't give up too fast. Why do you think it will be better with a 65816 in November? How do you programmed your ROM? Can you proof that it still contains the right data? Last weekend I placed my EEPROM wrong into my breadboard (shifted by one hole) and the then wrongly connected wires wrote several bytes into to EEPROM in cause of a flapping or floating R/W line. (but I was not aware of this) After I moved the EEPROM to the correct position, the whole system behaved really strange and I was looking for a problem with the wiring. About half an hour I was looking for the bug in my setup, until I checked the content of the eeprom and wrote the correct data again. Placing the ROM with correct data to the correct place, the system worked as expected immediately.
I think the shortest programm for testing is an infinite loop by doing something like this:
Code:
.org $e000
jmp $e000
then set the resetvector to $e000 and watch what happens on the address- and data-bus. So you only have to write 5 bytes to your ROM.
I've done a lot of testing without RAM on my system. The only thing is, that you cannot use the stack or store data in other places then X,Y and A. But this is still enough to create delay loops and let one address-line flap in a defined period. This can really easy be monitored with an oscilloscope or a logic analyser.
I also played with two 74HC574 octal D-flip-flops using one as input and one as output, still without RAM in my system. I hooked up 8 LEDs (over a ULN2803 darlington driver) to the output lines to have some visual feedback.
Here's the code for that. It's long, because of the missing RAM, but it takes the byte from the "input" chip and writes the byte to the output chip. wait a while and then let all LEDs blink several times. then start again. Once the simple 8-bit output works (without the need to interact with a VIA chip), you can easily create debug output by switch on the LEDs one by one whenever a block of code has been completed.
Code:
.org $e000 ; start at $e000
.outfile "output.bin" ; name the file
.scope
start:
;LDA $a000 ; read the pattern from the first chip
;STA $c000 ; store the pattern on the second chip
LDX #$00 ;
outer1: LDY #$00 ; wait a second
inner1: NOP ;
NOP
NOP
NOP
NOP
INY ;
BNE inner1 ;
INX ;
BNE outer1 ;
LDA #$00 ; LEDs off
STA $c000
LDX #$00 ;
outer2: LDY #$00 ;
inner2: NOP ;
INY ;
BNE inner2 ;
INX ;
BNE outer2 ;
LDA #$ff ; LEDs on
STA $c000
LDX #$00 ;
outer3: LDY #$00 ;
inner3: NOP ;
INY ;
BNE inner3 ;
INX ;
BNE outer3 ;
LDA #$00 ; LEDs off
STA $c000
LDX #$00 ;
outer4: LDY #$00 ;
inner4: NOP ;
INY ;
BNE inner4 ;
INX ;
BNE outer4 ;
LDA #$ff ; LEDs on
STA $c000
LDX #$00 ;
outer5: LDY #$00 ;
inner5: NOP ;
INY ;
BNE inner5 ;
INX ;
BNE outer5 ;
LDA #$00 ; LEDs off
STA $c000
LDX #$00 ;
outer6: LDY #$00 ;
inner6: NOP ;
INY ;
BNE inner6 ;
INX ;
BNE outer6 ;
JMP start ; start again
.scend
;
.advance $fffc ; fill up to reset vector
.word $e000 ; set reset to $e000
.word $0000 ; fill last vector to $0000
This is my "documentation" for this setup:
Quote:
using 2 74HC574 octal D-FlipFlop as 8-bit in/output ports
hardware:
W65C02S CPU
AT28C64 EEPROM
74HC138 3-to-8 decoder
74HC04 hex inverter
74HC00 quad 2-input NAND
the 6502 MPU is only connected to a clock source and
address- and databus is connected directly to an eeprom
containing the romtest image.
addressdecoding is done by a 74HC138 with A13-A15 connected
to the 3 inputs of the decoder.
O7 ($e000) connects directly to /CS of the eeprom.
O6 ($c000) is inverted and connected with phi2 inverted to an NAND gate
providing a positive pulse on the CLK input of the 74HC574. The /OE input
is connected to GND, because the output data should always be active, not
only when the chip is selected.
O5 ($a000) is inverted and connected with phi2 inverted to an NAND gate
providing a positive pulse on the CLK input of the second 74HC574.
O5 is also connected to the /OE input of the second 74HC574, that is used
as 8-bit input. This is needed, because the chip should access the databus
only if it is selected, otherwise it would always write the inputdata to
the databus, poisening the signals there.
using and AND (74HC08) would reduce teh chipcount because phi2 and CS
are need and AND function to create the positve flank for the trigger.
at the moment the R/W signal is not involved in the address decoding
by doing this two 74HC574 could be addressed on the same location,
providing 8 digital inputs when reading the address and 8 digital outputs
when writing to the address.
Mario.