This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

services setup nrf8001

Services Setup

I am trying to feed the "Services Data" manually to the nRF8001.

As per the data sheet page 82 (see image below): Upon transmission of 1 packet of data an ACI_Transition_Continue should get generated: (i.e. some where a )"0x01" should get popped back to the Controller. If this is received then the controller should send out more packets, till the setup is complete.

image description

Now the first packet that I send out (after the nRF has been confirmed to be running is the standard packet:

{0x07,0x06,0x00,0x00,0x03,0x02,0x42,0x07};

The response is as follows:

image description

As you can see the sent in bytes just get echoed and there is no "01", instead I can see a "00" at the beginning (dont know if this means success ?).

In the next packet I sendout:

 {0x1f,0x06,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x06,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};

Again, I assume this is a standard setup paket.

The result is 30 times "00". Same with all following messages.

Is there some thing I am doing wrong ? SPI is working without a problem and when I try to do ECHO every thing works fine.

I would be much obliged to you get your help.

Parents
  • [Edited]

    What do you mean by feeding the setup data manually, You are taking the generated setup data from the nrfgo studio generated file "services.h" and then sending the setup messages one by one.

    Remember the ACI Event for your command will not be immediately sent (see section 7.1.6), so the SPI transactions during setup, typically look like this.

    Slow method for nRF8001 Setup

    Transaction 1: Lower REQN :: Wait for RDYN to be low :: ACI Setup command 1 clocked out from SPI master ::: 0 length packet clocked in from nRF8001 :: Raise REQN, RDYN will go high

    Transaction 2: RDYN is low signalling an ACI event :::: Lower REQN :: 0 length packet clocked out from the SPI master :::: ACI Event clocked in from the nRF8001 (Transaction continue) :: Raise REQN, RDYN will go high

    Transaction 3: Lower REQN :: Wait for RDYN to be low :: ACI Setup command 2 clocked out from SPI master :::: 0 length packet clocked in from nRF8001 :: Raise REQN, RDYN will go high

    Transaction 4: RDYN is low signalling an ACI event :::: Lower REQN :: 0 length packet clocked out from the SPI master :::: ACI Event clocked in from the nRF8001 (Transaction continue) :: Raise REQN, RDYN will go high

    ........

    Transaction 2N-1: (Where N is the number of Setup commands) Lower REQN :: Wait for RDYN to be low :: ACI Setup command N clocked out from SPI master ::: 0 length packet clocked in from nRF8001 :: Raise REQN, RDYN will go high

    Transaction 2N: (Where N is the number of Setup commands) RDYN is low signalling an ACI event :::: Lower REQN :: 0 length packet clocked out from the SPI master :::: ACI Event clocked in from the nRF8001 (Transaction Complete) :: Raise REQN, RDYN will go high

    Faster Method for nRF8001 Setup

    The nRF8001 has buffers available for a few commands so it is possible to burst the Setup commands until the buffers are filled up. The buffer availability is signalled by the RDYN line and will act as the flow control for the Setup. You can use fixed SPI clocks of 32 bytes but the ACI packet itself should be unmodified.

    Transaction 1: Lower REQN :: Wait for RDYN to be low :: ACI Setup command 1 clocked out from SPI master ::: 0 length packet clocked in from nRF8001 :: Raise REQN, RDYN will go high

    Transaction 2: Lower REQN :: Wait for RDYN to be low :: ACI Setup command 2 clocked out from SPI master ::: 0 length or ACI Event packet clocked in from nRF8001 :: Raise REQN, RDYN will go high

    Transaction 3: Lower REQN :: Wait for RDYN to be low :: ACI Setup command 3 clocked out from SPI master ::: 0 length or ACI Event packet clocked in from nRF8001 :: Raise REQN, RDYN will go high

    ........

    Transaction N-1: Lower REQN :: Wait for RDYN to be low :: ACI Setup command N-1 clocked out from SPI master ::: 0 length or ACI Event packet clocked in from nRF8001 :: Raise REQN, RDYN will go high

    Transaction N: Lower REQN :: Wait for RDYN to be low :: ACI Setup command N clocked out from SPI master ::: 0 length or ACI Event packet clocked in from nRF8001 :: Raise REQN, RDYN will go high

    Track the ACI Events so that you get the Transaction continue and Transaction complete. The faster method will reduce the number of transactions.

    Action requested: Attach a logic analyzer trace to verify that you are following the handshake rules on the SPI.

  • Dear David, Thanks for your kind response. I got some of what you said and some of it has confused me a bit:

    SPI Communication with the nRF8001:

    1. The exchange of the BITs in SPI will occure synchronusly. Therefore as soon as the SS is low and the RDY is low (i.e. a hand shake is signalled), the Master can start sending in bytes.

    As I observe: The RF8001 generates response and sending out the responses without waiting for the packet to come to an end. i.e. a sort of full duplex communication happens.

    Now what you are suggesting is :

    1. Pull SS Low and send a packet
    2. Then wait for RDY to go low and send in 32 times 0x00 and read the response.

    However as I observe, as soon as I pull the SS low the RDY also goes low. Is there some thing I am missing.

    I am much obliged for your excellent support to me on this matter.

Reply
  • Dear David, Thanks for your kind response. I got some of what you said and some of it has confused me a bit:

    SPI Communication with the nRF8001:

    1. The exchange of the BITs in SPI will occure synchronusly. Therefore as soon as the SS is low and the RDY is low (i.e. a hand shake is signalled), the Master can start sending in bytes.

    As I observe: The RF8001 generates response and sending out the responses without waiting for the packet to come to an end. i.e. a sort of full duplex communication happens.

    Now what you are suggesting is :

    1. Pull SS Low and send a packet
    2. Then wait for RDY to go low and send in 32 times 0x00 and read the response.

    However as I observe, as soon as I pull the SS low the RDY also goes low. Is there some thing I am missing.

    I am much obliged for your excellent support to me on this matter.

Children
No Data
Related