tebl/RC6502-Apple-1-Replica

How to write to digital I/O LEDs?

Closed this issue · 5 comments

Hi, thanks for a great SBC. I've assembled a number of additional components like the Joystick/Digital I/O board and the VDU too. So far, everything works except I don't know how to write to the LEDs.

I tried using WozMon to write to the same address I can read the buttons from (A000) but nothing happens -- the LEDs are just always on. Is there some direction register I have to set or something?

tebl commented

Hmm, I tried running this in BASIC:

> POKE -24576, 0  
> POKE -24576, 255 

And the lights remained solidly on. I think -24576 is the correct location for $A000 right? I'll try a machine code program soon.

Edit: Here's a Krusader Assembler session

? L
000        LDA #$0
001        STA $A000
002        RTS
? A
0300-0305
? R $0300

?        

Running this program doesn't seem to affect the LEDs either. I'm at a loss..

Edit: Strangely, running from $0000 does change the LEDs -- only the first one remains on. Not sure how helpful that is, but it does suggest that the CPU can talk to the LEDs in some way.

tebl commented

Alright, I've ordered some 374's. When they arrive I'll see what happens.

This worked! So it should be 74LS374 rather than 74LS373.