Is 0b1110.0111 the nRF2401 broadcast address?

Hi,

Is 0b1110.0111 the nRF2401 broadcast address?

I am trying the sample code from the web page and dindt see this special address in non document but the example v01 use it.

What it means?

If I want to send a message for one node only how can I configure the address of that and all nodes, when I choose a 8 bit address?

Thanks

Alex

Look, I want to send the (original) 4 bytes from the web page sample to a node with address 0xAB. Here the code:

SENDER:

/*

nRF2401 test code to run on the 24G demo board, V01

This code will generate AUTOMATICALLY send and recieve packets from another demo board running the same V01 code.

This code does not accept user input.

Compiles with the free version of CC5X

Pete Dokter, 2/22/06

config_setup word 16 bits found on pages 13-15

23: 0 Payloads have an 8 bit address

22: 0

21: 1

20: 0

19: 0

18: 0

17: 1 16-Bit CRC

16: 1 CRC Enabled

15: 0 One channel receive

14: 1 ShockBurst Mode

13: 0 250K Transmission Rate

12: 0

11: 1

10: 1

9: 1 RF Output Power

8: 0 RF Output Power

7: 0 Channel select (channel 2)

6: 0

5: 0

4: 0

3: 0

2: 1

1: 0

0: 0 Transmit mode

*/

#define Clock_8MHz

#define Baud_9600

#include “16F88.h”

#pragma config |= 0x3F30 //Internal Oscillator, No WDT, MCLR Enabled

#define CS PORTA.0 //out

#define CLK1 PORTA.1 //out

#define DATA1 PORTA.2 //I/O

#define DR1 PORTA.3 //in

#define DATA2 PORTA.4 //in

#define CE PORTA.6 //out

#define CLK2 PORTA.7 //out

#define DR2 PORTB.0 //in

#define stat1 PORTB.1 //out

#define stat2 PORTB.3 //out

#define stat3 PORTB.4 //out

uns8 data_array[4];

void configure_transmitter(void);

void transmit_data(void);

void delay_ms(uns16);

void main()

{

//CONFIGURATION OF THE HARDWARE

OSCCON = 0b.0111.0000; //Setup internal oscillator for 8MHz

while(OSCCON.2 == 0); //Wait for frequency to stabilize

ANSEL = 0b.0000.0000; //Turn pins to Digital instead of Analog

CMCON = 0b.0000.0111; //Turn off comparator on RA port

PORTA = 0b.0000.0000;

TRISA = 0b.0011.1100; //0 = Output, 1 = Input

PORTB = 0b.0000.0000;

TRISB = 0b.1100.0101; //0 = Output, 1 = Input

//END OF HARDWARE CONFIGURATION

while(1)

{

stat1 = 0;

delay_ms(100);

configure_transmitter();

transmit_data();

stat1 = 1;

delay_ms(250);

}

}

//This sends out the data stored in the data_array

//data_array must be setup before calling this function

void transmit_data(void)

