I'm shifting out 24 bits. The device I writing to is a I/O portexpander MCP23S17 from microchip. I've tried the other methods and the portexpander does not respond to them. The only way to get it to recognize any commands, was to send them out like this.
WR_OPCODE_BYTE con $40
INTCONA con $04
Shiftout SDO,SCK,Msbfirst,[WR_OPCODE_BYTE,IOCONA,$A0\24]
I don't know what the problem is with this. I know now it is incorrect but it works. The other ways do not.
There are two programs I wrote using the portexpander in PicBasic Pro. The first one only works as stated above. The other one works correctly if I use
Shiftout SDO,SCK,Msbfirst,[WR_OPCODE_BYTE,IOCONA,$A0]. Both use pretty much exactly the same code as it was copied and pasted from the first program into the second one. I can't put all the code on here as it was over 3000 lines of code.
Thanks,
Bryan
Bookmarks