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

How can I send hid data with TIMER1_IRQHandler strict every 8ms?

I find it unstable to send hid data, even if I set timer 1 every 8ms to send hid data.

I can catch data bag from wireshark it seems that interval of two data even close to 1ms.

How can this happen?

but if I set timer every 15ms, it become more stable.

But I need send it every 8ms, can you help?

It is very stable in lenovo N700 mouse (nrf51822)

test soft is in attachments

Best regards

MouseMovementRecorder.zip

Parents
  • I have search the "S110_SoftDevice_Specification_v1.2" and find what you said "Radio Notification" on page 14

    And it said that in Table 14, when t(ndist) =5500, and t(interval) = 7.5 it will send just 1 packet between a interval

    so I set CONN_INTERVAL like this:

    
    #define MIN_CONN_INTERVAL                MSEC_TO_UNITS(7.5, UNIT_1_25_MS)            
    #define MAX_CONN_INTERVAL               MSEC_TO_UNITS(7.5, UNIT_1_25_MS)
    

    But I don't know where to set t(ndist)

    In "static void gap_params_init(void)" I cant find any params of t(ndist)

        gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL;
        gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL;
        gap_conn_params.slave_latency     = SLAVE_LATENCY;
        gap_conn_params.conn_sup_timeout  = CONN_SUP_TIMEOUT;
    

    And what's "SLAVE_LATENCY" mean? Where and how can I use it?

    I just want send 1 packet in one interval(7.5ms) ,

    Does "Radio Notification " will be ACTIVE every 7.5ms when I set CONN_INTERVAL like above?

    This is the most difficult problem we meet.

    Best regards.

Reply
  • I have search the "S110_SoftDevice_Specification_v1.2" and find what you said "Radio Notification" on page 14

    And it said that in Table 14, when t(ndist) =5500, and t(interval) = 7.5 it will send just 1 packet between a interval

    so I set CONN_INTERVAL like this:

    
    #define MIN_CONN_INTERVAL                MSEC_TO_UNITS(7.5, UNIT_1_25_MS)            
    #define MAX_CONN_INTERVAL               MSEC_TO_UNITS(7.5, UNIT_1_25_MS)
    

    But I don't know where to set t(ndist)

    In "static void gap_params_init(void)" I cant find any params of t(ndist)

        gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL;
        gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL;
        gap_conn_params.slave_latency     = SLAVE_LATENCY;
        gap_conn_params.conn_sup_timeout  = CONN_SUP_TIMEOUT;
    

    And what's "SLAVE_LATENCY" mean? Where and how can I use it?

    I just want send 1 packet in one interval(7.5ms) ,

    Does "Radio Notification " will be ACTIVE every 7.5ms when I set CONN_INTERVAL like above?

    This is the most difficult problem we meet.

    Best regards.

Children
No Data
Related