Author Topic: Adafruit RFM69HCW Breakout Not Functioning with Teensy 3.2 and RFM69 Libraries  (Read 4624 times)

davidthings

  • NewMember
  • *
  • Posts: 5
  • Country: us
Hi,

I'm struggling to get my Adafruit RFM69HCW breakout board working. I've been trying LowPowerLab (per Adafruit examples), RadioHead and PlainRFM69 libraries and they all have exactly the same symptom, they all hang during initialization, and indeed at any setMode() function.

I have confirmed that I have power, and communication with the board (for example I get 0x24 back from the REG_VERSION register (as I should) and other registers read as expected). From this I conclude that power, CS, RST, EN and SCK, MOSI and MISO are connected OK. I also conclude from this that the Teensy 3.2 is not running the SPI too fast and simply dropping bits. I have tried the most recent versions of all software and ones from a while back in case something recent has changed. I have also tried both the LowPowerLabs RFM69 and Radiohead RFM69 code on some Moteinos (RFM69HW) where it works like a charm.

The board hangs every time after a mode switch when waiting for the MODEREADY flag to be set.

Code: [Select]
  while ((readReg(REG_IRQFLAGS1) & RF_IRQFLAGS1_MODEREADY) == 0x00); // wait for ModeReady
This line occurs in a couple of places and it never makes it out of there. The equivalent line occurs in RadioHeads RFM69 code and in PlainRFM69 code, where they each hang too.

I've started to dig into the datasheet and find no clues there. MODEREADY "just works".

A couple of frustrating days in, I guess I'm ready to throw myself at the mercy of more experienced people (and I will post this on the RadioHead and Adafruit forums too)

Is anyone else seeing this?

Could it be a weird batch of boards?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
I'm struggling to get my Adafruit RFM69HCW breakout board working. I've been trying LowPowerLab (per Adafruit examples), RadioHead and PlainRFM69 libraries and they all have exactly the same symptom, they all hang during initialization, and indeed at any setMode() function.

...

I have also tried both the LowPowerLabs RFM69 and Radiohead RFM69 code on some Moteinos (RFM69HW) where it works like a charm.

...

Could it be a weird batch of boards?

Hard to guess but the MCUs are different from what I gather. Since this works ok on Moteinos, adafruit should be able to answer regarding their hardware since they designed it. It might be as simple as pin definitions.
« Last Edit: July 08, 2016, 06:03:54 PM by Felix »

davidthings

  • NewMember
  • *
  • Posts: 5
  • Country: us
