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
  • There's a bit of chaos in your development process now, as I see it. You should revert a couple of steps back, and start implementing the radio notification again, and set it up properly.

    1. The connection interval is set by the master. The slave can reject a connection if the master cannot provide the requested limits and disconnect the link, which is most likely what you're seeing. Try upping your max_conn_interval.

    2. You should setup radio_notification with the desired distance before the event handler is fired (set up in your ble_radio_notification_init function. Since the handler will be called twice per interval (one before, and one after a interval has happened), you should only send mouse data every other time the radio_notification handler is called.

    3. Slave latency is a part of the bluetooth specification. This allows the slave to skip connection intervals if no new data is to be sent. You can read more about this feature in the Core-spec.

    Best regards Håkon

Reply
  • There's a bit of chaos in your development process now, as I see it. You should revert a couple of steps back, and start implementing the radio notification again, and set it up properly.

    1. The connection interval is set by the master. The slave can reject a connection if the master cannot provide the requested limits and disconnect the link, which is most likely what you're seeing. Try upping your max_conn_interval.

    2. You should setup radio_notification with the desired distance before the event handler is fired (set up in your ble_radio_notification_init function. Since the handler will be called twice per interval (one before, and one after a interval has happened), you should only send mouse data every other time the radio_notification handler is called.

    3. Slave latency is a part of the bluetooth specification. This allows the slave to skip connection intervals if no new data is to be sent. You can read more about this feature in the Core-spec.

    Best regards Håkon

Children
No Data
Related