Arduino UNO + RFM69 Rx and TDA7116F OOK Tx

Greetings!!!

I am working on a mini project where I am trying to make two Arduino UNOs talk via sub-Gz (868MHz). One UNO is connected to RFM68HCW that works as receiver. The other UNO is connected to Infineon TDA7116F OOK transmitter.

The reason I am using a TDA7116F OOK is that it requires no software configuration other than requiring a Tx enable pin to HIGH and sending data over the DIO pin from the UNO. This will be battery based device and I want to prolong battery life.

Being a new user, forum rules do NOT allow me to attach the schematic diagrams.

I have validated the DIO output from the Tx-UNO using a scope. However my capture of the MOSI input at the Rx-UNO has unfortunately resulted in failure.

Note: Using the RadioHead libraries, I have been able to successfully communicate using the same RFM69 transeiver module with another RFM69 module in default 434.0MHz, modulation GFSK_Rb250Fd250, +13dbM setting without any trouble. That proves the RFM69 module is a working one.

I am using the following RadioHead github repository:

-----------------Receiver code-----------------
RF69_OOK_Rx.ino

#include <RH_RF69.h>

// Singleton instance of the radio driver
RH_RF69 rf69;

void setup() 
{
  Serial.begin(9600);
  while (!Serial) 
    ;
  if (!rf69.init())
    Serial.println("init failed");
  // Defaults after init are 434.0MHz, modulation GFSK_Rb250Fd250, +13dbM (for low power module)
  if (!rf69.setFrequency(868.45))
    Serial.println("setFrequency failed");

  //For compatibility with TDA7116F_OOK_Tx.ino
  rf69.setModemConfig(RH_RF69::OOK_Rb32Bw64,);   //OOK bit rate 32kbps  
  rf69.setPreambleLength(2);     // default length is 4
  uint8_t syncwords[] = { 0x2d, 0xd4 };   //node ID and network ID
  rf69.setSyncWords(syncwords, sizeof(syncwords));
  //rf69.setEncryptionKey((uint8_t*)"thisIsEncryptKey"); //commented

}

void loop()
{
  if (rf69.available())
  {
    // Should be a message for us now   
    uint8_t buf[RH_RF69_MAX_MESSAGE_LEN];
    uint8_t len = sizeof(buf);
    if (rf69.recv(buf, &len))
    {
      Serial.print("Received data packets from Infineon_TDA7116F: ");
      Serial.println((char*)buf);
    }
    else
    {
      Serial.println("Fn rf69.available() failed to capture incoming packets");
    }
  }
}```

-----------------Transmitter code-----------------
**TDA7116F_OOK_Tx.ino**

```int buff[9] = {0xAA, 0xAA, 0x2D, 0xD4, 0x07, 0x62, 0xFC, 0x28, 0xB8};
int prev = 0, first = 1, i=0, j = 0;

void setup() 
{
  pinMode(5, OUTPUT);        
  pinMode(4, OUTPUT);        
}
void loop() 
{
  //hold TDA7116F PAOUT PIN HIGH from Arduino UNO Port D4
  digitalWrite(4, HIGH);     
  delay(1);

  //send OOK bit stream from Arduino UNO PORT D5 to TDA7116F ASKDTA pin
  for (i=0; i<9; i++)
  {
    for(j=7; j>=0; j--)
    {
      if((buff[i]>>j) & 0x01)
      {
        if(prev==0) //if previous period LOW then HIGH
        {
          PORTD = PORTD | 0b00100000;  //PORT D5 PIN HIGH
          prev = 1;
        }
        delayMicroseconds(28);
      }
      else 
      {
        if(prev==1 || first==1) //if previous period HIGH or first entry then LOW 
        {
          PORTD = PORTD & 0b11011111;  //PORT D5 PIN LOW
          prev = 0;
          first = 0;
        }
        delayMicroseconds(28);
      }
    }
  }
  delay(100);
}```

**Question 1:**
On Tx side, I have seen the Port D5 Ouput on a scope and found that the period is ~32usecs when I call a delayMicroseconds(28). It is my understanding, that setting a period of ~32usecs is equivalent to a OOK Tx bit rate of 32kbps. Ideally the period should be 32.25usecs which can be acheived with asm("nop"). Is this understanding correct?

In Rx code, I have setModemConfig() to OOK_Rb32Bw64, which translates to a bit rate of 32kbps. This was done to make the Tx-Rx compatible. Is that accurate?

**Question 2:**
Does the issue have to do anything with the length of the preamble or the sync words or anything else? I have played around with longer preamble but that didnt help. My understanding is that if this Rx code worked well with another RF69 Tx module then the preamble and sync words should be okay.

Apologies in advance for the long post.

RFM69_Rx_Sch.pdf (102.5 KB)
TDA7116F_Tx_Sch.pdf (106.1 KB)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.