despite the example working exactly as it should... I am having a headache on morphing it into
my application.
I am successfully running SPISlave_Test.ino on an ESP8266, and
"SPISlave_Master.ino" on a Teensy 3.6.
I set my Rigol oscilloscope to decode the SPI data on MOSI and MISO, triggering on slave select.
OK, fine, I see all the letters decoded, but something is odd, literally.
I see the "Are you alive" on MOSI in one transaction,
and the "Alive for xxx milliseconds" on MISO, in the next transaction.
Looks like half-duplex to me.
Shouldn't these both occur in the same transaction (Full-Duplex)? (I thought SPI was full duplex in normal conditions, that master and slave write to half the transaction time window each respectively, in opposite directions.)
Is the missing transaction interrupt that Vince mentioned responsible for half duplex limitation in the
main spiSlave library? I believe he said that the transfer interrupt he hooked into by adding code, fired on every event, and the other interrupts like data and status fired less often. In the normal Arduino SPI library, SPI.Transfer is where full duplex transfer occurs, no? I would like to Vince's code containing the added interrupt handler, maybe that is full duplex-capable code? Or maybe I confused myself into a corner.
I cannot tell if the half-duplex behavior is happening due to the way the library is set up internally, or a consequence of the way the library is being used in the example sketches. I am stuck from investigating that, because I am stuck more trivial matters, such as string to byte conversion confusions, because the examples are all about strings in and out, "char * weirdness", (sorry, this is the first time I saw that species of string play) and I am trying to avoid using strings.
I an sending an array of sensor values read from a linear photodiode array.
The device has 256 pixels, and I use two bytes per pixel to represent the 10 bit light intensity value for
each pixel. So I am trying to send 512 bytes through the SPI somehow, and then on to Wifi eventually when I get SPI working.
For my application, I want to send 512 bytes of data through the SPI protocol from "master Teensy 3.6" to "slave ESP8266", and don't really care about sending the other direction, except if needed for flow control, etc. If I do a flow control, then this half duplex limitation explained above, may cut transaction event frequency in half versus full duplex transactions?
But first things first. String manipulation code in the examples has me confused. Can someone show me the library being used with simple byte[] arrays? Please show me how to send myBytes[512] through the pipe from master to slave. I am stuck for days on this confusion, and its giving me a headache, because of too many unknowns. I appreciate any help greatly, thanks in advance.