I would like to use the nRF2401a chip to receive other GFSK modulated signals in the 2.4 GHz band using a modulation index of ~0.32 with a modulation rate of 4 samples/symbol (or a different chip, if there is a recommendation). Reading the Nordic data sheet on this chip it appears there is a direct receive mode, but the functionality isn’t clear to me:
Once the nRF2401 is configured and powered up (CE high) in direct RX mode, DATA will start to toggle due to noise present on the air.
CLK1 will also start to toggle as nRF2401 is trying to lock on to the
incoming data stream.
Once a valid preamble arrives, CLK1 and DATA will lock on to the
incoming signal and the RF package will appear at the DATA pin with the
same speed as it is transmitted.
I read this as indicating that direct mode RX, CLK1 and DATA will start to toggle based on noise (or signal) observed in the air. In “3”, CLK1 and DATA are set following a valid preamble. Are both conditions valid, or will I only receive data following a valid preamble?
If this is the wrong chip to decode GFSK data not specifically transmitted by a similar nRF chip, that advice is most welcome too.
I’m just going to take a stab at this and say that you are likely only going to pick up GFSK transmissions even in direct mode. The nRF2401 is still looking for the same data it would in Shockburst mode, except you are specifying what bits you want to send (notice it says, "3. Once a valid preamble arrives, CLK1 and DATA will lock on to the
I’ve learned a lot about PIC programming in the past few weeks, so this isn’t a total loss, but I am starting to think the nRF2401 won’t give me the data I’m looking for.
The goal was to capture GFSK modulated data from a specific frequency using the nRF2401 direct RX mode. I’m shifting in the configuration word for direct RX at 250 Kbps at 2.430GHz. The spec sheet says that Data Ready (DR) won’t go high in this mode, so I just started sampling DATA constantly to see if there was anything to be collected.
When I start receiving, DATA returns a bunch of 0x00 and 0xFF values, but nothing else that is interesting. This doesn’t change when I generate some GFSK modulated traffic on the same frequency too.
I’m not sure what to expect from DATA without DR; will CLK1 toggle for each bit there is to read in DATA? I’m not sure.
I’m posting the code here in case anyone has any suggestions on what I might try next. I think I’ll also email Nordic and see if they have any suggestions.
Thanks,
-Josh
#define Clock_8MHz
#define Baud_9600
#include "16f88.h"
#pragma origin 4 /* Must define before including code for Bloader codebump */
#include "stdio.c"
#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
void boot_up(void);
void delay_ms(uns16);
void configure_receiver(void);
void receive_data(void);
void boot_up(void)
{
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;
PORTB = 0b.0000.0000;
TRISB = 0b.1100.0101; //0 = Output, 1 = Input
enable_uart_TX(0);
}
/* General short delay for 8 MHz 16F88 PIC */
void delay_ms(uns16 x)
{
uns8 y, z;
for ( ; x > 0 ; x--)
for ( y = 0 ; y < 4 ; y++)
for ( z = 0 ; z < 69 ; z++);
}
/* 2.4G Configuration - Receiver */
void configure_receiver(void)
{
uns8 i,j;
uns8 config_setup[2], temp;
//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);
/*
Configuration data for nRF2401 found on datasheet v1.1 pages 17-23
"For direct mode operation, only the first two bytes (bit[15:0]) of the
configuration word are relevant." page 17
15: 0 One channel receive
14: 0 Communication mode (direct RX mode)
13: 0 Transmission Rate (250 Kbps)
12: 0 XO Frequency selection (16 MHz factory default)
11: 1
10: 1
9: 1 RF Output Power (use 0 dBm)
8: 1
7: 0 Channel select (use 2.430 GHz)
6: 0
5: 1
4: 1
3: 1
2: 1
1: 0
0: 1 Configures RX or TX mode of operation, (use RX mode)
*/
/* Setup configuration word for direct RX */
config_setup[0] = 0b.0000.0101;
config_setup[1] = 0b.0000.1111;
//free version of CC5X
for (j = 2; 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 activated on falling edge of CS (page 18) */
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;
}
//This will clock out the current payload into the data_array
void receive_data(void)
{
uns8 j, temp;
CE = 0; //Power down RF Front end
//Clock in data
for(j = 0 ; j < 8 ; j++) //8 bits each
{
temp <<= 1;
temp.0 = DATA1;
CLK1 = 1;
CLK1 = 0;
}
printf("%h ", temp);
CE = 1; //Power up RF Front end
}
void main()
{
uns8 i;
boot_up();
stat1 = 0;
stat3 = 0;
for (i=0; i < 16; i++) {
stat1 ^= 1;
stat3 ^= 1;
delay_ms(100);
}
stat1 = 0;
stat3 = 0;
while(1) {
configure_receiver();
stat1 ^= 1;
delay_ms(50);
receive_data();
}
}