Init failed with RF22 board

+1 vote
asked Dec 7, 2016 by rdalce (170 points)
edited Dec 7, 2016 by vandenbo

Hello, I'm trying to control the RF22 board which comes with the teensywino kit and my setup looks like this:

setup(){
  Serial.begin(9600);
  delay(5000);

  if(!rf22.init()){
     Serial.println("init failed");
     while(1);
  }
  else
    Serial.println("init OK");
  // then continue with the configuration
}

Unfortunately, I always get the failure notification. When I checked the RF22 file, I found out that the reason for this failure is the device_type being 0 instead of 0x08 or 0X07. Is there a way to quickly fix this?

1 Answer

+1 vote
answered Dec 7, 2016 by vandenbo (510 points)

Hello,

It seems that both the SCK pin and interrupt pin are not configured on your sketch.

Here is the good configuration in the Arduino sketch:

Global:

// Singleton instance of the radio driver
// "SPI Chip Select" RF22 pin is wired on Teensy pin "SS",
// "IRQ" RF22 pin is wired on Teensy pin "9"
RH_RF22 rf22(SS,9);

In the setup(), before calling rf22.init()

SPI.setSCK(14);

After this changes, the device_type failure should be fixed.

commented Dec 7, 2016 by rdalce (170 points)
YES!!!!!
It's aliiiive!! Ok, more seriously, thank you for your answer. I am now able to reach init success!
Welcome to OpenWiNo Q&A, where you can ask questions and receive answers from other members of the community.
To change your password you must follow THIS link.

24 questions

32 answers

18 comments

37 users

...