Probable race condition in Radiohead library

Hi,
I think I found the real root cause of the issue. For a Teensy 3.5 at 72 MHz or above the 100ns Hold-up time for NSS after the falling edge of the SCK line is not adhered to. At 72 MHz the timing margin is too narrow, at 96 and 120 MHz NSS rises high already when SCK is still high. For details see attached.
A workaround is described as well.
Something nice with a real defined delay at the end of the last spi clock cycle is a bit too much for my current coding skills within these myriad of files.
But I might get there.
Pim
 

Attachments

  • Teensy 3.5 and Semtech SX1276 debug PA2PIM V0.3.pdf
    921.1 KB · Views: 1,758
I'm having the same issue with RH_ASK. It's freezing on the second call to driver.waitPacketSent(0)
Using TeensyDuino 1.3.6 and the most recent zip of RH from GITHUB.
 
Hi,
  1. Github is large but not the place where the latest RH library is. It can be found here: http://www.airspayce.com/mikem/arduino/RadioHead/
  2. The ASK interface is not based on SPI unlike the RF95 interface which is based on SPI. Hence the solution above very likely is not applicable.
Pim
I'm having the same issue with RH_ASK. It's freezing on the second call to driver.waitPacketSent(0)
Using TeensyDuino 1.3.6 and the most recent zip of RH from GITHUB.
 
Hello!

I'm having the same problem, stuck at rf95.waitPacketSent(); with and example code from Dragino that can be found here:
https://github.com/dragino/Arduino-Profile-Examples/blob/master/libraries/Dragino/examples/LoRa/LoRa_Simple_Client_Arduino/LoRa_Simple_Client_Arduino.ino

I'm using an ATMega328P with a 3.3v power supply @ 8MHz w/external xtal; and a Lora BEE module pre-loaded with 915Mhz freq.

Can anyone help me? I'm testing those modules and don't know where to go from here. Thank you in advance!
 
Although you are using an AtMega 328 rather than a Teensy, you may be running into the same issue discussed in the first 10 or so posts in this thread. The fix for that issue was incorporated into the Teensyduino v137 distribution. The fix was only implemented for the RF95, and to my knowledge it has not been incorporated into any other versions of the RadioHead library. The Teensyduino version can be found here: https://github.com/PaulStoffregen/RadioHead

Some confusion exists as later in this thread PimN identified another issue that he ran up against and posted links for a version of RadioHead that fixed his issue. His library does not contain the fix for the race condition issue originally discussed. Your problem may be related to either or both of the issues discussed in this thread. I suggest that you incorporate the fixes from the Teensyduino RH lib and then the lib linked by PimN in hopes that one of them solves your problem.
 
Back
Top