Shiftout() question

Hi....i understand from documentation and some fiddling around (not in that order) that shiftout() is currently written only to support 1-byte of data....could someone please confirm that there is no such restriction if i use SPI....i mean what i need to confirm is that i can shift out as much as 4-bytes of data with a single SPI.transfer().....many thanks....

No, but you can do 4 SPI.transfer calls in a row. It's an 8-bit processor.

thank you Nick for the quick reply and please forgive my ignorance but by No you mean that i can not use a 4-byte data in a single SPI.transfer....i will have to do this 4 times in a row.....much appreciate your help......

Yes that is what I said. SPI.transfer takes a byte argument. It shifts out a byte at a time. That is because the underlying hardware works on bytes at a time. If you do 4 transfers in a row, the resulting output would look like a 32-bit transfer with a small delay between each one, as the SPI.transfer function is called. But that won't matter because the hardware looks at the clock line.


SPI.transfer (0x12);
SPI.transfer (0x34);
SPI.transfer (0x56);
SPI.transfer (0x78);

thank you nick.....much appreciate the help.....