Still reading to catch up
On thing I saw was
Interrupt vector for SIO only being for channel B
There is only one Regester to store the vector address for the whole chip and it is set and read via The be regesters
Think grant uses a vector of 60
So the code and the vector must match
I wondered about this myself, C. I don't know enough about the SIO or interrupts in general to know what's going on there. It seems to me from Grant's code that he's just setting up the interrupt on port B. In his design, he's primarily using port B to interface to a computer. I'm wondering if he's mentioned the use of a TTL connection on port A, but forgotten to create the necessary interrupt for it in case it is the primary means of communication with a host?
So, should I remove the interrupt on B (as I'm not using it - but may later down the line to implement an I2C interface, but let's not get ahead of myself!) and copy/paste the interrupt code to set up the interrupt on A? Would the code be the same, except for referencing SIOA_C instead of SIOB_C? i.e.:
LD A,$02
OUT (SIOA_C),A
LD A,$60 ; INTERRUPT VECTOR ADDRESS
OUT (SIOA_C),A
Would that work, or does the command ($02) need to be changed too?
I've checked the monitor code - $60 is a valid address for an interrupt:
;------------------------------------------------------------------------------
; SIO Vector = 0x60
;------------------------------------------------------------------------------
.ORG $0060
.DW serialInt
Thing is, I've inserted a debug print into the interrupt code and it's never called;
;------------------------------------------------------------------------------
; Serial interrupt handlers
; Same interrupt called if either of the inputs receives a character
; so need to check the status of each SIO input.
;------------------------------------------------------------------------------
serialInt:
PUSH AF
PUSH HL
PUSH AF ; DEBUG
LD A,'X' ; DEBUG
RST 08H ; DEBUG
POP AF ; DEBUG
; Check if there is a char in channel A
; If not, there is a char in channel B
SUB A
OUT (SIOA_C),A
IN A,(SIOA_C) ; Status byte D2=TX Buff Empty, D0=RX char ready
RRCA ; Rotates RX status into Carry Flag,
JR NC, serialIntB
As you can see, I should be seeing the letter 'X' every time the interrupt routine is called, but I'm getting nothing like that from the SBC. It's getting as far as checking serABuff and getting stuck in the loop I mentioned previously.