Hi Felix (love your products!  I have many MotineoUSB's running around in various projects)

Still waiting on something from Adafruit.  It is July 4th, after all, I suppose I can cut them some slack.  (-:,


davidthings

  • NewMember
  • *
  • Posts: 5
  • Country: us
Update:  Thanks to a sharp eyed Teensy forum member, I have fixed it.

Quote
It might be as simple as pin definitions.

Felix you were right, too.  Adafruit's doc had the RST pin active low, when in fact it's active high.


TomWS

  • Hero Member
  • *****
  • Posts: 1930
Adafruit's doc had the RST pin active low, when in fact it's active high.
RFM69 RST pin is a bit funky.  There are only certain times when you can drive it.  The rest of the time you need to read it as a status pin.  I suggest reading the RFM69 datasheet on this matter.

Tom

davidthings

  • NewMember
  • *
  • Posts: 5
  • Country: us
Will do, TomWS.  Thanks.

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Adafruit's doc had the RST pin active low, when in fact it's active high.
RFM69 RST pin is a bit funky.  There are only certain times when you can drive it.  The rest of the time you need to read it as a status pin.  I suggest reading the RFM69 datasheet on this matter.
Tom

The RST pin is indeed active high, the opposite of the RFM12B. It appears to be an open source type signal. The timing diagrams suggest that to reset it you should drive high for a short period, then tri-state the driver and poll for when it goes back low again. This implies it has an internal pull-down resistor (which I cannot find any other evidence of anywhere in the datasheets), and it could well also have an open source power up monitor as well. I uses an external pull-down for noise immunity and have never had problems resetting it.

The RFM12B is the opposite, it is an open drain type signal with an internal pull-up which is documented.

Mark.

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Adafruit's doc had the RST pin active low, when in fact it's active high.
RFM69 RST pin is a bit funky.  There are only certain times when you can drive it.  The rest of the time you need to read it as a status pin.  I suggest reading the RFM69 datasheet on this matter.
Tom

The RST pin is indeed active high, the opposite of the RFM12B. It appears to be an open source type signal. The timing diagrams suggest that to reset it you should drive high for a short period, then tri-state the driver and poll for when it goes back low again. This implies it has an internal pull-down resistor (which I cannot find any other evidence of anywhere in the datasheets), and it could well also have an open source power up monitor as well. I uses an external pull-down for noise immunity and have never had problems resetting it.
IIRC the RFM69 actually pulls the RST pin low with a transistor, not a pull-down resistor.  If you're not quick on the timing of driving RST high, then you'll have a high current path if RST is still driven high when the RFM69 wants to drive it low again.  It doesn't get driven low immediately, but you do need to be wary of when you drive the pin high.

Tom

perky

  • Hero Member
  • *****
  • Posts: 873
  • Country: gb
Adafruit's doc had the RST pin active low, when in fact it's active high.
RFM69 RST pin is a bit funky.  There are only certain times when you can drive it.  The rest of the time you need to read it as a status pin.  I suggest reading the RFM69 datasheet on this matter.
Tom

The RST pin is indeed active high, the opposite of the RFM12B. It appears to be an open source type signal. The timing diagrams suggest that to reset it you should drive high for a short period, then tri-state the driver and poll for when it goes back low again. This implies it has an internal pull-down resistor (which I cannot find any other evidence of anywhere in the datasheets), and it could well also have an open source power up monitor as well. I uses an external pull-down for noise immunity and have never had problems resetting it.
IIRC the RFM69 actually pulls the RST pin low with a transistor, not a pull-down resistor.  If you're not quick on the timing of driving RST high, then you'll have a high current path if RST is still driven high when the RFM69 wants to drive it low again.  It doesn't get driven low immediately, but you do need to be wary of when you drive the pin high.

Tom

Interesting, that is a bizarre way of doing it. Normally these things are wire-ored in some way so as not to create conflicts like that, it's common practice for things to have power up reset circuits in them. Is this an empirical result by experiment or is this in a spec somewhere?
Edit: In fact this is really bizarre if that's what happens. If you drive for too long you get a current spike and a potentially invalid logic level with over-driving, and if you don't drive for long enough you risk a floating pin, again with invalid logic levels. I really cannot believe they'd do such a thing! Not withstanding that his means you couldn't hold it in permanent reset, or reset it reliably at any arbitrary time in the future.

Mark.
« Last Edit: July 08, 2016, 07:32:21 PM by perky »

TomWS

  • Hero Member
  • *****
  • Posts: 1930
Adafruit's doc had the RST pin active low, when in fact it's active high.
RFM69 RST pin is a bit funky.  There are only certain times when you can drive it.  The rest of the time you need to read it as a status pin.  I suggest reading the RFM69 datasheet on this matter.
Tom

The RST pin is indeed active high, the opposite of the RFM12B. It appears to be an open source type signal. The timing diagrams suggest that to reset it you should drive high for a short period, then tri-state the driver and poll for when it goes back low again. This implies it has an internal pull-down resistor (which I cannot find any other evidence of anywhere in the datasheets), and it could well also have an open source power up monitor as well. I uses an external pull-down for noise immunity and have never had problems resetting it.
IIRC the RFM69 actually pulls the RST pin low with a transistor, not a pull-down resistor.  If you're not quick on the timing of driving RST high, then you'll have a high current path if RST is still driven high when the RFM69 wants to drive it low again.  It doesn't get driven low immediately, but you do need to be wary of when you drive the pin high.

Tom

Interesting, that is a bizarre way of doing it. Normally these things are wire-ored in some way so as not to create conflicts like that, it's common practice for things to have power up reset circuits in them. Is this an empirical result by experiment or is this in a spec somewhere?
Edit: In fact this is really bizarre if that's what happens. If you drive for too long you get a current spike and a potentially invalid logic level with over-driving, and if you don't drive for long enough you risk a floating pin, again with invalid logic levels. I really cannot believe they'd do such a thing! Not withstanding that his means you couldn't hold it in permanent reset, or reset it reliably at any arbitrary time in the future.

Mark.
Mark, you're falling into the trap that everything should be logical!  Don't you know, this is definitely a Lewis Carroll world!

Try it.  Let me know that I'm wrong about this!

 :)