BLE_APP_UART and SAADC

Hi,

I am trying to send the data from SAADC on BLE. I follow the example: https://github.com/NordicPlayground/nRF52-ADC-examples/tree/master/ble_app_uart__saadc_timer_driven__scan_mode (NRF52832 and SDK 17.0)

However, when I change the sample rate, I found I cannot go beyond 250 samples/second. Once I change the SAADC_SAMPLE_RATE to less than 5 ms, the program would stop and give an ERROR after sending 1 data out.

I tried the SAADC example in the peripheral, it worked fine with higher data rate. 

Which things limited the sample rate? How can I send the data at higher speed (like ~1000 samples/second)?

Thanks in advance!

  • I tried the solution from the thread you recommended. But it gave me another error. 

    <warning> nrf_sdh_ble: Insufficient RAM allocated for the SoftDevice.
    <warning> nrf_sdh_ble: Change the RAM start location from 0x20002AD8 to 0x20003E90.
    <warning> nrf_sdh_ble: Maximum RAM size for application is 0xC170.
    <error> nrf_sdh_ble: sd_ble_enable() returned NRF_ERROR_NO_MEM.
    <error> app: ERROR 4 [NRF_ERROR_NO_MEM] at \nRF5_SDK_17.1.0_ddde560\examples\nRF52-ADC-examples-master\ble_app_uart__saadc_timer_driven__scan_mode\main.c:464
    PC at: 0x0002A81B

    At line 464, it is 

    err_code = nrf_sdh_ble_enable(&ram_start);
    APP_ERROR_CHECK(err_code);

    Is it hard to send 16-Byte data every 1 ms? Should I try to send in slower frequecy, like send 160 bytes every 10 ms instead?

    I will try to find some other solutions in the forum too. 

  • You need to change the RAM address and size so that your application fits into the memory. See this blog post.

    dfbdfb said:
    Is it hard to send 16-Byte data every 1 ms? Should I try to send in slower frequecy, like send 160 bytes every 10 ms instead?

    I think this depends on your connection parameters. You could try to decrease the connection interval and NRF_SDH_BLE_GAP_EVENT_LENGTH, see if that mitigates your issue.

    regards

    Jared

Related