{

uns8 i, j, temp, rf_address;

data_array[0] = 0x12;

data_array[1] = 0x34;

data_array[2] = 0xAB;

data_array[3] = 0xCD;

CE = 1; //Temos dados para enviar por isso activamos o onboard data processing

delay_ms(1);

//Clock in address of the receiving module

rf_address = 0xAB;

for(i = 0 ; i < 8 ; i++)

{

DATA1 = rf_address.7;

CLK1 = 1;

CLK1 = 0;

rf_address <<= 1;

}

//Clock in the data_array (data playload)

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

{

temp = data_array*;*
for(j = 0 ; j < 8 ; j++) //One bit at a time
{
DATA1 = temp.7;
CLK1 = 1;
CLK1 = 0;
temp <<= 1;
}
}
CE = 0; //Start transmission
}
//2.4G Configuration - Transmitter
//This sets up one RF-24G for shockburst transmission
void configure_transmitter(void)
{
uns8 i,j;
uns8 temp;
uns8 config_setup[15];

PORTA = 0b.0000.0000;
TRISA = 0b.0011.1000; //0 = Output, 1 = Input (DR1 is on RA3) (DATA1 is on RA2)
//Config Mode
CE = 0; //Chip enable. Activa o TX ou o RX. Desliga para configuração
CS = 1; //Activates the configuration mode. In this mode a word of 15 bytes is downloaded to the nRF2401. Para isso são usados o CS, CLK1 e Data wires
delay_ms(1);
//Delay of 5us from CS to Data (page 30) is taken care of by the for loop

//Setup configuration word
//config_setup = 0b.0010.0011.0100.1110.0000.0100; //Look at pages 13-15 for more bit info
config_setup[0] = 0b.0000.0100;
config_setup[1] = 0b.0100.1110;
config_setup[2] = 0b.0010.0011;

//ADDR1=0,0,0,0,AB
config_setup[3] = 0xAB;
config_setup[4] = 0x00;
config_setup[5] = 0x00;
config_setup[6] = 0x00;
config_setup[7] = 0x00;
//ADDR2
config_setup[8] = 0x00;
config_setup[9] = 0x00;
config_setup[10] = 0x00;
config_setup[11] = 0x00;
config_setup[12] = 0x00;
//LENS
config_setup[13] = 0b.0000.0100;
config_setup[14] = 0b.0000.0000;

//free version
for (j = 3; j > 0; j–)
{
for(i = 0 ; i < 8 ; i++)
{
DATA1 = config_setup[j-1].7;
CLK1 = 1;
CLK1 = 0;
config_setup[j-1] <<= 1;
}
}
delay_ms(1);
//Configuration is actived on falling edge of CS (page 10)
CE = 0; CS = 0;
}
//General short delay
void delay_ms(uns16 x)
{
uns8 y, z;
for ( ; x > 0 ; x–)
for ( y = 0 ; y < 4 ; y++)
for ( z = 0 ; z < 176 ; z++);
}
RECEIVER:
/*
nRF2401 test code to run on the 24G demo board, V01

This code will generate AUTOMATICALLY send and recieve packets from another demo board running the same V01 code.
This code does not accept user input.

Compiles with the free version of CC5X
Pete Dokter, 2/22/06
config_setup word 16 bits found on pages 13-15

23: 0 Payloads have an 8 bit address
22: 0
21: 1
20: 0
19: 0
18: 0
17: 1 16-Bit CRC
16: 1 CRC Enabled
15: 0 One channel receive
14: 1 ShockBurst Mode
13: 0 250K Transmission Rate
12: 0
11: 1
10: 1
9: 1 RF Output Power
8: 0 RF Output Power
7: 0 Channel select (channel 2)
6: 0
5: 0
4: 0
3: 0
2: 1
1: 0
0: 0 Transmit mode

*/
#define Clock_8MHz
#define Baud_9600
#include “16F88.h”
#pragma config |= 0x3F30 //Internal Oscillator, No WDT, MCLR Enabled
#define CS PORTA.0 //out
#define CLK1 PORTA.1 //out
#define DATA1 PORTA.2 //I/O
#define DR1 PORTA.3 //in
#define DATA2 PORTA.4 //in
#define CE PORTA.6 //out
#define CLK2 PORTA.7 //out
#define DR2 PORTB.0 //in
#define stat1 PORTB.1 //out
#define stat2 PORTB.3 //out
#define stat3 PORTB.4 //out
uns8 data_array[4];
void boot_up(void);
void configure_receiver(void);
void receive_data(void);
void delay_ms(uns16);
void main()
{
uns8 x;

//HARDWARE INITIALIZATION
OSCCON = 0b.0111.0000; //Setup internal oscillator for 8MHz
while(OSCCON.2 == 0); //Wait for frequency to stabilize
ANSEL = 0b.0000.0000; //Turn pins to Digital instead of Analog
CMCON = 0b.0000.0111; //Turn off comparator on RA port
PORTA = 0b.0000.0000;
TRISA = 0b.0011.1100; //0 = Output, 1 = Input
PORTB = 0b.0000.0000;
TRISB = 0b.1100.0101; //0 = Output, 1 = Input
//END OF HARDWARE INITIALIZATION

stat1 = 1;
while(1)
{
stat1 = 0;
stat2 = 0;
configure_receiver();
delay_ms(50);
if(DR1 == 1) //We have data!
{
stat1 = 1;
receive_data();
if ((data_array[0] == 0x12) && (data_array[1] == 0x34) && (data_array[2] == 0xAB) && (data_array[3] == 0xCD))
{
stat2 = 1;
}
delay_ms(200);
}
}
}
//This will clock out the current payload into the data_array
void receive_data(void)
{
uns8 i, j, temp;
CE = 0;//Power down RF Front end
//Erase the current data array so that we know we are looking at actual received data
data_array[0] = 0x00;
data_array[1] = 0x00;
data_array[2] = 0x00;
data_array[3] = 0x00;
//Clock in data, we are setup for 32-bit payloads
for(i = 0 ; i < 4 ; i++) //4 bytes
{
for(j = 0 ; j < 8 ; j++) //8 bits each
{
temp <<= 1;
temp.0 = DATA1;
CLK1 = 1;
CLK1 = 0;
}
data_array = temp; //Store this byte
}
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)
{
uns8 i,j;
uns8 temp;
//uns8 config_setup[3];
uns8 config_setup[15];
//During configuration of the receiver, we need DATA1 as an output
PORTA = 0b.0000.0000;
TRISA = 0b.0011.1000; //0 = Output, 1 = Input (DR1 is on RA3) (DATA1 is on RA2)
//Config Mode
CE = 0; CS = 1;
delay_ms(1);

//Setup configuration word, set up for 250k
//config_setup = 0b.0010.0011.0100.1110.0000.0101; //Look at pages 13-15 for more bit info
config_setup[0] = 0b.0000.0101; // freq _chanel+Rx
config_setup[1] = 0b.0100.1110; // 1canal+shockburst+256kbps+16Mhz±5db
config_setup[2] = 0b.0010.0011; // 8bits_endereço+16bit_crc+crc_om
//ADDR1=0,0,0,0,AB
config_setup[3] = 0xAB;
config_setup[4] = 0x00;
config_setup[5] = 0x00;
config_setup[6] = 0x00;
config_setup[7] = 0x00;
//ADDR2
config_setup[8] = 0x00;
config_setup[9] = 0x00;
config_setup[10] = 0x00;
config_setup[11] = 0x00;
config_setup[12] = 0x00;
//LENS
config_setup[13] = 0b.0000.0100;
config_setup[14] = 0b.0000.0000;

//Faz download da configuração para o chip
//for (j = 3; j > 0; j–)
for (j = 15; j > 0; j–)
{
for(i = 0 ; i < 8 ; i++)
{
DATA1 = config_setup[j-1].7;
CLK1 = 1;
CLK1 = 0;
config_setup[j-1] <<= 1;
}
}
//Configuration is actived on falling edge of CS (page 10)
CE = 0; CS = 0;

//After configuration of the receiver, we need DATA1 as an input
PORTA = 0b.0000.0000;
TRISA = 0b.0011.1100; //0 = Output, 1 = Input (DR1 is on RA3) (DATA1 is on RA2)

delay_ms(1);
//Start monitoring the air
CE = 1; CS = 0;
}
//General short delay
void delay_ms(uns16 x)
{
uns8 y, z;
for ( ; x > 0 ; x–)
for ( y = 0 ; y < 4 ; y++)
for ( z = 0 ; z < 176 ; z++);
}
Receiver never receives nothing… If I use the original code with only 3 bytes for configuration it works, but when I use 15 bytes with explicit node hardware configuration it does not receive nothing…
Please, consider help me. A sample source code for the TRF-2.4G v1.0 that uses the full 15 bytes would also be appreciated.
Thank you,
Alex
ENV:
win xp
trf-2.4G euk v1.0 with nRF2401
cc5x free edition

