Adapter is this: DSD TECGH SH-U09C5 USB to TTL UART Converter
ACIA is a Rockwell 6551 (R6551AP)
USB adapter connections:
GND --> breadboard ground (same ground as ACIA)
TX --> RxD on ACIA
RX --> TxD on ACIA
RTS --> CTSB on ACIA
CTS --> RTSB on ACIA
The ACIA is connected using Garth's decode logic, so it's at $4400 DCDB and DSRB are tied to ground.
This is what I'm a little fuzzy on. I have the IRQB lines from two VIAs plus the R6551 going to a CD74HC21E. My thought here was that this would go low if any of the irq lines went low. The unused input is tied to high, and the line from the R661 is tied high with around 3.2k ohm (3 x 1k, and a 220 ohm, this is what I had on hand).
From my Mac, I'm using pico com. Here is my command line:
Code: Select all
picocom --baud 19200 --flow h --parity n --databits 8 --stopbits 1 /dev/cu.usbserial-AB0KNYFSWhen I send output from the 6502, I see it on my PC. When I type a letter on my PC (sent to the 6502), I see the 6551's irq line go low, and on my scope I can decode the serial line and see the key pressed. The scope shows the data on RxD, CTSB stays low and IRQB goes low. But IRQB stays low, so I don't think I'm handling the receive interrupt properly. The ACIA repeatedly sends a character back ("D") in a loop. I don't know where it's getting that.
Here is what I have for setup:
Code: Select all
; initialize acia
lda #$00
sta ACIA_STATUS
lda #%00001001 ; $09 - No parity, no echo, interrupt enabled
sta ACIA_COMMAND
lda #%00011111 ; $1f - 1 stop bit, 8 data bits, 19200 baud
sta ACIA_CONTROL
cli ; clear interrupt (enable)
jsr loop
Code: Select all
irq:
pha
lda ACIA_DATA
; debugging; this sends a char to the LCD.
; this sends the same char indefinitely.
; lda #$41 ; "A"
; jsr print_char
bit ACIA_STATUS ; reset interrupt of ACIA
irq_end:
pla
rti
Here's the scope.
1: CTS
2: TxD
3: RxD
4: IRQB