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

NRF52833 BLE UART DATA ISSUE

Hello

I want to send saadc data over BLE as 100KSPS

#define SAADC_SAMPLES_IN_BUFFER 120
#define SAADC_SAMPLE_RATE 1200       /**< SAADC sample rate in us. */

If, I set this code. 

I calculated SPS like this.

SPS = 120 / (1200*10^-6) = 100 KSPS

Q1) Am I calculate SPS right?

Q2) Then, why can't I get data 100KSPS?

Actually. the received data SPS over BLE is about 4~5KSPS.

I don't know how the SPS determined.

 Q3) When I set SAMPLE_RATE = 1200us, SAMPLES_IN_BUFFER 120.

I can receive over UART DATA  until 39SAMPLES.

How can I receive 120 Samples in 1200us??

Parents
  • Hello,

    I want to send saadc data over BLE as 100KSPS

    Which SoftDevice will you be using?
    Please have a look at the Bluetooth Low Energy data throughput section in that particular SoftDevice's documentation.
    Depending on the size of these transfers it might be infeasible to achieve the throughput you are after here.
    What is your required throughput?

    I calculated SPS like this.

    SPS = 120 / (1200*10^-6) = 100 KSPS

    Q1) Am I calculate SPS right?

    No, this is not correct if you are trying to calculate samples per second. SPS is not affected by the size of your allocated buffer.
    Instead, you use the frequency of the sampling to determine samples per second. So, if you are only sampling a single channel, with a sampling rate of 1200 µs, that leaves you with a SPS of 1/sample_rate = 833 SPS
    If you are using scan-mode you will need to account for the additional samples generated by multiplying this number with the number of enabled channels.
    You can read more about scan-mode ( multi channel sampling ) in the SAADC documentation.

    When the buffer is filled, the DONE event is generated. Is this where you are queueing your data for sending over BLE? If so, you will need to compare your allocated sample buffer size with your SPS, to see how often the event will be generated, and thus how often data will be transferred.

    Actually. the received data SPS over BLE is about 4~5KSPS.

    What connection parameters are you using for your transfer?

    I can receive over UART DATA  until 39SAMPLES.

    I do not understand what you mean by 39SAMPLES, please elaborate.
    Please bear in mind that UART is a slow interface.

    How can I receive 120 Samples in 1200us??

    Are you trying to get 120 samples in 1200 µs? If so, the sampling rate should be 10 µs, not 1200, this will also give you 100 kSPS. 
    Please keep in mind that you will need to decrease the TAQ of the SAADC, so that it has time to complete the samples at a sampling rate of 10 µs.

    Best regards,
    Karl

Reply
  • Hello,

    I want to send saadc data over BLE as 100KSPS

    Which SoftDevice will you be using?
    Please have a look at the Bluetooth Low Energy data throughput section in that particular SoftDevice's documentation.
    Depending on the size of these transfers it might be infeasible to achieve the throughput you are after here.
    What is your required throughput?

    I calculated SPS like this.

    SPS = 120 / (1200*10^-6) = 100 KSPS

    Q1) Am I calculate SPS right?

    No, this is not correct if you are trying to calculate samples per second. SPS is not affected by the size of your allocated buffer.
    Instead, you use the frequency of the sampling to determine samples per second. So, if you are only sampling a single channel, with a sampling rate of 1200 µs, that leaves you with a SPS of 1/sample_rate = 833 SPS
    If you are using scan-mode you will need to account for the additional samples generated by multiplying this number with the number of enabled channels.
    You can read more about scan-mode ( multi channel sampling ) in the SAADC documentation.

    When the buffer is filled, the DONE event is generated. Is this where you are queueing your data for sending over BLE? If so, you will need to compare your allocated sample buffer size with your SPS, to see how often the event will be generated, and thus how often data will be transferred.

    Actually. the received data SPS over BLE is about 4~5KSPS.

    What connection parameters are you using for your transfer?

    I can receive over UART DATA  until 39SAMPLES.

    I do not understand what you mean by 39SAMPLES, please elaborate.
    Please bear in mind that UART is a slow interface.

    How can I receive 120 Samples in 1200us??

    Are you trying to get 120 samples in 1200 µs? If so, the sampling rate should be 10 µs, not 1200, this will also give you 100 kSPS. 
    Please keep in mind that you will need to decrease the TAQ of the SAADC, so that it has time to complete the samples at a sampling rate of 10 µs.

    Best regards,
    Karl

Children
No Data
Related