Ok, my Rockwell ACIA was a dud. Got it off ebay, and I get bus contention on the D7 data bus line. unhook the ACIA from that line, computer works. I noticed that that pin is floating all over the place at power up. I think it got zapped.
So, until I get suitable replacements, its back to the WDC parts I have.
Ok,I have a running program that just counts from 0 to 255 and starts over, and displays the result in binary on some LED's using the VIA. Works just fine.
I thought a good first test of the ACIA would be to just transmit the same byte to it that I am sending to the VIA.
I'm getting nothing out of the TXD line (watching for activity with scope)
Scope confirms that address decoding is correct (CS0 HIGH, CS1 LOW, R/W LOW at the same time as 00 on the RS lines).
PH2 and Baud rate clock both present and clean.
DSR DCD and CTS are tied low
RxD DTR RTS and XTL0 N.C.
1.8432 oscillator can on XTL1
I have no activity on the TxD line at all. I feel there is enough delay in my code to make the WDC65c51 bug not an issue.
here is my code. Comments MAY be wrong. I've been trying things so long I'm not sure I've been faithfull at updating them.
Code:
*=$8000
start:
LDX #$FF
TXS
LDA #%00011110 ;ACIA control reg set for 1 stop, 8 data, 9600 baud
STA $5001 ;reset ACIA
STA $5011 ;setup control reg
LDA #%00001011 ;no parity, no echo, no transmitter IRQs, no reciever IRQ, enable tranciever
STA $5010 ;setup command reg
LDA #$FF ;load accumulator with all ones for VIA DDRs
STA $6003 ;set PORTA DDRsto all ones
LDA #$00 ;start counter at 0
STA $200 ;counter is in begining of 2page
counter:
LDA $200 ;get counter value
STA $6001 ;display counter value on port A of VIA
STA $5000 ;send to ACIA
CLC
INC $200 ;increment the counter
LDX #$7D ;put 1/4 ms in X
JSR DELAY
JMP counter
DELAY:
LDY #$FF ; Put the desired value in X before JSR'ing to DELAY.
d1:
DEY
BNE d1
DEX