Please, on page 11, where is the reference for:

// Power-on Default for all units (on page 11)

output_byte(0b11100111);

Is this an address? is this a well defined address? Which means what?

Thank you very much

Alex

Done.

For those who are beginners like me, be carefull that the Payload section width in in bit units and not in byte units!

Alex

can you re-post your final codes?

How did you fix your previous code? I also have been trying to work

RF sensor but I had no luck and I quit it for few weeks. I thought it

may refresh my thougths…

I am using c18, so it might be little bit more hard to change ccs5 code

to make RF sensor to work.

Look, the complete source code is already on this forum thread. Just pay attention to the units as I said in a previous message. If you cant put it to work let me know and I send the source code. Remember I am using CC5X compiler

Alex

so you used a sample code provided by SFE?

Did you make any changes from the sample?

I used the code downloaded from the web page of sparkfun.

I just split it into sender.c and receiver.c in order to understand it better. Today I have the code in a unique .c file with half duplex communication. It waits data on serial port and then it send it to the antenna and it senses the antenna for receiving information and then it sends it to the serial port (bidirectional).

It works only till 4800 bps. If we configure a bigger speed there is no time to achieve that. With 4800 bps it works ok.

Alex

myjcha:
How did you fix your previous code? I also have been trying to work

RF sensor but I had no luck and I quit it for few weeks. I thought it

