This shifts out 2 bytes followed by 24-bits all zeros;
Shiftout SDO,SCK,Msbfirst,[WR_OPCODE_BYTE,IODIRA,$00\24]
This shifts out 3 bytes;
Shiftout SDO,SCK,Msbfirst,[WR_OPCODE_BYTE\8,IODIRA\8,$00\8]
This shifts out just 3 bytes;
Shiftout SDO,SCK,Msbfirst,[WR_OPCODE_BYTE,IODIRA,$00]
If you need 2 bytes WR_OPCODE_BYTE & IODIRA followed by 24-bits, then simply use the first version.
As in the manual, if you don't specify the number of bits, then 8-bits are shifted out. If WR_OPCODE_BYTE & IODIRA are byte variables with only 8-bits, then you don't need to tell it to shift out 8-bits per variable. It's automatic.
If either one was larger than 8-bits, then you would need to specificy this with the /#bits here option.
And - if you need 24 x 0 bits shifted out after the 1st two variables, then neither of your other routines are going to do that, so it doesn't work.
In your 1st version you're shifting out a total of 5 bytes. In your 2nd two just 3 bytes.
Bookmarks