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

nRF52840 multiperipheral with very low power sleep mode

Hello, I want to make multiperipheral system with nRF52840 (Im using 4x nRF52840DK). Im using latest SDK17. I wrote criteria i want to put to this system below:

1. Devices are supposed to be connected with BLE

- One central device

- Minimum three peripheral devices

2. Peripheral devices are supposed to be in sleep mode

- Sleep time ~1min

- System ON, full 256kB RAM retention, wake on GPIOTE - PORT event (power consumption in sleep mode less than 3uA)

- I don't want any advertising in sleep mode

3. Peripheral devices are supposed to be wake up with port event and then i want to send 8kB of data over BLE from RAM

- uint8_t data[8192];

- data need to be send with the highest througput posibble

4. Central device is supposed to only recieve data

- not needed sleep mode

- data need to be written in internal RAM (uint8_t data[3][8192];) or something similar

And my questions are:

How to start?

What are the best examples to modify?

It is posibble to achieve constant 3uA current consumption in sleep (1min) and after wake up send the data in 60ms (after that again go to sleep)?

Best regards

Rafał Dolny

  • Hello Rafal,

    First of all, do you intend to connect to several devices at once, or do you only need to connect to one at the time (at one minute intervals)?

    If you need more connections, I suggest you look into the ble_central\ble_app_multilink_central for inspiration, and change out the service (LBS, led button service) with the ble_nus_c sample.

    If you only need one connection at the time, start with the ble_app_uart_c as your central project. The peripherals can use the ble_app_uart example. 

    What you need to implement is the sleep system you like, and the transfer of the data. When you are done transferring, you can disconnect (can be done from the central or peripheral). Then when you disconnect, stop the advertisements (or don't start them), and set an app timer for 1 minute. If you are using System on mode, you can just leave the main function as is, and system on mode is used whenever it can from the main()'s while loop. 

     

    It is posibble to achieve constant 3uA current consumption in sleep (1min) and after wake up send the data in 60ms (after that again go to sleep)?

     Yes. That should be feasible (Not including when you are actually transferring all your data). 

    Best regards,

    Edvin

  • Hi Edvin,

    Thank You for Your reply. I don't know which solution is better for lowest possible current consumption. I think I can have one connection at the time. I've tried ble_app_uart & ble_app_uart_c but i haved some problems. I don't know how to disable advertising when Im not sending any data. Because of advertising I don't know in what kind of sleep mode it is. Can You tell me please (If You know) how to change ble_app_uart for something like that?

    1. Turn power on

    2. Connect BLE peripheral -> central

    3. Go to sleep (stop advertising)

    4. After for example push the button -> wake up

    5. Send data over BLE from data[8192] -> i thing there will be 34 packets per 244bytes

    6. Go to sleep (stop advertising) and wait for button

    Best regards,

    Rafał Dolny

  • How to stop advertising? Try sd_ble_gap_adv_stop().

    If you intend to only start advertising on a button press, I guess you could also use system off mode (instead of system on) but in this state, you can't have any timers running, so you are dependent on a GPIO interrupt.

    Look at how the ble_app_uart example does this using the sleep_mode_enter() function. Note that this is basically turning off the nRF. The application will start from scratch when it wakes up again.

    Best regards,

    Edvin

  • Yes but when Im using system off mode i see that wake up and waiting for connection takes a lot of time (several seconds). Can I do it with "system on sleep" in miliseconds?

    Best regards

    Rafał Dolny

  • Yes you can. Just stop and start advertising as you like. The default state is system on sleep.

Related