may refresh my thougths…

I am using c18, so it might be little bit more hard to change ccs5 code

to make RF sensor to work.

Here’s C18 Rx and Tx code of mine:

/*
** Rx.c
** Receive test program for PIC18F4520 and nRF24L01
**
** The LED is flashed five times when data are received.
** The received data in the buffer may be checked using the 
** debugger Watch window.*/

#include <p18f4520.h>

//function prototypes
void init(void);
void reset_RX(void);
void configure_RX(void);
unsigned char spi_Send_Read(unsigned char);
void delay_ms(int);

// Defines
#define SPI_SCK		LATCbits.LATC3		// Clock pin, PORTC pin 3 
#define SPI_SO		LATCbits.LATC5		// Serial output pin, PORTC pin 5 
#define SPI_SI		PORTCbits.RC4		// Serial input pin, PORTC pin 4 
#define SPI_CSN		LATCbits.LATC2		// CSN output pin, PORTC pin 2
#define SPI_CE		LATCbits.LATC1		// CE output pin, PORTC pin 1
#define SPI_IRQ		PORTBbits.RB0		// IRQ input pin, PORTB pin 0
#define SPI_SCALE	4              		// postscaling of signal 
#define LED			LATAbits.LATA0
#define PB			PORTAbits.RA1

// Macros
#define nop() _asm nop _endasm

void main(void)
{
	unsigned char i;

	init();
	configure_RX();
	while(1)
	{
   		if (SPI_IRQ == 0)    //wait for anything
        {
            for (i = 0; i < 5; i++)  //flash LED 5 times if data received
            {
                LED = 1;
                delay_ms(10);
                LED = 0;
                delay_ms(10);
            }
            delay_ms(200);
            reset_RX();            
        }
	}
}

// initialise 18F4520
void init(void)
{
	// run internal oscillator at 8 MHz
	OSCCON = OSCCON | 0x70;
	while (OSCCONbits.IOFS == 0)
		;

	PORTA = 0x00;
	ADCON1 = 0x0F;		// set up PORTA to be digital I/Os
	TRISA = 0x02;		// PORTA<7.2,0> outputs PORTA<1> input
	TRISCbits.TRISC3 = 0;	// SDO output
	TRISCbits.TRISC5 = 0;   // SCK output
	TRISCbits.TRISC2 = 0;	// CSN output
	TRISCbits.TRISC1 = 0;	// CE output
	TRISBbits.TRISB0 = 1;	// IRQ input
}

