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

Configuration Max- Min interval, supervision timeout for android

Hello,

I'm trying to configure the max -min of interval params and supervision timeout to obtain timeout of android = 1s.

#define MIN_CONN_INTERVAL                               MSEC_TO_UNITS(7.5, UNIT_1_25_MS)
#define MAX_CONN_INTERVAL                               MSEC_TO_UNITS(87.5, UNIT_1_25_MS)
#define SLAVE_LATENCY                                   0
#define CONN_SUP_TIMEOUT                                MSEC_TO_UNITS(1000, UNIT_10_MS)
#define FIRST_CONN_PARAMS_UPDATE_DELAY                  APP_TIMER_TICKS(1000, APP_TIMER_PRESCALER)
#define NEXT_CONN_PARAMS_UPDATE_DELAY                   APP_TIMER_TICKS(30000, APP_TIMER_PRESCALER)
#define MAX_CONN_PARAMS_UPDATE_COUNT                    3

i configure all parameters to run function sd_ble_gap_conn_param_update() . 

But it't only fit to some android phone. Although supervision timeout obtain timeout of android = 1s but sometime it's disconnected with phone. I don't know why? please help me!!

Parents Reply Children
  • Hi, sorry for late answer, I am still struggling with this.

    More info about my casse:

    1. When I keep the phone (no matter IPhone or Android phone) as close as possible to the nrf51822, this problem never appears, but when I moved it further, just around 2-3 meters away, Iphone seems to have this problem, but Android still worked fine. 

    2. About interval connection, I set it to be 9 ms in Android and 24 ms in IPhone , since IPhone can not go down more than 24 ms. (I want it to be as small as possible). About supp_conn_timeout, I set it to be 1 s in android and 720 ms (as default) in IPhone .

    Could you please help me to find out what is the reasons for this error and how to fix this? 

    Thank a lot.  

  • Hi Tung,

    It seems to me that you are in a very radio noisy environment and other radio signals operating in the same spectrum. just two meters of connectivity is really bad with a line of sight. Are there a lot of devices around your transmitting packets?

  • Thank for your fast response. 

    Indeed, there are some devices around my table but all of them are nordic devices (same chip: nrf51822). The strange thing is: when I browsing around devzone, I got a recommend to change the xtal accuracy.

    I changed it from 

    NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM to 
    NRF_CLOCK_LF_XTAL_ACCURACY_500_PPM. 
    And somehow, it works. Seems like the problem 0x08 does not appear anymore. 
    When I read more about this, some one said  that this could drift the timer over time. So when I use this for couple hour, the timer will be wrong or something? 
    I still very confuse about this. Is there any consequense when I config xtal this way? And there are several level of NRF_CLOCK_LF_XTAL_ACCURACY, from 20 to 500, how do I know which one is suitable for my design? 
  • Nice catch.

    This value will be available from the XTAL crystal you have for your low frequency clock. You should be able to tell from its spec what kind of ppm it provides. The softdevice needs to know this information so that it takes the drift into account.

  • Hi, 

    As I read in this thread: https://devzone.nordicsemi.com/f/nordic-q-a/27004/what-low-frequency-clock-sources-can-i-use.

    I just want to be correct, when I set: 

    {.source        = NRF_CLOCK_LF_SRC_XTAL,            \
                                     .rc_ctiv       = 0,                                \
                                     .rc_temp_ctiv  = 0,                                \
                                     .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM}

    That means I am using external 32kHz clock, and the NRF_CLOCK_LF_XTAL_ACCURACY is indicate the accuracy of that 32kHz clock? 

Related