Hi all. I seem to be having problems getting the nRF24L01+ to work with a Pololu X2 controller. It uses the atmega644p chip. I can write to the CONFIG register and read back whatever I write to it. I can trigger the IRQ line to the processor externally so know the code works but the nRF24L01 doesn’t go low to trigger it when data arrives. I’m transmitting to the controller using one of the Nordic Serial Interface Boards from SparkFun. I can send data between two serial boards but not from serial board to the controller.
The return code from STATUS always reads 0x83. Is this normal?
Could I have the CONFIG registers set wrong? Here’s my setup:
void init_nRF24L01()
{
unsigned int config;
// Initializes pins and interrupt to communicate with the MiRF module
// Should be called in the early initializing phase at startup.
// Define CSN and CE as Output and set them to default
DDRD |= ((1<<CSN)|(1<<CE));
CE_lo;
CSN_hi;
// Initialize external interrupt on port PA0 (PCINT0)
DDRA = 0;
DDRB |= (1<<PB4);
PORTB = (1<<PB4);
PCMSK0 = (1<<PCINT0);
PCICR = (1<<PCIE0);
config_register(RF_CH, CHANNEL); // channel 2
config_register(RX_PW_P0, PAYLOAD_SIZE); // payload size = 16
config_register(CONFIG, ( (1<<MASK_RX_DR) | (1<<EN_CRC) | (0<<CRCO) )
| ( (1<<PWR_UP) | (1<<PRIM_RX) ) );
CE_hi; // goto listen mode…
}
in main()…
// the CONFIG register reads 0x0B as planned
CSN_lo;
printf("Cnfg:%X ", spi_master_transmit(R_REGISTER | CONFIG));
CSN_hi;
CSN_lo;
lcd_goto_xy(0,1);
spi_master_transmit(R_REGISTER | STATUS);
status = spi_master_transmit(NOP);
printf("%X ", status); //this always reads 0x83
CSN_hi;