Hello,
I'm using the nrf52840 to try and receive a byte from the nRF24l01+.
After configuring, I trigger TASKS_RXEN, but never receive EVENTS_RXREADY.
Here is the code:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void radio_config(void)
{
*((uint32_t *)(RADIO_BASE + RADIO_POWER)) = 0;
*((uint32_t *)(RADIO_BASE + RADIO_POWER)) = 1;
*((uint32_t *)(RADIO_BASE + RADIO_FREQUENCY)) = 2;
*((uint32_t *)(RADIO_BASE + RADIO_SHORTS)) = 0;
*((uint32_t *)(RADIO_BASE + RADIO_TXPOWER)) = 0x8; // 8 dBm
*((uint32_t *)(RADIO_BASE + RADIO_MODE)) = 0;
*((uint32_t *)(RADIO_BASE + RADIO_PREFIX0)) = 0xE7;
*((uint32_t *)(RADIO_BASE + RADIO_BASE0)) = 0xE7E7E7E7;
*((uint32_t *)(RADIO_BASE + RADIO_RXADDRESSES)) = 1;
// LFLEN=6, S0LEN=0, S1LEN=3, S1INCL=1, CILEN=0, PLEN=0, CRCINC=0, TERMLEN=0
*((uint32_t *)(RADIO_BASE + RADIO_PCNF0)) =
(6 << RADIO_PCNF0_LFLEN) | (0 << RADIO_PCNF0_S0LEN) |
(3 << RADIO_PCNF0_S1LEN) | (1 << RADIO_PCNF0_S1INCL) |
radio_start() is called immediately after radio_config().
I prefer not to use the SDK... Sorry... I've verified all the register addresses and bit definitions with the manual, so I don't think that's the problem.
One strange thing is that if I trigger TASKS_TXEN, I do receive EVENTS_TXREADY. I've also verified by reading the STATE register that after triggering RXEN, the state remains in RXRU, whereas if I trigger TXEN, the state moves to TXIDLE.
EDIT: Need to make a correction. The value in the state register is 2, as expected for RXIDLE, but the event still isn't received.