I've been spinning my wheels on this for too long and thought I'd ask for help here. I am probably missing something simple. First, I'm a Mac user. I have a MacBook with a USB-TTL adapter based on FT232R. I have it in 5V mode.
Adapter is this:
DSD TECGH SH-U09C5 USB to TTL UART ConverterACIA 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:
picocom --baud 19200 --flow h --parity n --databits 8 --stopbits 1 /dev/cu.usbserial-AB0KNYFS
So here's what works and what doesn't work.
When 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:
; 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
Here's what I have for interrupt handling:
Code:
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
I've found a few examples and can't get this working yet. I hope it's something small/silly I'm missing here. Any help is appreciated. I don't care about processing the input yet, I just want to get it out of the ACIA so the IRQ resets. I think I can handle the rest if I can overcome this hurdle.
Here's the scope.
1: CTS
2: TxD
3: RxD
4: IRQB
Attachment:
SDS00086.png [ 28.25 KiB | Viewed 1048 times ]