//configure nRF24L01 for receive
void configure_RX(void)
{
    unsigned char i, j;

    SPI_CSN = 0;
    SPI_CE = 0;
    
	//PRX, CRC enabled
  	spi_Send_Read(0x20);
	spi_Send_Read(0x39); 
    SPI_CSN = 1;   
    SPI_CSN = 0;
    
	//disable auto-ack for all channels      
  	spi_Send_Read(0x21);
	spi_Send_Read(0x00);     
    SPI_CSN = 1;    
    SPI_CSN = 0;
    
	//address width = 5 bytes  
  	spi_Send_Read(0x23);
	spi_Send_Read(0x03);    
    SPI_CSN = 1;    
    SPI_CSN = 0;
    
	//data rate = 1MB   
  	spi_Send_Read(0x26);
	spi_Send_Read(0x07);    
    SPI_CSN = 1;
    SPI_CSN = 0;

	//4 byte payload  
 	spi_Send_Read(0x31);
	spi_Send_Read(0x04);    
    SPI_CSN = 1;    
    SPI_CSN = 0;

    //set channel 2 
   	spi_Send_Read(0x25);
	spi_Send_Read(0x02);    
    SPI_CSN = 1;     
    SPI_CSN = 0;

    //set address E7E7E7E7E7
    spi_Send_Read(0x30);
    for (j = 0; j < 5; j++)
 		spi_Send_Read(0xE7); 
    SPI_CSN = 1;  
    SPI_CSN = 0;
    
	//PWR_UP = 1   
 	spi_Send_Read(0x20);
	spi_Send_Read(0x3B);   
    SPI_CSN = 1;    
    SPI_CE = 1;     
}

void reset_RX(void)
{
    unsigned char i, j;
    unsigned char buffer[4];    
    
	//Read RX payload   
    SPI_CSN = 0;    
   	spi_Send_Read(0x61);    
    for (j = 0; j < 4; j++)
    {        
       	buffer[j] = spi_Send_Read(0);        
    }    
    SPI_CSN = 1;    
    
	//Flush RX FIFO    
    SPI_CSN = 0;    
 	spi_Send_Read(0xE2);    
    SPI_CSN = 1;
    SPI_CSN = 0;
 
	//reset int    
  	spi_Send_Read(0x27);
	spi_Send_Read(0x40);    
    SPI_CSN = 1;
}

/******************************************************************** 
 * Function:        unsigned char spi_Send_Read(unsigned char bytein) 
 * 
 * Description:     This function outputs a single byte onto the 
 *                  SPI bus, MSb first. And it gets the response. 
 *******************************************************************/ 
unsigned char spi_Send_Read(unsigned char bytein) 
{ 
    static unsigned char i;         // Loop counter 
   static unsigned char j;         // Delay counter 
   unsigned char byteout = 0;      // return bit 

    SPI_SCK = 0;                        // Ensure SCK is low 
    for (i = 0; i < 8; i++)         // Loop through each bit 
    { 
        if (bytein & 0x80)          // Check if next outbit is a 1 
        { 
            SPI_SO = 1;                 // If a 1, pull SO high 
        } 
        else 
        { 
            SPI_SO = 0;                 // If a 0, pull SO low 
        } 
        byteout = byteout << 1;     // Shift outbyte left for next bit 
        if (SPI_SI == 1)                // Check if next inbit is a 1 
        { 
            byteout |= 0x01;         // If a 1, set next bit to 1 
        } 
        else 
        { 
            byteout &= 0xFE;         // If a 0, set next bit to 0 
        } 
        SPI_SCK = 1;                    // Bring SCK high to latch bit 
        for (j = 0; j < SPI_SCALE; j++) 
      { 
         nop();                      // Avoid violating Thi 
      } 
        SPI_SCK = 0;                    // Bring SCK low for next bit 
        bytein = bytein << 1;       // Shift byte left for next bit 
    } 
   return byteout; 
} // end of spi_Send_Read(...)

