I just need to get something clarified
do you refer to the togling of the SS pin (opSS.Write(false) and opSS.Write(true)) in the SendBytes method?Handshaking the SPI using the managed code is *really* painful: maybe slower than a turtle.
static void SendBytes(byte[] bWrite, byte[] bRead) { opSS.Write(false); spi.WriteRead(bWrite, bRead); opSS.Write(true); }Actually that's and old implementation, my current SendByte method looks like this:
static void SendByte(byte bWrite) { var bRead = new byte[1]; spi.WriteRead(new byte[] {bWrite}, bRead); }But that should almost be the same since the spi.WriteRead(...) automatically toggles the SS pin.
The L6470 needs the SS pin to toggle (...After each byte transmission the CS input must be raised ....)
So the problem is the spi.WriteRead(...) is slow when it toggles the SS pin it's not slow writing bytes?
And what you say, is that this can be done much faster by implementing the hardware fix (just like nakchak suggests earlier in this thread)?
I haven't had any performance issues with my approach and setup so far, and it hasn't been a show stopper. But I can see that it's not "fast" when I send many bytes like in the Setup motor method.
So I will definitely look into your very thoroughly described hardware fix, thanks a lot for you input, it's very much appreciated
Regards
Kristoffer