ProMicro 3.3V and RFM69HCW 915MHz

Good Afternoon,

I have recently purchased a few SparkFun ProMicro 3.3V (DEV-12587) and a few SparkFun RFM69 915MHz radio breakout (WRL-12775). I need them to build a small sensor network. I am using the example code found here: https://learn.sparkfun.com/tutorials/rf … ample-code

I have installed the RFM69 library. I have soldered antenna wires to my breakouts. I am powering the radio modules with a nice 3.3V regulator. I have also made sure to change one node to 1 with a destination of 2 and one node to 2 with a destination of 1. Both radios are on the same network ID. The hardware connections were pretty straightforward except for the SS pin.

I have the following connections:

ProMicro 3 to RFM69 0 (Zero)

ProMicro 15 to RFM69 C

ProMicro 14 to RFM69 O

ProMicro 16 to RFM69 I

ProMicro 10 to RFM69 S

I followed the hardware connections in the hookup guide I linked to above. However, using two separate computers and watching the serial monitors, my radios do not talk. I get the response “no ACK received” no matter what I send or from which radio. In my digging, it seems that pin 10 on the ProMicro is not the SS pin? Is that correct? If so, what is the SS pin and how to I connect it to my radio? Would the lack of proper SS pin cause my system to fail? The code verifies and uploads just fine and the LED flashes, but nothing ever actually sends, it just says it is and then says “no ACK”.

Please help! I am under pressure to get these things done. I have done some googling and thoroughly read the help and hookup and guides on the sparkfun website, but I can’t seem to find a solution.

Hi jmativi,

The SS pin can be assigned to any available I/O pin on your microcontroller so that should not be an issue so long as it is defined properly in your code. It sounds like you might have either a hardware/connection problem or possibly some major RF interference causing the lack of communication here. I would first recommend going back and making sure you have all of your connections going to the right pins. From your description, it sounds like you do but it never hurts to double-check. Along those lines, double-check the length of your antenna is as close to 78mm as possible. Next, to get a better idea of your circuit, can you please take a few photos of both of your RFM69 Breakouts and the connections to the Pro Micros they are attached to? Especially any soldering you have done. Please do your best to make sure they are clear and well-lit.

Finally, if you can move your setup to another area that may help reduce RF interference. Most likely, the issue is not interference since you would almost certainly see SOME data come through and have a lot of “no ACK received” messages in between but if you can move your setup to another location and retest, that would eliminate that possibility. Similarly, you could try creating a dipole for your antenna with a second length of wire like we demonstrate in the [Antenna section of the Hookup Guide.](RFM69HCW Hookup Guide - SparkFun Learn)

Thank you! You said “The SS pin can be assigned to any available I/O pin on your microcontroller so that should not be an issue so long as it is defined properly in your code.” – HOW do I do this? I can’t figure it out, I have tried googling, and I can’t find it in the SPI.h files (the only ones I could find were in the WiFi directories of the Arduino libraries). Please help! The two units are about 20 feet apart and have line of sight, I doubt it’s interference. The code I’m using is what’s posted on the SparkFun tutorial (I have changed the node numbers to be appropriate, and I have tried it with and without encryption). Here are pictures:

https://drive.google.com/file/d/1gbX3kp … sp=sharing

https://drive.google.com/file/d/11iOobC … sp=sharing

https://drive.google.com/file/d/1hQFSTH … sp=sharing

https://drive.google.com/file/d/1dX0njI … sp=sharing

Please get back to me as soon as you can. Thank you!

I tried using the thing, but it just displayed “Image” with no link… Sorry.

Hi jmativi,

Thanks for those photos but it is still quite difficult to verify which wires are going where so I would still recommend verifying those connections are correct and just re-wire everything.