void delay_ms(int x)
{
    int y, z;
    for ( ; x > 0 ; x--)
        for ( y = 0 ; y < 4 ; y++)
            for ( z = 0 ; z < 176 ; z++);
}
/*
** Tx.c
** Transmit test program for PIC18F4520 and nRF24L01
**
**
*/

#include <p18f4520.h>

//function prototypes
void init(void);
void transmit_data(void);
void configure_transmitter(void);
unsigned char spi_Send_Read(unsigned char);
void delay_ms(int);

// Defines
#define SPI_SCK		LATCbits.LATC3		// Clock pin, PORTC pin 3 
#define SPI_SO		LATCbits.LATC5		// Serial output pin, PORTC pin 5 
#define SPI_SI		PORTCbits.RC4		// Serial input pin, PORTC pin 4 
#define SPI_CSN		LATCbits.LATC2		// CSN output pin, PORTC pin 2
#define SPI_CE		LATCbits.LATC1		// CE output pin, PORTC pin 1
#define SPI_IRQ		PORTBbits.RB0		// IRQ input pin, PORTB pin 0
#define SPI_SCALE	4              		// postscaling of signal 
#define LED			LATAbits.LATA0
#define PB			PORTAbits.RA1

// Macros
#define nop() _asm nop _endasm

void main(void)
{
	unsigned char i;

	init();
	configure_transmitter();
    while(1)
    {        
        while (1)  
        {
            transmit_data();
            LED = 1;
            delay_ms(10);
            LED = 0;           
            delay_ms(500);           
        }  
    }
}


void init(void)
{
	// run internal oscillator at 8 MHz
	OSCCON = OSCCON | 0x70;
	while (OSCCONbits.IOFS == 0)
		;
	PORTA = 0x00;
	ADCON1 = 0x0F;		// set up PORTA to be digital I/Os
	TRISA = 0x02;		// PORTA<7.2,0> outputs PORTA<1> input
	TRISCbits.TRISC3 = 0;	// SDO output
	TRISCbits.TRISC5 = 0;   // SCK output
	TRISCbits.TRISC2 = 0;	// CSN output
	TRISCbits.TRISC1 = 0;	// CE output
	TRISBbits.TRISB0 = 1;	// IRQ input
}

void configure_transmitter(void)
{
    unsigned char i, j, data, cmd;

    SPI_CE = 0;
    SPI_CSN = 0;

	// PTX, CRC enabled, mask a couple of ints    
 	spi_Send_Read(0x20);
  	spi_Send_Read(0x38);
	SPI_CSN = 1; 
    SPI_CSN = 0;
    
	//auto retransmit off
 	spi_Send_Read(0x24);    
   	spi_Send_Read(0x00);    
    SPI_CSN = 1;
    SPI_CSN = 0;
    
	//address width = 5
   	spi_Send_Read(0x23);
 	spi_Send_Read(0x03);    
    SPI_CSN = 1;
    SPI_CSN = 0;
    
	//data rate = 1MB
   	spi_Send_Read(0x26);
 	spi_Send_Read(0x07);
    SPI_CSN = 1; 
    SPI_CSN = 0;
    
	//set channel 2, this is default but we did it anyway...
   	spi_Send_Read(0x25);
 	spi_Send_Read(0x02);
    SPI_CSN = 1;
    
	//set address E7E7E7E7E7, also default...
   	spi_Send_Read(0x30);    
    for (j = 0; j < 5; j++)
    {
        spi_Send_Read(0xE7);
    }  
    SPI_CSN = 1;
    SPI_CSN = 0;
    
    //disable auto-ack, RX mode
    //shouldn't have to do this, but it won't TX if you don't
   	spi_Send_Read(0x21);
 	spi_Send_Read(0x00);
    SPI_CSN = 1;
}

