I have an SPI peripheral that requires an unusual number of bytes clocked in (25) which is annoying that it won't divide by 8..
As far as I can tell, I can't find a way to interrupt the spi_transfer function part way through clocking out, it will just churn through those 8bits! Another part of the problem is it is on same bus as another SPI device that DOES divide by 8 (reasons why this is a problem further on):
Bit banging - I have bit banged the 25bits and performance is good, however when using the Arduino SPI library I have to call SPI.end() and then SPI.begin() after I'm done (this takes 20uS to init)
SPI HW for 24bits and 1x bit banged bit - Again similar problem to #1; just doing a digitialWrite to the SPI pins doesn't seem to work? It seems to write the pin before SPI has completed messing it up (non blocking?). This would be the ideal solution as i just need to clock in a 0 at the end
Using my own spi_transfer function (copied with blocking) - seems to be the best so far, although I have to also write an init function too..
Any thoughts? Ideally a better way of using the AVR settings (in spi_transfer)
EDIT Solved by clocking in extra zeros at the start (which will get shifted out at the end)