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

Sending values to Mobile App via UART profile every 200 msec

Hi,

We are working on a project based on nrf51822. We have an application that needs to send 2 byte values to the mobile app every 200 milliseconds accurately(ideally 5 values every second).

we are using application timers for this purpose with 

APP_TIMER_TICKS(200, APP_TIMER_PRESCALER)  and the APP_TIMER_PRESCALER is 0(default)

But the app receives data at irregular intervals. it recieves all 5 values with in a time span of 400 msec and stops for that particular second and again it starts sending 5 values within 400 msec of the following second and the scenario repeats.

Ideally app has to recieve the values at 200th, 400th, 600th, 800th and 1000th milli second of every second but it is not happening.

Can you please help us why this behaviour is happening?

Best,

Krish

Parents Reply Children
  • Thanks for the quick reply Kenneth.

    Just few questions,

    1. How does the connection parameters impact the accuracy of application timers?

    2. By changing so, what will be the impact in terms of power consumption. Is there any drawback using the 200 msec connection parameters?

    3. Can i change the connection parameters dynamically when the application is running?

    Waiting for your reply. Thanks in advance.

    Best,

    Krish

  • 1. It doesn't. However the data will be buffered by the softdevice and sent on the next available connection interval. I was assuming here that the connection parameters were lower than >200ms, maybe the actual interval was as high as 1second, which could explain your behaviour. If that is not the case, then you need to look at the accuracy of the LFCLK you have and the configured tolerance.

    2. You may get an estimate of power consumption here: https://devzone.nordicsemi.com/nordic/power

    3. Yes, the peripheral device may request thew connection parameters while in a connection.

Related