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

ADC + ble connection

I am using nrf51_sdk_v6_0_0_43681 and s110_nrf51822_7.0.01 wiht nrf51822, and I modifiy code based on ble_app_uart.

Here I am trying to launch a continous ADC sample with a repeated mode timer, the timer interval is 1ms or 2ms or 4ms. Meanwhile I disconnect and conect my cellphone(Samsumg Notes 3) with nrf51822 board. Serval times later, I found that the nrf51822 system should be crashed,because my local uart can not be input and ble has no advertising.

What is the problem?

Thanks

Frank

Edit: Format + Added commas between tags

Parents
  • Hi Stefan, Great thanks for your answer.Here I found that continously ADC sampling is not the root cause of system crash. I have an function xxx_process in main loop runtine as below. It is a complicated algorithm, sometimes it will take about 2 second to finish it. When algorithm is running, and I connect/disconnect the board with my cellphone, it will cause system crash. Here I want to know if I can disable ble response before algorithm running and enable ble response after algorithm finish.

    main() { ..... //initialization for (;;) { xxx_process(); power_manage();

    }
    

    }

    Thanks Frank

  • You could disconnect before the algorithm executes, then advertise when it finishes in order to connect again. You can also set the slave latency to a relatively high number so that the nRF51 device is not required to respond to the phone for a number of connection events. What I am curious to know however, why is the device crashing when you press connect/disconnect. The code that you execute in the main function has lowest priority and should not interrupt any softdevice activity.

Reply
  • You could disconnect before the algorithm executes, then advertise when it finishes in order to connect again. You can also set the slave latency to a relatively high number so that the nRF51 device is not required to respond to the phone for a number of connection events. What I am curious to know however, why is the device crashing when you press connect/disconnect. The code that you execute in the main function has lowest priority and should not interrupt any softdevice activity.

Children
No Data
Related