Author Topic: Help - Stuck at radio.initialize (RFM69 + Arduino UNO)  (Read 6847 times)

frou

  • Newbie
  • *
  • Posts: 4
Help - Stuck at radio.initialize (RFM69 + Arduino UNO)
« on: November 14, 2014, 07:42:24 PM »
Hi,
I am posting this message because I have tried a lot of different things and still can't figure out what is going wrong.
So, I am connecting a RFM69HW to an Arduino Uno.

Regarding the wiring, my arduino is connected to my computer through USB (it is the only power source of the arduino)
I am using a voltage regulator to have 3.3V from the 5V of the Arduino rails power - works
I am connecting all RFM Inputs with a resistor bridge as below:

                                             RFM Input
Arduino output ------- R=10k ----------- R=20k---- GND

- gives me 3.3V when powered with 5V so should work

The code id reduced to its minimum so far:
Code: [Select]
// ------  radio --------
#include <RFM69.h>
#include <SPI.h>
#define NODEID        41    //unique for each node on same network
#define NETWORKID     101  //the same on all nodes that talk to each other
#define GATEWAYID     1
#define FREQUENCY     RF69_915MHZ
#define ENCRYPTKEY    "xxxxxxxxxxxxxxxx" //exactly the same 16 characters/bytes on all nodes!
#define IS_RFM69HW    //uncomment only for RFM69HW! Leave out if you have RFM69W!
#define ACK_TIME      30 // max # of ms to wait for an ack

#define SERIAL_BAUD   9600 
char buff[20];
byte sendSize=0;
boolean requestACK = false;
RFM69 radio;
// ------  end radio --------

void setup() {
Serial.begin(9600);
Serial.print("let's start");

//RFM69-------------------------------------------
  radio.initialize(FREQUENCY,NODEID,NETWORKID);
  Serial.print("init");
//  radio.setHighPower(); //uncomment only for RFM69HW!
//  radio.encrypt(ENCRYPTKEY);
//  char buff[50];
//  sprintf(buff, "\nTransmitting at %d Mhz...", FREQUENCY==RF69_433MHZ ? 433 : FREQUENCY==RF69_868MHZ ? 868 : 915);
//  Serial.println(buff);
  Serial.println("finished setup");
 // end of setup
}

In this configuration I can see some activity (test with a LED) on the input and output of the RFM but the code stays at the radio.initialize and I never see the init in the serial interface.

Do you have any clue on what I am doing wrong?
How could I debug such situation? Can I insert Serial.println(""); in the library?
Thanks for your advice.
« Last Edit: November 18, 2014, 02:12:51 PM by frou »

ggallant

  • Newbie
  • *
  • Posts: 23
Re: Help - Stuck at radio.initialize
« Reply #1 on: November 15, 2014, 11:36:00 AM »
1. If you comment out radio.initialize do the print statements work?
2. Can you post you interface schematic?
3. Do your I/O pins match those used the Moteino?

George

frou

  • Newbie
  • *
  • Posts: 4
Re: Help - Stuck at radio.initialize
« Reply #2 on: November 17, 2014, 11:25:38 AM »
Thanks for helping
1/ radio.initialize is uncommented in the code I posted and the print do not work. The code stays at radio.initialize. If I comment it the print will work of course
2 and 3/ It seems like the same question - the interface schematic is exactly the same as this post https://lowpowerlab.com/forum/index.php/topic,363.msg2263.html#msg2263
pin 10 -> NSS, pin 11 -> MOSI, pin 12 -> MISO, pin 13 -> SCK, pin 2 -> DIO 0, 3.3V and GND correspondingly.
In connection  NSS, MOSI and SCK are connected through 20K/10K

Thanks for your answers

Lensdigital

  • Full Member
  • ***
  • Posts: 151
    • Xronos Clock
Re: Help - Stuck at radio.initialize (RFM69 + Arduino UNO)
« Reply #3 on: November 17, 2014, 01:59:38 PM »
Are you using voltage dividers on MOSI, SCK and CS lines too?  Make sure your connection is similar to this image
Check out my hand made open source Xronos Alarm Clock!
http://www.xronosclock.com

frou

  • Newbie
  • *
  • Posts: 4
Re: Help - Stuck at radio.initialize (RFM69 + Arduino UNO)
« Reply #4 on: November 17, 2014, 04:49:26 PM »
Yes exactly at the following exceptions:
- Instead of 10k and 4,7k , I used 20k and 10k - gives 3,3V too.
- for the power, Arduino 3.3V rail is not powerful enough so I am using a voltage regulator from the 5V rail with a voltage divider to provide a 3.3V
- IRQ in your drawing is DIO0 on my RFM - I believe this is normal - I don't have IRQ
I believe that at the end it gives the same thing than your connection diagram.
Thanks for your help

ggallant

  • Newbie
  • *
  • Posts: 23
Re: Help - Stuck at radio.initialize (RFM69 + Arduino UNO)
« Reply #5 on: November 22, 2014, 09:08:01 PM »
There is a difference between 4.7k/10k and 10k/20K. You have half the current. Generally we like low impediance sources and high impediance inputs. Perhaps a person more skilled in the analog domain can comment.

frou

  • Newbie
  • *
  • Posts: 4
Re: Help - Stuck at radio.initialize (RFM69 + Arduino UNO)
« Reply #6 on: December 01, 2014, 08:19:55 PM »
Well as it is a control input (by opposition to a power source) I don't really see the issue of having low current. Am I wrong on this?

bagoette

  • Newbie
  • *
  • Posts: 3
Re: Help - Stuck at radio.initialize (RFM69 + Arduino UNO)
« Reply #7 on: July 11, 2015, 12:42:57 PM »
Did anyone figure out why it stops at .initialize()? I just received my RFM69hw's yesterday and I'm just testing 1 with an Arduino Uno (Moteino's are on the way...) and I've put println's every where and I'm stuck in the

Code: [Select]
do writeReg(REG_SYNCVALUE1, 0xAA); while (readReg(REG_SYNCVALUE1) != 0xAA);
do writeReg(REG_SYNCVALUE1, 0x55); while (readReg(REG_SYNCVALUE1) != 0x55);

loop. I can see it try to write 170 (0xAA) to Address 47 (0x2F) and the return from readReg changes from 0, 192, 28, 17... but never goes past the loop.

I'm not very good with hex so I don't know why it thinks those values all equal 0xAA.

miaoski

  • Newbie
  • *
  • Posts: 1
Re: Help - Stuck at radio.initialize (RFM69 + Arduino UNO)
« Reply #8 on: August 11, 2015, 09:24:19 AM »
Hi.

I got this issue as well.  I used 4.7K / 10K to level down the input from Arduino to RFM69H, while the code stuck at radio.initialize(), 0xAA part.  I dumped the value and it reads 0x2D.  Tried the tips from other forums, like to lower the power from 31 to 2, but didn't make it.

Any hints, please?  I'm sure soldering is OK, since I soldered a pair of RFM69H.  They work pretty well on Raspberry Pi with https://github.com/etrombly/RFM69.  I can send and receive without problem.

Thanks a lot!
« Last Edit: August 12, 2015, 06:45:47 AM by miaoski »