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:
// ------ 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.
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
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.