Wireless Link

Hi,

I have been trying for some time to send data from a 433MHz transmitter to a Receiver without any success. It feels like I have read hundreds of pages on the internet but just can’t find the answer.

I have a pair of Alpha RF modules (FSK, not ASK) Datasheet can be found here :
http://docs-europe.electrocomponents.com/webdocs/0d71/0900766b80d715d0.pdf.
I understand these are the same as RFM01/02 but I don’t seem to be able to find a very simple script for my pair of Arduino Uno’s .

Some really basic help and example code would really be appreciated.
My Transmitter code, so far, looks like this:

#include <SPI.h>

#define nSEL		10
#define SDI		        11
#define SCK		13
#define IRQ		2
// FSK: Pull up via 10Kohm to VCC (3.3v)

void setup() {
  Serial.begin(9600);
  pinMode(nSEL, OUTPUT);
  // Initialise Device
  // To condition the hardware you call SPI.begin () which configures the SPI pins (SCK, MOSI, SS) as outputs. 
  // It sets SCK and MOSI low, and SS high. It then enables SPI mode with the hardware in "master" mode. 
  // This has the side-effect of setting MISO as an input.
  SPI.begin();
  
  //  Set the Byte Order to Most Significant First
  SPI.setBitOrder(MSBFIRST);
  
  //  Set the Clock Speed
  SPI.setClockDivider(SPI_CLOCK_DIV4);                 
  
  /*
            Set clock polarity and phase
    Mode            CPOL          CPHA
    SPI_MODE0        0              0
    SPI_MODE1        0              1
    SPI_MODE2        1              0
    SPI_MODE3        1              1
  */
  SPI.setDataMode(SPI_MODE0) ;                              
}

void loop() {

  for(int x=0; x<256; x++){
    SPI_Write(x);
    delay(1000);
  } 
}

void SPI_Write(int value){
  digitalWrite(nSEL, LOW);
  SPI.transfer(value);
  digitalWrite(nSEL, HIGH);
}

I do have an oscilloscope, so I can see the data on the SPI bus but I can’t confirm the output from the transmitter, until I get the receiver working. My Receiver code is:

#include <SPI.h>

#define nSEL	10
#define SDI       11
#define SDO     12
#define SCK      13
// nFFS: 10kohm Pullup to Vcc (3.3v)

void setup() {
  Serial.begin(9600);
  
  // Define pin outputs
  pinMode(nSEL, OUTPUT);
  
  // Initialise Device
  // To condition the hardware you call SPI.begin () which configures the SPI pins (SCK, MOSI, SS) as outputs. 
  // It sets SCK and MOSI low, and SS high. It then enables SPI mode with the hardware in "master" mode. 
  // This has the side-effect of setting MISO as an input.
  SPI.begin();
  
  //  Set the Byte Order to Most Significant First
  SPI.setBitOrder(MSBFIRST);

  //  Set the Clock Speed
  SPI.setClockDivider(SPI_CLOCK_DIV4);                 
  Serial.println("SPI Clock Speed Set");
  
  /*
            Set clock polarity and phase
    Mode            CPOL          CPHA
    SPI_MODE0        0              0
    SPI_MODE1        0              1
    SPI_MODE2        1              0
    SPI_MODE3        1              1
  */
  SPI.setDataMode(SPI_MODE0) ;                              
   
  // Find out if the slave is connected (copied from the internet)
  SPI.transfer(0xCD);         // are you there?
  byte s = SPI.transfer(0);   // get response
  if (s == 0xEF)                    // peripheral is alive
  {
    Serial.println("SPI Device is Ready");
  } else{
    Serial.print("Device responded : ");
    Serial.println(s, DEC);
  }
  
// give the sensor time to set up:
  delay(100);
}

void loop() {
    digitalWrite(nSEL, LOW);      // enable Slave Select
    delay(10);
    r = SPI.transfer(0);                // read New Signal
    delay(10);
    digitalWrite(nSEL, HIGH);     // disable Slave Select

  Serial.print("Results: ");
  Serial.print(" r= ");
  Serial.println(r, DEC);
  delay(500);                    // Wait 1/2 second
}

The output is
Device responded : 0
Results: r= 0
Results: r= 0
Results: r= 0
etc

Maybe I’m over-simplifying it but then I am new to this stuff and I only want a very simple demo.
Thanks in advance

Hi,

I have now given up on this. Due to a lack of information and life is too short.

9