This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

problem in programming cc1101 as transmitter and receiver using arduino uno board

Other Parts Discussed in Thread: CC1101

i am using two arduino boards with cc1101 transceiver .i am trying to use one as transmitter and the other as receiver but when i try to read any register it gives me value 0 .what does this mean .  i am using the ELECHOUSE cpp file and header files .is there any error in these files.the header and cpp file i am attaching below.the TX and RX code is given below.

transmitter code;

#include <ELECHOUSE_CC1101.h>

#define size 61

byte TX_buffer[size]={
0};
byte i,s;

void setup()
{
Serial.begin(9600);
ELECHOUSE_cc1101.Init();
for(i=0;i<size;i++)
{
TX_buffer[i]=i;
}
}

void loop()
{

s=ELECHOUSE_cc1101.SpiReadReg(CC1101_FREQ0)

Serial.Println(s)
ELECHOUSE_cc1101.SendData(TX_buffer,size);
delay(1);
}

RX

#include <ELECHOUSE_CC1101.h>

void setup()
{
Serial.begin(9600);
ELECHOUSE_cc1101.Init();
ELECHOUSE_cc1101.SetReceive();
}

byte RX_buffer[61]={0};
byte size,i,j,flag;

void loop()
{
if(ELECHOUSE_cc1101.CheckReceiveFlag())
{
size=ELECHOUSE_cc1101.ReceiveData(RX_buffer);
for(i=0;i<size;i++)
{
//Serial.print(RX_buffer[i],DEC);


Serial.write(RX_buffer[i]);

for(j=0;j<size;j++)

{

Serial.Println(RX_buffer[j]);

}
//Serial.print('',BYTE);
Serial.write(' ');
}
Serial.println(" ok");
ELECHOUSE_cc1101.SetReceive();
}
}

4572.ELECHOUSE_CC1101.h

7206.ELECHOUSE_CC1101.cpp

  • Hi

    I am not familiar with the HW or the SW you are using (only with the CC1101). What I would recommend is that you monitor your SPI traffic and verify that it is according to the CC1101 data sheet. You should also do a manual reset before accessing the radio, as described in the CC1101 data sheet. If you suspect that there is something wrong with the files you are using you can try to contact Elechouse and see if they can answer any questions you might have.

    If you get the logic analyzer plots you can post it here and someone will take a look at them.

    BR

    Siri

  • in transmitter code, isn't SpiReadReg a private function? How did you access it from the code?