TRW-2.4G MODULE help

Hai,

I am using trw-2.4G module which is interfaced to silabs microcontroller(c8051f020) directly connnected to port pins. now i had converted pic code 256bit payload example.In the 256 bit pic code example(shock burst mode) transmitter and receiver configured but not possible(either transmitter or receiver).

144 bits send with 144 clock pulses but in this code started with 111 bit.

1.how can the modules knows 111bit location?

2.In my module DR1 pin is always high(when connected to port pin of controller).?

regards

nagarjuna

HI there,

Not sure what you mean about bit 111. Looking at the transmit_data function, I see that it clocks in the rf address and then immediately clocks in the data.

With regard to DR1, could you be holding it high with your uC? Does it stay hi when you separate them?

Pete

I had interfaced to silabs c8051f020 microcontroller with 8 Mhz internal clock. i had coverted pic code according to the my controller.

but its not working

1.the DR1 is always low?

2.when DR1 connected to port pin the DR1 is always when no transmission?

pls see code

sbit TX_CE = P3^7; //P3^0; /* Chip Enable activitates TX mode */

sbit TX_CS = P3^3; /* Chip Select activitates Configuration mode */

sbit TX_CLK1 = P3^1; /* Clock input (TX) & (RX) for data channel 1 */

sbit TX_DATA = P3^0; /* RX data channel1/TX data input */

sbit RX_CE = P3^7; /* Chip Enable activitates RX mode */

sbit RX_CS = P3^3; /* Chip Select activitates Configuration mode */

sbit RX_CLK1 = P3^1; /* Clock input (TX) & (RX) for data channel 1 */

sbit RX_DATA = P3^0; /* Clock input (TX) & (RX) for data channel 1 */

Any Suggestion …

//receiver program

//This will clock out the current payload into the data_array

void ReceiveData()

{

unsigned char i, j, temp;

unsigned char Data[5];

//RX_CE = 0;//Power down RF Front end

//Erase the current data array so that we know we are looking at actual received data

Data[0] = 0x00;

Data[1] = 0x00;

Data[2] = 0x00;

Data[3] = 0x00;

for(i = 0 ; i < 4 ; i++) //4 bytes

{

for(j = 0 ; j < 8 ; j++) //8 bits each

{

if(RX_DATA)

temp = (temp <<1) & 0x01;

else

temp = temp << 1;

RX_CLK1 = 1;

// Delay(100);

RX_CLK1 = 0;

}

Data = temp; //Store this byte
}

RX_CE = 1; //Power up RF Front end
}
//2.4G Configuration - Receiver
//This setups up a RF-24G for receiving at 1mbps
void Configure_Receiver(void)
{
unsigned char i,temp;
unsigned char config_setup[4];
//Config Mode
RX_CE = 0;
RX_CS = 1;
//Delay of 5us from CS to Data (page 30) is taken care of by the for loop
config_setup[0] = 0x23;
config_setup[1] = 0x4E;
config_setup[3] = 0x05; //Look at pages 13-15 for more bit info
for(i = 0 ; i < 4 ; i++)
{
temp =config_setup;
* for(i=0; i< 8; i++)*
* {*
* if(temp & 0x80)*
* RX_DATA = 1;
_
else*_
* RX_DATA = 0;*

* RX_CLK1 = 1;
RX_CLK1 = 0;*

* temp = temp << 1;*
}

}

//Configuration is actived on falling edge of CS (page 10)
RX_CE = 1; RX_CS = 0;
}
Transmitter Program
#include “Init.h”
#include “string.h”
#include “intrins.h”
void Configure_Transmitter(void)
{
* unsigned char i,temp;*
unsigned char config_setup[3];
//Config Mode
TX_CE = 0;
* TX_CS = 1;*

//Delay of 5us from CS to Data (page 30) is taken care of by the for loop
// Delay(0xffff);
// Delay(0xffff);

//Setup configuration word
* config_setup[0] = 0x23; //.0110.1110.0000.0100; //Look at pages 13-15 for more bit info*
* config_setup[1] = 0x4E; //250 kbps,one ch,0 dBm power*
config_setup[2] = 0x04; //Look at pages 13-15 for more bit info
for(i = 0 ; i < 4 ; i++)
{
temp =config_setup;
* for(i=0; i< 8; i++)*
* {*
* if(temp & 0x80)*
* TX_DATA = 1;
_ else*_

* TX_DATA = 0;*

* TX_CLK1 = 1;
_ // Delay(100);_
TX_CLK1 = 0;*

* temp = temp << 1;*
* }*
}

//Configuration is actived on falling edge of CS (page 10)
TX_CE = 0; TX_CS = 0;
}
//transmitter program
void TransmitData()
{
unsigned char i, j, temp, rf_address;
* unsigned char Data[5]={11,22,33};*
TX_CE = 1;
//Clock in address
rf_address = 0xE7; //0b.1110.0111; //Power-on Default for all units (on page 11)
for(i = 0 ; i < 8 ; i++)
{
* if(rf_address & 0x80)
TX_DATA = 1;
_ else*
* TX_DATA = 0;*
TX_CLK1 = 1;
// Delay(100);_

TX_CLK1 = 0;

rf_address = rf_address << 1;
}

//Clock in the data_array
for(i = 0 ; i < 4 ; i++) //4 bytes
{
temp = Data;

for(j = 0 ; j < 8 ; j++) //One bit at a time
{
* if(temp & 0x80)*
* TX_DATA = 1;
_ else*
* TX_DATA = 0;*
TX_CLK1 = 1;
* // Delay(100);*_

TX_CLK1 = 0;

temp =temp << 1;
}
}

TX_CE = 0; //Start transmission
}