This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF8001 echo command

Hello!

I am trying to set up the interface between an ARM Cortex-M4 andthe nRF8001. After RESET I see following data on the MISO line:

(turquoise=REQN/CS - pink=MOSI - blue=CLK - yellow=MISO)

0x80 - 0x20 - 0x81 - 0x40 - 0x00 - 0x40 - 0x00 - 0x00 -  ...

Because the LSB is sent first, the right data is:

0x01 - 0x04 - 0x81 - 0x02 - 0x00 - 0x02 - 0x00 - 0x00 - ....

The third byte is the event - 0x81 - which is the DeviceStartedEvent, is that right?

After that I want to send the ECHO command:

(turquoise=REQN/CS - pink=MOSI - blue=CLK - yellow=MISO)

First byte on MOSI line means lenght? Lenght=32=0010.0000 --> LSB first --> 0000.0100 = 0x04

Second byte on MOSI line means command? ECHO=0x02=0000.0010 -->LSB first --> 0100.0000=0x40.

Is this sequence on the MOSI line right for the ECHO command?

After the echo command is sent, the CS/REQN line has to be pulled high, the nRF8001 pulls the RDYN line also high. When the nRF8001 is ready to sent the echo event it pulls the REQN pin low and the MCU can send dummy bytes to receive data on the MISO pin. Is this approach right?

Thank you for your help!

Parents Reply
  • After changing byte[0] (lenght) to 0x80 (=1000.0000) --> LSB is sent first --> 0000.0001 => lenght is 1 (if this is right?) I receive an reply from the nRF8001.

    I send an echo command (0x02) (byte[1] = 0x40) and receive 0x21 -->LSB first => 0x84 which is the CommandResponseEvent.

    It seems that there is a problem with MSB/LSB first because I have to swap the transmittig and receiving data?

    Is this the right sequence: sending 0x02 and rreceiving 0x84 ?

    When would i receive the EchoEvent 0x82?

    Thank you!

Children
Related