If I understand Garth's primer correctly the ROM is selected with A15 goes high (A15 is inverted and OE and CS goes low so ROM is selected).
The RAM is selected when the clock is high A15 is low and A14 is low (address $0000-$3fff).
The VIA is selected when the A15 is low, A14 is high and A13 is high.
R/W is connected to W (pin 27 on the RAM).
Have I got this correct?
I wrote a small program that put PA and PB first high then low then high again with a delay of ca 5 sec in between. The program works in another computer and so does all other ICs but that computer has a modified version of 8Bit address decoder.
In my minimalist computer nothing happens.
Code: Select all
;;;
;; coldstart - initialises all hardware
;; power up and reset procedure.
;;;
coldstart: .block
sei ;Turn off interrupts
cld ;Make sure MPU is in binary mode
ldx #0
l1:
stz 0,x ;zero ZP
dex
bne l1
dex ;effectively ldx #$ff
txs ;Initialise stack register
jsr via_init
cli
;;;
;; test code of CPLD's decoding part.
;; Blink a LED every second connected to PA0 on VIA.
;;;
lda #$ff
sta via1ddra ; set all PA pins to be outputs
sta via1ddrb ; set all PB ping to be outputs
loop:
lda #$ff
sta via1ra
sta via1rb
; bra loop
jsr delay
lda #0
sta via1ra
sta via1rb
jsr delay
bra loop
delay: .proc
ldx #$20
loop1:
jsr one_sec_delay
dex
bne loop1
rts
.pend
one_sec_delay: .proc
phx
phy
ldx #$ff
loop1:
ldy #$ff
loop2:
dey
bne loop2
dex
bne loop1
ply
plx
rts
.pend