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

nRF8001 maximum paket size per connection event

Hello!

I need to send 20 x 20 bytes with the nRF8001 and would like to reduce the transmitting time as much as possible to set the MCU and nRF8001 in sleep mode as long as possible.

1) Reducing the connection interva leads to reduced transmitting time, right? 7.5ms is the minimum and would give the shortest transmitting time? I have some problems to change the connection interval, see  my post here.

2) The datasheet says MTU is 27 bytes. Does this mean that during one connection event 27 bytes can be sent? At the moment the connection interval is 48.75ms and I am sending 20 bytes but it takes 2 connection events (~100ms) to send 20 bytes. When i send 20 x 20 bytes it takes almost 2 seconds.

Do I have to change the MTU? Why are 2 connection events needed to send 20 bytes?

Is there a way to send more, like 40 bytes, during one connection event?

I am not sure about data per paket and pakets per connection event. What are the maximum values for this terms

Are there other options to reduce the transmitting time?

Thank you very much for your help!!!

Parents
  • The maximum number of packets in an connection event best case is 2 packets in a burst. The average will be 1 packet in a connection event for sustained data traffic.

    The number of credits as stated in the Device Started Event shows the buffers available for the packets that can sent(TX). They need to be in the nRF8001 buffers early enough so that they can be processed for the connection event.

    What is the number of credits that you see in your Device Started Event ?

Reply
  • The maximum number of packets in an connection event best case is 2 packets in a burst. The average will be 1 packet in a connection event for sustained data traffic.

    The number of credits as stated in the Device Started Event shows the buffers available for the packets that can sent(TX). They need to be in the nRF8001 buffers early enough so that they can be processed for the connection event.

    What is the number of credits that you see in your Device Started Event ?

Children
  • Hello David.
    After reset I receive following data: 0x1 0x4 0x81 0x2 0x0 0x2 ...
    There are 2 buffers available.

    I transmit 32 bytes with an SPI clock of 1MHz. Could this be a problem?

  • 32 bytes with a SPI clock of 1 MHz is ok. You can increase the clock to 3MHz if your mcu supports it.

    You will need to clock the packets early enough so that it can be processed by the radio. (I think you need to finish all the SPI transactions atleast 1.5ms before the radio starts up for the connection event)

    You can use the ACTIVE signal to signal to let you know how early you want to be signaled before the radio starts up. The ACTIVE signal on the nRF8001 is available only when the connection/advertising interval is greater than or equal to 30ms.

    Verify the above with a logic analyzer. 

    You can do the 2 packets only in a burst (when only using the TX to push packets as fast as possible), as the TX buffers will be returned for use only after they are acked by the peer radio. Typical bandwidth on the TX will be 20 bytes (1 packet) per connection interval.

    The RX path typically has 3 packets per connection interval. My hypothesis is that the peak bandwidth of 2 packets in a connection interval (sustained) can be achieved only when the RX path is also sending 3 packets per connection interval. (See attached sniffer trace , viewable in Wireshark 2.6.1 as a support for my hypothesis)

    3034.DFU_nRF8001_ble_optiboot_Android_nRFToolbox_1_16_0.pcapng

  • I changed the SPI clock to 3MHz with no effect.

    I cannot use the active signal because I want to use a connection interval less than 30ms.

    The data transfer from the MCU to the nRF8001 happens at random times. I send the command/data, receive the corresponding event and send the next command/data. Is this sequence right?

    Every data transfer needs 2 connection interval. This would mean that every single SPI transactions finishes to late (less than 1.5ms before the radio starts up for the connection event). Is this realistic?

    You mean that the receiver has to send 3 packets per connection interval that the nRF8001 also sends 2 packets per connection interval? I don't need so send data from the phone so I could just send dummy data from the phone to the nRF8001 to achieve that the nRF8001 sends 2 packets per connection interval. Is that right?

    Thank you very much!

Related