Re: Port alias in Port Expanders (MCP23S17)
Thanks I will try that!
I have made some progress but I still need a way to get from 1 byte which will tell me which of the 16 outputs to turn on.
Current test code:
Code:
OutA=$FFFE 'Initial value for word var
OutA_hi=OutA.highbyte 'Splits into hibyte
OutA_lo=OutA.lowbyte 'And into low byte of the word var
OutA_lo.3=0 'Bit mod
OutA_hi.5=0 'Another bit mod
OutA_MCPReg = OLATA 'Sets up PORTA output
OutA_DataOut=OutA_lo 'Sets up data to be pushed to the MCP23S17 as the low byte
gosub SEND_OutA_2317 'Send it
pause 10 'Wait a bit
OutA_MCPReg = OLATB 'Sets up PORTB output
OutA_DataOut=OutA_hi 'Sets up data to be pushed to the MCP23S17 as the hi byte
gosub SEND_OutA_2317 'Send it
This gives me what I want - EXCEPT - for that I have to resolve 1 byte into a word and figure out how to get the pointer right........
starting with a byte var which has a value from 0-15 to a specific bit on the MCP23S17 still evades me I am afraid.
"If we knew what we were doing, it wouldn't be called research"
- Albert Einstein
Bookmarks