GARTHWILSON wrote:
What does your routine to set up the '51 look like?
Here is the full code for the test program.
Code:
.segment "OS"
ACIADATA = $5000
ACIACONTROL = $5003
ACIACOMMAND = $5002
ACIASTATUS = $5001
VIACONTROLA = $6002
VIACONTROLB = $6003
VIADATAA = $6000
VIADATAB = $6001
NMI_VEC
IRQ_VEC
START
LDX #$FF
TXS
LDA #$00
STA ACIASTATUS
LDA #$1F
STA ACIACONTROL
LDA #$0B
STA ACIACOMMAND
LDA #$FF
STA VIACONTROLA
STA VIACONTROLB
LDA #$AA
STA VIADATAA
STA VIADATAB
LOOP
LDA #$2A
STA ACIADATA
JSR WAIT_6551
LDA ACIASTATUS
STA VIADATAB
; AND #$08
; BEQ LOOP
LDA ACIADATA
STA VIADATAA
JMP LOOP
WAIT_6551
PHY ;Save Y Reg
PHX ;Save X Reg
DELAY_LOOP
LDY #2 ;Get delay value (clock rate in MHz 2 clock cycles)
MINIDLY
LDX #$68 ;Seed X reg
DELAY_1
DEX ;Decrement low index
BNE DELAY_1 ;Loop back until done
DEY ;Decrease by one
BNE MINIDLY ;Loop until done
PLX ;Restore X Reg
PLY ;Restore Y Reg
DELAY_DONE
RTS ;Delay done, return
.segment "VECTORS"
.word NMI_VEC
.word START
.word IRQ_VEC
GARTHWILSON wrote:
We all have those episodes where we fight for a week with something that turned out to be caused by a really silly error.
I couldn't agree more, i can only thank you all for persevering with me!
GARTHWILSON wrote:
I'm left wondering if the false-start detection (possibly from the baud rate not being agreed on) or anything else is keeping it from responding to a byte.
I'm struggling a little on how to check for fasle-start or baud rate issues. Inspecting the block diagram i can see RxC is fed into the dividers for both Tx and Rx. So in the loop back test they should be at least be sync'd. Scoping the Tx and RxC at the same time shows signals that appear to line up, but RxC is fast as it's yet to go through the divider. But RxC at 308Khz / 16 ~= 1/19200 baud which is what i have set. Am i mis-understanding the point you're making?
8BIT wrote:
Remove the loop back and run the test again. The read data should not match.
Strange behavior continues, disconnecting the loop back (and checking for any wiring mishap with the scope) is still showing my test value on the VIA output. This could seemingly invalidate the above discussion, as a read and transmit register should not be shared.