This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Question about high speed ADC usage

Hi,

I need to send an audio signal through BLE connection of nRF51822 module, this signal need to quantized and sampled at rate of minimum 8000 sample/second by ADC, i configured the minimum connection interval to 9 ms but the sampling still very low and far from required, i try to decrease the interval below 9 ms but the connection failed. is there any way to increase the sampling rate?

Thanks for your help in this issue

Regards

Parents
  • #define 	BLE_GAP_CP_MIN_CONN_INTVL_MIN   0x0006
    

    That's in 1.25ms intervals so 7.5ms is the absolute minimum. That's per BTLE spec.

    I don't understand why you refer to increasing 'the sampling rate', doesn't seem like the ADC sampling rate is your problem, it's the BTLE transfer throughput. How are you sending the data, in what sized packets? There's a theoretical maximum of 6 packets per connection interval (I don't recall where that comes from) but it's stated in other questions that many implementations are limited to 4. if you're sending 20 bytes per packet, at 9ms connection interval that's around 8kB/second, if you're only sending one byte per packet, it's about 450 b/second.

    And what's on the other end of this link? Just because you request a minimum connection interval of 7.5ms, doesn't mean the master on the other side lets you have it.

Reply
  • #define 	BLE_GAP_CP_MIN_CONN_INTVL_MIN   0x0006
    

    That's in 1.25ms intervals so 7.5ms is the absolute minimum. That's per BTLE spec.

    I don't understand why you refer to increasing 'the sampling rate', doesn't seem like the ADC sampling rate is your problem, it's the BTLE transfer throughput. How are you sending the data, in what sized packets? There's a theoretical maximum of 6 packets per connection interval (I don't recall where that comes from) but it's stated in other questions that many implementations are limited to 4. if you're sending 20 bytes per packet, at 9ms connection interval that's around 8kB/second, if you're only sending one byte per packet, it's about 450 b/second.

    And what's on the other end of this link? Just because you request a minimum connection interval of 7.5ms, doesn't mean the master on the other side lets you have it.

Children
  • Dear RK,

    It is 10 bit ADC data sending via UART as a text which mean 4 byte by using UART over Bluetooth ble_nus_string_send, i need 8K sample/second, if the 9 ms is minimum connection time with 4 packets that is mean i just can get a 444 sample/second (1/9ms * 4), are this calculation right ?

    Thanks for your help

  • 10 bits is 2 bytes, not 4. Don't tell me you're converting to ASCII and sending strings are you? You have a max 20 byte payload per packet, if we assume the 4 packets per connection is correct and 9ms is the min connection interval then you have 444 packets a seconds, if you send one sample per packet then yes you get 444 sample/second.

    But you can do much better. If you send the 10 bit readings as 2-bytes, but you send 10 of them in each packet (2 x 10 = 20 bytes) you can get 4,440 samples per second. But you can do better. 20 bytes is 160 bits, if you pack all the information in 10 bits at a time you can send 16 samples per packet, now you're on 7,104 samples per second. If you can get the connection interval down to the minimum of 7.5ms, that's 8533 samples a second.

    That relies on an awful lot of variables being EXACTLY right however.

  • Dear RK,

    The UART just use ASCII format, i try to send the 10 bit as integer and get a rubbish characters at terminal program (i receive the data through nRF51 dongle with ble_uart s120 example connected to laptop), then try to send it as hex format and get a separate representative of result ( for example if the ADC result is 1023 i receive 3 254), so i forced to convert it to ASCII. Now, is S120 support transferring 4 packets per connection ? how can i reconfigure the ble_uart S120 example to do this ?

    Thanks alot my friend, i appreciate your supporting.

    Regards

  • Well of course you get garbage if you try to use something which expects ascii data to print binary data. But that doesn't mean you have to use ascii it means you have to write code on the receiving side to read the binary data and convert it there. I suspect all you really want to do is put it back to the binary format you started with, which makes turning it to ascii for transmission a complete waste of bandwidth and processing power on both sides.

    To be honest trying to stream data at that kind of rate is something BTLE isn't designed for, I don't even know of a BTLE audio streaming protoco, A2DP doesn't exist for BTLE, I think. Taking the app_uart code designed for occasional short string transfers isn't going to get you anywhere near the throughput you're trying to achieve.

Related