Code:OutA var word asm OutA_hi=OutA OutA_lo=OutA+1 endasm OutA_hi var byte EXT OutA_lo var byte EXT
the easy way
ps I hope I got the endianness correct if not swap the hi byte low byte definitions
Code:OutA var word asm OutA_hi=OutA OutA_lo=OutA+1 endasm OutA_hi var byte EXT OutA_lo var byte EXT
the easy way
ps I hope I got the endianness correct if not swap the hi byte low byte definitions
Last edited by richard; - 2nd January 2016 at 23:33.
yep I did get it wrong (choice of two I will pick the wrong one every time)
found my endianness note
MyVar =$AABB would be stored little-endian. I.E. if the address
of MyVar starts at 30h, then $BB will be stored at 30h followed by $AA at 31h
so
Code:asm OutA_hi=OutA+1 OutA_lo=OutA endasm
Thanks, I will give that a try.
Now if I could write both bytes at the same SPI communication, that would be an even bigger win!
"If we knew what we were doing, it wouldn't be called research"
- Albert Einstein
If you have the MCP23S17 IOCON register set to it's default setting of $00 that sets the chip to 16-bit mode (BANK=0) with auto address increment enabled (SEQOP=0).
In that mode you can send register address byte = $14 (OLATA) and then write the two data bytes and they'll go to OLATA and OLATB.
That is exactly what I was looking for!
I thought I had done this before but could have been mistaken.
Will try later this evening.
Thanks!
-Steve
"If we knew what we were doing, it wouldn't be called research"
- Albert Einstein
Bookmarks