usb_cdc_ble_fordongle_use_this.zip
Hi I use nrf52840 dongle as central and nrf52840dk as peripheral
my development aim is to get a analog signal( more specific, eeg signal ) to nrf52840dk,
convert it to digital value by saadc of dk, send this data to nrf52840 dongle which act as central by ble( nus service )
then, show this adc value on teraterm by usb_cdc function.
i scratched codes from nrfsdk 17.1.0 example and other resources on website
and i built code without error and it perform its function as i wanted.
but problem occurs when i adjust nrf_drv_timer_ms_to_ticks(&m_timer, 20) fuction's parameter 20 to less then 10
so that i can receive data value faster.
i use usb_cdc for dongle and nus service to communicate for dongle and dk.
in dk, i use saadc_callback to get adc value and nrf_drv_timer_ms_to_ticks(&m_timer, 20) determine the period of sending data
in saadc_callback, i use code
bytes_to_send = sprintf(nus_string, "%.3f\r\n", adc1 );
err_code = ble_nus_data_send(&m_nus, nus_string, &bytes_to_send, m_conn_handle);
to send data to dongle
when i decrease the period less than 10ms,
dongle and dk are disconnected automatically.
period longer than 20ms is fine and send data well.
but since i need more high frequency to get data to analyse singal ( i need 2ms ) ,
i need some advice about this issue
i think it is related about ble throughput and maximum available data amount in specific time interval
since sending longer nus_string required longer time period for sending data ( i tested it changing nrf_drv_timer_ms_to_ticks(&m_timer, 20)'s value )
i use windows 11 and segger embedded studio
i am a begginer in this stuff so i couldn't fully understand the ble stuff.
so my problem could seem weird and hard to understand but any advice about this problem will be a great help for me.
i attached my project for dongle, dk each so it might be helpful to understand my problem.
best regards