As for the Slave Select/Chip Select pin (SS/CS) that is simply a pin telling the microcontroller which device it is talking to. [This section of our SPI Tutorial goes over that in more detail.

Try re-uploading the [example code making sure to set the right network and node values. I know you have already done so but after re-wiring everything it would be a good sanity check to make sure everything is wired up and the correct code is uploaded.](https://learn.sparkfun.com/tutorials/rfm69hcw-hookup-guide#running-the-example-code)](https://learn.sparkfun.com/tutorials/serial-peripheral-interface-spi/all#slave-select-ss)

Thank you,

I have triple checked my wires, and they are all according to the connections I detailed in my first post. Everything has appropriate power and ground, too. I checked the section of the SPI tutorial you linked me to. The only thing I could find regarding SS pin was this: “If you’re using the SPI Library, you must use the provided SCK, MOSI and MISO pins, as the hardware is hardwired to those pins. There is also a dedicated SS pin that you can use (which must, at least, be set to an output in order for the SPI hardware to function), but note that you can use any other available output pin(s) for SS to your slave device(s) as well.” – Other than just setting pin 10 (the pin I have connected to the RF69 “S” pin) to an output, is there any other function I need to call that tells the ProMicro to use that pin as SS? If there is, it wasn’t in the tutorial anywhere that I saw. Please help! Thank you.

I have also just noticed that the RX_LED light on my ProMicro comes on and stays on when I try to transmit something. I enter some text, press Enter, and the Serial monitor says it’s transmitting (yes, I have the baud rate and carriage return set) but the RX light on the ProMicro just hangs. I have also tried changing the SS pin in the header file for the RF69 to pin 10, as I have it wired, but that made no difference. I also tried #defining the RF69_SPI_CS pin in my code, again with no luck. Please help me out here! I can’t believe that the ProMicro and RF69HCW modules are not compatible… Thank you again in advance.

Hi again jmativi,

I think the issue here is the hardware SS pin (D17) for the ATMega32U4 on the Pro Micro is tied to the RX pin. That is why you are seeing it turn on. Try adding in

pinMode(17, OUTPUT);

in your void setup() and see if that helps. My guess is since you are using D10 for SS, you need to set the hardware SS pin as an output or else the Pro Micro will default to a slave device for SPI.

Thank you for your reply. I tried setting pinMode(17,OUTPUT); on each side, and it did not fix the problem.

To summarize my setup:

I have a 3.3V regulator powered by a 9V battery to power the RFM69HCW breakout. Both of my radio units are 915MHz. The ProMicro is powered by USB. Their grounds are tied together.

RF69 Pin O to ProMicro pin 14

RF69 Pin I to ProMicro pin 16

RF69 Pin C to ProMicro pin 15

RF69 Pin S to ProMicro pin 10

RF69 Pin 0 to ProMicro pin 3

RF69 Pin 3.3V to 3.3V

RF69 Pin GND to Ground

LED on ProMicro pins 8, 9.

Appropriate length antenna soldered to RF69HCW pin A. I am using the exact sample code (with the appropriately changed Node numbers) from here: https://learn.sparkfun.com/tutorials/rf … ample-code

I have tried changing the .h files for SPI and for RF69 to set CS/SS pin to 10, no luck. I have tried #define RF69_SPI_CS 10 with no luck. I have tried with an without ACK and Encryption, no luck. I have set all of these files back to their defaults.

When I bring up the Serial Monitor, I enter text, I press Enter (with carriage return and 9600 baud selected) and I get this:

sending to node 1: [asdfasdfasdf]

no ACK received :frowning:

It happens every time. My RX_LED on the ProMicro is no longer hanging, which I guess I good. The LED attached to pins 8,9 flashes as it should. But nothing else happens. The radios are about 20 feet apart, line of sight, indoors, and have antennas. There is negligible interference, it’s just an office building. No other radio sources except WiFi and that’s on 2.4GHz.

Please help. I need to get these up and running for a sensor deployment that was supposed to be going out last week. Thank you in advance!

Any updates, please? I have hit a brick wall with this thing and I have administration keeping on me for updates…

Hi jmativi.

We’ve not actually tested the example code with a ProMini before but with the correct changes, it should work.

TS-Mark and I did some digging and found an earlier email from you from before we had switched to forums that gave us some clues of things to try. I did notice that you need to move the 0 (zero) pin from pin 2 to pin 7 though.

Below is an excerpt from your previous email

I figure it out! My hardware was wired correctly and my code was working -

the culprit was not one but TWO bad jumper wires! You can add it to your

knowledge base: the ProMicro 3.3Vs and the RFM69HCW 915MHz modules do play

nicely together. You just need to call setCS(ProMicroSSPin) on the radio

before you call initialize(). Then everything works.

Give the sketch below a try and see if that gets things running for you. I’m using the latest RFM69 library from low power labs.

Pin connections:
ProMicro -- RFM69
14 -- O (MOSI)
16 -- I (MISO)
15 -- C (SCK)
10 -- S (CS)
   -- R
 7 -- 0 (zero; INT)
GND  -- G
3.3V -- 3.3V
// RFM69HCW Example Sketch
// Send serial input characters from one RFM69 node to another
// Based on RFM69 library sample code by Felix Rusu
// http://LowPowerLab.com/contact
// Modified for RFM69HCW by Mike Grusin, 4/16

// This sketch will show you the basics of using an
// RFM69HCW radio module. SparkFun's part numbers are:
// 915MHz: https://www.sparkfun.com/products/12775
// 434MHz: https://www.sparkfun.com/products/12823

// See the hook-up guide for wiring instructions:
// https://learn.sparkfun.com/tutorials/rfm69hcw-hookup-guide

// **************** Notes for using a Pro Micro (32u4 based) board ****************
// If you're using a Pro Micro rather than a 328 based board, the 0 (zero) pin on the
// RFM69 module needs to get moved from pin 2 to pin 7 on the Pro Micro. 
// ******************************************************************************

// Uses the RFM69 library by Felix Rusu, LowPowerLab.com
// Original library: https://www.github.com/lowpowerlab/rfm69
// SparkFun repository: https://github.com/sparkfun/RFM69HCW_Breakout

// Include the RFM69 and SPI libraries:

#include <RFM69.h>
#include <SPI.h>

// Addresses for this node. CHANGE THESE FOR EACH NODE!

#define NETWORKID     0   // Must be the same for all nodes
#define MYNODEID      2   // My node ID
#define TONODEID      1   // Destination node ID

// RFM69 frequency, uncomment the frequency of your module:

//#define FREQUENCY   RF69_433MHZ
#define FREQUENCY     RF69_915MHZ

// AES encryption (or not):

#define ENCRYPT       true // Set to "true" to use encryption
#define ENCRYPTKEY    "TOPSECRETPASSWRD" // Use the same 16-byte key on all nodes

// Use ACKnowledge when sending messages (or not):

#define USEACK        true // Request ACKs or not

// Packet sent/received indicator LED (optional):

#define LED           9 // LED positive pin
#define GND           8 // LED ground pin



// Create a library object for our RFM69HCW module:


RFM69 radio;

void setup()
{
  // Open a serial port so we can send keystrokes to the module:

  Serial.begin(9600);
  Serial.print("Node ");
  Serial.print(MYNODEID,DEC);
  Serial.println(" ready");  

  // Set up the indicator LED (optional):

  pinMode(LED,OUTPUT);
  digitalWrite(LED,LOW);
  pinMode(GND,OUTPUT);
  digitalWrite(GND,LOW);

  // Initialize the RFM69HCW:
  radio.setCS(10);  //needed for Pro Micro
  radio.initialize(FREQUENCY, MYNODEID, NETWORKID);
  radio.setHighPower(); // Always use this for RFM69HCW

  // Turn on encryption if desired:

  if (ENCRYPT)
    radio.encrypt(ENCRYPTKEY);
}

void loop()
{
  // Set up a "buffer" for characters that we'll send:

  static char sendbuffer[62];
  static int sendlength = 0;

  // SENDING

  // In this section, we'll gather serial characters and
  // send them to the other node if we (1) get a carriage return,
  // or (2) the buffer is full (61 characters).

  // If there is any serial input, add it to the buffer:

  if (Serial.available() > 0)
  {
    char input = Serial.read();

    if (input != '\r') // not a carriage return
    {
      sendbuffer[sendlength] = input;
      sendlength++;
    }

    // If the input is a carriage return, or the buffer is full:

    if ((input == '\r') || (sendlength == 61)) // CR or buffer full
    {
      // Send the packet!


      Serial.print("sending to node ");
      Serial.print(TONODEID, DEC);
      Serial.print(", message [");
      for (byte i = 0; i < sendlength; i++)
        Serial.print(sendbuffer[i]);
      Serial.println("]");

      // There are two ways to send packets. If you want
      // acknowledgements, use sendWithRetry():

      if (USEACK)
      {
        if (radio.sendWithRetry(TONODEID, sendbuffer, sendlength))
          Serial.println("ACK received!");
        else
          Serial.println("no ACK received");
      }

      // If you don't need acknowledgements, just use send():

      else // don't use ACK
      {
        radio.send(TONODEID, sendbuffer, sendlength);
      }

      sendlength = 0; // reset the packet
      Blink(LED,10);
    }
  }

  // RECEIVING

  // In this section, we'll check with the RFM69HCW to see
  // if it has received any packets:

  if (radio.receiveDone()) // Got one!
  {
    // Print out the information:

    Serial.print("received from node ");
    Serial.print(radio.SENDERID, DEC);
    Serial.print(", message [");

    // The actual message is contained in the DATA array,
    // and is DATALEN bytes in size:

    for (byte i = 0; i < radio.DATALEN; i++)
      Serial.print((char)radio.DATA[i]);

    // RSSI is the "Receive Signal Strength Indicator",
    // smaller numbers mean higher power.

    Serial.print("], RSSI ");
    Serial.println(radio.RSSI);

    // Send an ACK if requested.
    // (You don't need this code if you're not using ACKs.)

    if (radio.ACKRequested())
    {
      radio.sendACK();
      Serial.println("ACK sent");
    }
    Blink(LED,10);
  }
}

void Blink(byte PIN, int DELAY_MS)
// Blink an LED for a given number of ms
{
  digitalWrite(PIN,HIGH);
  delay(DELAY_MS);
  digitalWrite(PIN,LOW);
}

TS-Mark and TS-Chris,

Thank you! Yikes do I feel silly for having completely forgotten that I had this up and running for a different project a couple years ago. Adding the radio.setCS worked! I kept my interrupt on pin 3, as that’s called out at INT0 on the datasheet. I am very sorry I forgot about this and I am very sorry to be such a pain to you two! I really, really appreciate all of your help! Going forward, perhaps adding a note about calling setCS in your tutorial would be helpful for future tinkerers! Thank you again, so much, and I’m so sorry I was a dummy and made this oversight.

Hi again jmativi,

Not a problem! We’re happy to help. We are working on modifying the tutorial and example guide to avoid this headache in the future. We will add in the “radio.setCS()” line to the example code and have it commented out with a note to uncomment if you are using a Pro Micro.