blaine,
I think this might work for you.
It uses the same numbers that you were expecting before.
PORTA.0 = 0
PORTB.0 = 8
PORTE.1 = 33
Code:
P = 33 : gosub SetSerinPin
GOSUB SerinP2
SerinP2 will return 1 byte from the selected PIN. Received data will be in Commbyte.
Code:
;-----------------------------------------------------------------------
@P_A = PORTA ; Find address for PORTA
P_A CON EXT
PinPort VAR WORD ; Address of selected Port
PinBit VAR Byte ; Bit Mask of selected port
SetSerinPin:
PinPort = P_A + (P >> 3) ; PORTA + P/8 Find selected PORT
PinBit = DCD (P & %111) ; create BIT mask
return
SerinP2: ; Get a BYTE from the specified PORT
RM1 = PinBit
RR1 = PinPort.LowByte
RS1 = PinPort.HighByte
@ SERIN2MODE?C 49236
@ SERIN2?B _Commbyte
RETURN
@ ifdef doesnotcompile ; Force PBP to include SERIN2 library
SERIN2 1, 1, [Commbyte]
@ endif
;-----------------------------------------------------------------------
Bookmarks