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

nRF8001 Configuration in nRFgo Studio

Hello!

I have some problem to generate the right service.h file with nRFgo Studio. I used the help in nRFgo Studio and tried several configurations. Sometimes I could connect with Nordic's "nRF Connect" app but when i try to use the "nRF UART" app it says "uart is not supported".

I tried the setup commands from the Hello World Program from the Arduino SDK and I can connect with both apps, send data in both directions, from the phone to the nRF8001 and from the nRF8001 to the phone.

Now I would like to change the connection intervall as it changes the current consumption (nRFgo Studio --> current consumption).

First approach: I use the service.h file from the Hello World program and change the connection intervall with a command. There is no command to change the connection intervall, it can just changed with the setup generate in nRFgo Studio. Is that right? With the connect(0x0F) command just the advertising intervall can be defined, right?

Second approach: I use the same configuration in nRFgo Studio as used with the Hello World program, change the connection intervall and generate the service.h file. But for this approach I need to know which configuration is used in the Hello World program.

Would be great if you tell me the services I have to use and the GAP settings. I just want to send some data in the same way as it is done in the Hello World demo. I am new to BLE and and could miss something important in nRFgo studio.

Thank you very much.

  • I tried different connection intervals on 2 different phones but unfortunately the result is always the same.

    Interval min = 80 (=100ms) = 0000.0000.0101.0000 --> 0000.1010.0000.0000 = 0x0A00
    Interval max = 160 (=200ms) = 0000.0000.1010.0000 --> 0000.0101.0000.0000 = 0x0500
    Slave latency = 0x0000
    Timeout = 3200 = 0000.1100.1000.0000 --> 0000.0001.0011.0000 = 0x0130

    Data send: 0x09,0x13,0x0A,0x00,0x05,0x00,0x00,0x00,0x01,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00

    Interval min = 40 (=50ms) = 0000.0000.0010.1000 --> 0001.0100.0000.0000 = 0x1400
    Interval max = 80 (=100ms) = 0000.0000.0101.0000 --> 0000.1010.0000.0000 = 0x0A00

    0x09,0x13,0x14,0x00,0x0A,0x00,0x00,0x00,0x01,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00

    Interval min = 16 (=20ms) = 0000.0000.0001.0000 --> 0000.1000.0000.0000 = 0x0800
    Interval max = 40 (=50ms) = 0000.0000.0010.1000 --> 0001.0100.0000.0000 = 0x1400

    0x09,0x13,0x08,0x00,0x14,0x00,0x00,0x00,0x01,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00

    Interval min = 6 (=7.5ms) = 0000.0000.0000.0110 --> 0110.0000.0000.0000 = 0x6000
    Interval max = 16 (=20ms) = 0000.0000.0001.0000 --> 0000.1000.0000.0000 = 0x0800

    0x09,0x13,0x60,0x00,0x08,0x00,0x00,0x00,0x01,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00

    The CommandResponseEvent shows in all cases the same data:

    0x1 0x3 0x84 0x13 0x0 0xA0 0x0 0x0 0x0 0x1 0x30 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0

    And the TimingEvent is also the same for all connection intervals:

    0x1 0x7 0x89 0x27 0x0 0x0 0x0 0xD0 0x7 0x1 0x30 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0

    What is the right interpretation of the connection interval 0x27 0x00? The datasheet says MSB first. This would be 0x2700=9984 and out of the valid range? LSB/MSB in the datasheet means least significant byte or bit first?

    The used phones are Honor6 and LG L90, bot support Bluetooth 4.0. This should be ok?

    Thank you for your help!!!

  • I was able to solve the problem with the PCA10000 USB dongle. The problem was the wrong data format I used. The bytes has to be switched, not the bit order. For example to set the min/max value to 100ms, the value has to be set to 80 (80*1.25=100ms). 80=0x0050 --> the right data I had to send was 0x50 0x00.

    It seems that my phone doesn't support connection intvals lower than 48.75ms. I could change the connection interval down to 7.5ms when connected to the USB dongle. When the nRF8001 is connected to the phone to minimum connection interval is 48.75ms.

    I have another question: I want to send 20 x 20bytes and it takes 300ms. I assume that 2 connection events are needed to send 20 bytes (2 x 20 x 7.5ms = 300ms). Is that right? Why are 2 connection events needed to transmit 20bytes? Is there a way to send more data in one connection event/interval to reduce the time it takes to send the data?

    Thanks for your help!!

  • If you use notifications you should be able to send one data packet per connection event. This is the maximum supported by the nRF8001. If you use indications you will need 2-3 connection events per data packet as this requires application layer acknowledgement.

  • Thank you for your input! Can you please describe how to change it to notification? Do I need to change something in the configuration generated in nRFgo Studio? Or can this be done between the MCU and the nRF8001?

    Thanks.

  • You have to configure the notify property in nRFgo studio.

    In addition you need use the "SendData (0x15)" command and not the "SendDataAck" command.

Related