Hope RF LoRa radio board (SPI) working on Uno, but not on 101

Hi Folks

I'm at a bit of a loss on this one and hope someone can point me in the right direction.

I have a Hope RFM95W LoRa radio board that I am using with an Uno and the LMIC-1.5 LoRaWAN library (GitHub - matthijskooijman/arduino-lmic: This library is deprecated, see the README for alternatives.) to communicate with my LoRaWAN base station. This works well.

I need to use this radio on the 101 so that I can use the gyro to detect vibrations. I have connected the board in the exact same manner and the code compiles as is with no modifications, but the communication with the radio board does not appear to work. The code fails when trying to initialise the radio.

The radio uses SPI to communicate as well as a few DIOs for control. I am using the following pins

101 -- RFM95W

3.3V -- 3.3V
2 -- DIO0
5 -- DIO1
6 -- DIO2
9 -- RESET
10 -- NSS
11 -- MOSI
12 -- MISO
13 -- SCK

Are there any subtle SPI (or other) differences between the Uno and 101 that could be causing this issue? The code I am using is the examples/ttn example from the github link above.

Thanks for any assistance.

The library looks perfectly portable, he only problems which come to my mind could be:
3.3 V output IO signals from the 101 vs 5V output from Uno
Different default values (eg. if you write pinMode(OUTPUT) the pin is low on the Uno by default)

Could you check the signals with an oscilloscope?

Ah, thanks for the reply. The voltage levels should be ok as the LoRa module is powered at 3.3v Vcc, so should be the same on both I would think. The default values might be something. I'll need to dig around in the library and see if there is anything expected of the DIO values.

Sadly I don't have a 'scope, so can't do any trouble shooting at that level.

I assume the SPI behaviour in terms of SPI.begin() etc are the same on both boards? SPI timing maybe? Anything different on that side?

Thanks again

Quick update on this one for anyone having similar issues.

Seems like the issue has to do with the higher speed processor that the Genuino runs compared to the UNO. I have some fairly long wires connecting my radio board to the 101 and the library specifies a max SPI speed of 10MHz. The UNO is not able to reach this, so likely runs the connection at around 8MHz, but it looks like the Curie can run the bus much faster. This seemed to be causing problems for the communication.

Dropping the max allowed speed to 8MHz fixed the problem. I made the following change in the hal.cpp file.

// -----------------------------------------------------------------------------
// SPI

//static const SPISettings settings(10E6, MSBFIRST, SPI_MODE0);

// Drop the SPI bus speed to allow working on the much faster Curie based Genuino
static const SPISettings settings(8E6, MSBFIRST, SPI_MODE0);

There are probably better ways of doing this with #ifdef's etc, but I have communicated with the library maintainer and he may update for this.

Of course, using shorter wires might fix the issue too, but I need to space right now.


Thank you for posting your findings. I've been banging my head against the wall for days because I am trying to get a HopeRF RFM69HCW module to work with the 101 over SPI. I suspected the clock speed of the 101 was too fast for the HopeRF module, but couldn't back that up, and was having trouble sifting through the various libraries to reduce the SPI bus speed.

I don't have it working yet, but I feel like your post gets me a half step closer.

Posting this as a resolution to my issues with the RFM69HCW and Arduino 101.

I got the transmitting portion to work properly by slowing down the SPI clock speed!

I then got the receiving portion to work properly by redefining the interrupt number to be the same as the interrupt pin (only relevant in new, higher performance Arduino boards)!

I posted more detailed info over on the Sparkfun forum here: Arduino 101 (Intel Curie) and RFM69HCW SPI Communication - SparkFun Electronics

I hope this is helpful for someone!