ariesboy571
Active member
Hello all. So here's a weird-o...
I have an SPI device, which, as it turns out, seems somewhat electrically unstable. It likes to hang itself, every little while.
That, in and of itself, is not such a problem, as it has an I2C component as well, with which I can reset the entire device...if I can detect that it's hanging.
The problem seems to be occurring during SPI.transfer(), when a transfer of about 164 bytes gets interrupted because the hardware just decided to flip out.
Looking around on the web gave me Nick Gammon's solution to the problem for Atmel-series processors: https://forum.arduino.cc/index.php?topic=111350.0
That probably won't work here. I'm looking at the library code for Teensy SPI, and I was wondering if anyone had any suggestions for what to do:
What I need to do is have either an absolute timeout; i.e., "if I haven't completed this in micros() microseconds, it's a failure, set a flag somewhere and return" or "this is all the bytes I was able to read, it's less than what was asked for, and return", somewhere in SPI::transfer().
Any ideas?
I have an SPI device, which, as it turns out, seems somewhat electrically unstable. It likes to hang itself, every little while.
That, in and of itself, is not such a problem, as it has an I2C component as well, with which I can reset the entire device...if I can detect that it's hanging.
The problem seems to be occurring during SPI.transfer(), when a transfer of about 164 bytes gets interrupted because the hardware just decided to flip out.
Looking around on the web gave me Nick Gammon's solution to the problem for Atmel-series processors: https://forum.arduino.cc/index.php?topic=111350.0
That probably won't work here. I'm looking at the library code for Teensy SPI, and I was wondering if anyone had any suggestions for what to do:
What I need to do is have either an absolute timeout; i.e., "if I haven't completed this in micros() microseconds, it's a failure, set a flag somewhere and return" or "this is all the bytes I was able to read, it's less than what was asked for, and return", somewhere in SPI::transfer().
Any ideas?