Hi there,
i have a strange problem.
i'm working on my W6502SBC code, implementing Wozmon.
But first I wanted to make sure that the W65C51 (incl. adapter) works properly.
So I created a few small routines that write and read.
The write part now works satisfactorily. The only problem is the reading part.
The status register always returns a $30, i.e. (due to the transmit bug) unfortunately bit 3 ($08) is never set, no matter what I send via USB/serial adapter.
And if I still read the RDR I always get a #$02.
Hardware-wise everything seems OK, I can see with my oszi the signal from pin 12,
What am I doing wrong?
Here is the code:
Code:
do_serinit:
pha
; ACIA setup
stz ACIA_STATUS
lda #%00011110 ; 8-bit, 1 Stop bit, Baudrate, 9600 Baud
sta ACIA_CONTROL
lda #%00001011 ; no parity, no echo, transmit irq disabled, no receiver irq, DTR High
sta ACIA_COMMAND
pla
rts
main block:
Code:
lda ACIA_STATUS
jsr lcd_bhexout ; just to see the content of the status reg in my LCD
lda #" "
jsr lcd_chrout
ldy #$ff
@SERINL1:
dey
beq @SERIN3 ; don't block the reciever
lda ACIA_STATUS ; Check to see if the buffer is full
and #$08 ; mask rx buffer status flag
BEQ @SERINL1
@SERIN3:
lda ACIA_RX
jsr lcd_bhexout ; showing the A as Hex on my LCD
jsr ser_chrout ; sending A as chr
_________________
don't count on me, i'm engineer (Animotion)
my arduino pages:
http://rcarduino.de