void transmit_data(void)
{
    unsigned char i, data, cmd;   
    
    SPI_CSN = 0;
    
	//clear previous ints
  	spi_Send_Read(0x27);
 	spi_Send_Read(0x7E);
	SPI_CSN = 1;
    SPI_CSN = 0;
    
	//PWR_UP = 1
   	spi_Send_Read(0x20);
 	spi_Send_Read(0x3A);
    SPI_CSN = 1;
    SPI_CSN = 0;
    
    //clear TX fifo
    //the data sheet says that this is supposed to come up 0 after POR, but that doesn't seem to be the case
   	spi_Send_Read(0xE1);
    SPI_CSN = 1;
    SPI_CSN = 0;
    
	//4 byte payload
   	spi_Send_Read(0xA0);
   	spi_Send_Read(0x34);
  	spi_Send_Read(0x33);
   	spi_Send_Read(0x32);
  	spi_Send_Read(0x31);
    SPI_CSN = 1;
    
    //Pulse CE to start transmission
    SPI_CE = 1;
    delay_ms(1);
    SPI_CE = 0;
}

/******************************************************************** 
 * Function:        unsigned char spi_Send_Read(unsigned char bytein) 
 * 
 * Description:     This function outputs a single byte onto the 
 *                  SPI bus, MSb first. And it gets the response. 
 *******************************************************************/ 
unsigned char spi_Send_Read(unsigned char bytein) 
{ 
    static unsigned char i;         // Loop counter 
	static unsigned char j;         // Delay counter 
	unsigned char byteout = 0;      // return bit 

    SPI_SCK = 0;                        // Ensure SCK is low 
    for (i = 0; i < 8; i++)         // Loop through each bit 
    { 
        if (bytein & 0x80)          // Check if next outbit is a 1 
        { 
            SPI_SO = 1;                 // If a 1, pull SO high 
        } 
        else 
        { 
            SPI_SO = 0;                 // If a 0, pull SO low 
        } 
        byteout = byteout << 1;     // Shift outbyte left for next bit 
        if (SPI_SI == 1)                // Check if next inbit is a 1 
        { 
            byteout |= 0x01;         // If a 1, set next bit to 1 
        } 
        else 
        { 
            byteout &= 0xFE;         // If a 0, set next bit to 0 
        } 
        SPI_SCK = 1;                    // Bring SCK high to latch bit 
        for (j = 0; j < SPI_SCALE; j++) 
      { 
         nop();                      // Avoid violating Thi 
      } 
        SPI_SCK = 0;                    // Bring SCK low for next bit 
        bytein = bytein << 1;       // Shift byte left for next bit 
    } 
   return byteout; 
} // end of spi_Send_Read(...)


void delay_ms(int x)
{
    int y, z;
    for ( ; x > 0 ; x--)
        for ( y = 0 ; y < 4 ; y++)
            for ( z = 0 ; z < 176 ; z++);
}

IIRC it’s based on Brennen’s code, but using software SPI.

Leon

Hi,

Me, possible like you, i am a beginner in this stuff. Remember this! :slight_smile:

I am thinking to write a tutorial to put those wireless modules to work.

Is this be worth?

Well,

First, put the software appart. Lets look to the hardware first.

Who solder (solering iron) the hardware parts? Were you or a professinal?

Look, my base skills are computer science not native electronics. I tried to solder it by myself and I waist almost a month because the soldering was not good but it seemed to the good but it was not. So I acquire new modules and ask to a professional soldering man. Then I burned the web pages source code and when do not send information but, turning off CRC I could see it (for the first time) receiving rabish. Great!!

Well, Are you sure that soldering task was well done?

If so we pass to the second point.

Alex