Odd SPI problem using RFM69 Radio module

I've narrowed this problem down to a SCK - pin 13 problem and logic level conversion. I thought I'd run it by the brain trust to see if someone recognizes the problem.

I have one of the HopeRF 915Mhz modules (3.3V) that I'm trying to interface to an Uno. But I'm running into odd problems running SCK through a logic level converter. Here's what I've found:

1) If you hook this up to an Arduino (I've tried an Uno and a Ruggeduino) directly, it will work perfectly (of course, at 5V you'll cook the RFM module pretty quickly.)

2) If you hook this up to a Nano, at 3.3V, it will also work perfectly.

3) Of course, you need to logic-level shift the Arduino outputs for the Uno. You can skip level-shifting the INT and MISO lines, since the Arduino will handle 3.3V as a logical high.

4) Here comes the oddness. I've tried three different bi-directional logic level converters (different break-outs, not just three of the same design) as well as a set of voltage dividers. I can get things to work with the logic-level converters for SS and MOSI, but not SCK. But I can get things to work well with SCK on the voltage divider.

5) Thinking this may be some really odd power problem, I hooked the RFM to its own external power. That improved the signal considerably, but did nothing to solve the SCK problem.

6) Thinking I need to slow down the clock, I added the spi.begintransaction code to the original library. I think it probably is slowing the clock when I turn down the clock speed parameter, but it still only works on the voltage divider.

I totally don't get the SCK problem. The logic level converters should be much faster than the voltage divider, so it shouldn't be a signal timing issue.

One interesting note - the voltage coming out of my divider is actually a little high - 3.5V, and the voltage I'm reading at the logic converters is around 2.8V.

Thanks for any ideas!

[Mods - this is a new topic that I also posted to the most-relevant looking old post. I'm not sure if this is a general SPI problem I've never seen before or something specific to these radio modules.]

What RFM module are you using? Post a link to the data sheet or product page. How is the voltage divider wired, and what are the resistor values?

RFM69CW-915S2, from Anarduino.com. Datasheet here: http://www.hoperf.com/upload/rf/RFM69CW-V1.1.pdf

Unfortunately, the rig is at work and I'm at home. IIRC, it was 220/600ohm, wired as shown at the Ralton divider calculator page: http://www.raltron.com/cust/tools/voltage_divider.asp. The 3.5 is what I remember seeing on my voltmeter, but it might have been 3.6. I recall thinking it was a little high, but below the 3.9 max on the datasheet (Table 2, page 11). [Actually, I have the 220ohm set at home, so I'll have to get back to you with the actual values.]

I think I have everything wired correctly, since, as mentioned it all works fine with direct wiring from Uno/Ruggeduino/Nano, and with the output lines going through either the voltage divider or all of them but SCK going through the logic level converter.

Back. Actual resistor values are 330Ω and 680Ω. SPI doesn’t really need bi-directional signaling anyway, so I’m going to solder up a hex buffer I have and try that instead.

I attached a picture of the three bi-directional LLCs I tried that didn’t work with the SCK signal.

three logic level converters bigger.jpg

OK, so I soldered up a 74HC4050 hex buffer, connected it, and Joy! Works perfectly right out of the gate. I had dropped the SPI speed in SPI.begintransaction down to 200,000 to try to get the bidirectional LLC to work, and had left it there for the voltage dividers. So I bumped it up to 20,000,000 again, and still, no problems at all.

BTW, to diagnose this radio module, I’m using a NooElec NESDR Mini2 (nothing to do with them, I’m just a happy customer) along with HDSDR software. Interestingly, running at the slower SPI speed, I got very strong signals, tightly centered around 915MHz. Switching to the higher SPI speed, I get weaker signals with a bit wider spectrum centered around 914.9MHz. I suspect the signals aren’t really weaker, they’re just a much shorter pulse that doesn’t show up as well on my software radio display.

Oh, and be sure to put a little piece of wire in the antenna hole when testing - scary stronger signal. :o :slight_smile:

Lesson learned for me is that the bi-directional LLC is for I2C, not SPI. You might get it to work, or might not, but 74HC4050s are pretty cheap, and work great.