Is it possible to utilize the address auto-increment feature of some SPI devices with the Arduino SPI library? Basically, reading the datasheet of the MCP795xx family of real time clocks, after you send a READ request, as long as you continue to send SCK pulses, the RTC will automatically increment the internal address pointer so you can quickly shift all the register data out of the device.
"After the READ instruction and address are sent, the
data stored in the memory at the selected address is
shifted out on the SO pin. Data stored in the memory at
the next address can be read sequentially by
continuing to provide clock pulses to the client. The
internal Address Pointer automatically increments to
the next higher address after each byte of data is
shifted out. The Address Pointer allows the entire
memory block to be serially read during one operation.
The read operation is terminated by driving CS high"
You have nothing to add in your code to use the auto-increment feature of this SPI device. As you said, just send SCK pulses or whatever, and the address will auto-increment automatically. What do you want to do exactly ?
I wasn't sure about the syntax to do this but I realized that on reading data, SPI.transfer() ignores whatever's passed to it so I can just call it over and over with a dummy argument and it and I'll get all the data I need.
I'm actually finding the feature a bit irritating now, since the chip seems to always auto-increment starting from the first address you pass it. For instance, if I want to read or write two non-consecutive addresses, I have to pull the SS pin high then low, send another READ/WRITE instruction then pass the new address.
If I don't re-select the chip like above, dataB will end up with the data from address 0x04 due to the auto increment feature. It ignores new instructions and addresses until it's reselected.