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

Time_stamping_value?

Hi Nordic Devzone,

First i want to make sure that if the clock being used by softdevice is the LFCLK (32kHz) and its counter register is 24bits ? and which prescaler is being used? because I want to send the local time (clock value ) from one device to another using Bluetooth mesh connectivity, but when i'm reading the time of the receive message from the ( const access_message_rx_t * p_message) the value of timestamp is greater than 24 bits value actually its a 32bit value , so if the counter register in the LFCLK is 24 bits how would it be possible to count up to 32 bits value ? does it mean that the clock begin used for time stamping the receive messages is different than the clock used by softdevice ? And what is the best way to keep track of time while using the softdevice ?

Thank you in advance

Parents
  • Hi MMG,

    The timestamp you see in access_message_rx_t is the timestamp when the packet is received. It's a local timestamp counting from the start of current timeslot. Have a look at radio_handle_end_event() in scanner.c

    And note that we use TIMER0 to count time, and it's 32bit. Not the 24bit RTC.

    Currently we have no use of the timestamp in the receive package yet.

  • Hi MMG, Actually we do use RTC to count the time between timeslot. So the timestamp is calculated by TIMER0 when inside timeslot and by RTC0 when outside of timeslot (Softdevice activity).

    Note, again, MESH is not handled by softdevice. All Mesh packet is handled by mesh stack, directly from the radio. BLE Softdevice here is used so that the device can do BLE if needed, such as advertising, beaconing, GATT connection etc.

    To read more about timeslot, please have a look at Multiprotocol support in the Softdevice spec, and have a look at the timeslot tutorial in the Tutorials on this devzone.

    Regarding your application, from my understanding, our current implementation might not be ready to use for time synchronization out of the box because there is no mechanism to synchronize time between nodes. We need a timer keeper that send sync packets to other nodes to get the offset from each node. That sync packets need to be sent periodically to all nodes to correct the drift of the clock on each node.

    Then the local time and the offset should be added in each TX packet to tell other node about the exact time when the packet is send from the source.

Reply
  • Hi MMG, Actually we do use RTC to count the time between timeslot. So the timestamp is calculated by TIMER0 when inside timeslot and by RTC0 when outside of timeslot (Softdevice activity).

    Note, again, MESH is not handled by softdevice. All Mesh packet is handled by mesh stack, directly from the radio. BLE Softdevice here is used so that the device can do BLE if needed, such as advertising, beaconing, GATT connection etc.

    To read more about timeslot, please have a look at Multiprotocol support in the Softdevice spec, and have a look at the timeslot tutorial in the Tutorials on this devzone.

    Regarding your application, from my understanding, our current implementation might not be ready to use for time synchronization out of the box because there is no mechanism to synchronize time between nodes. We need a timer keeper that send sync packets to other nodes to get the offset from each node. That sync packets need to be sent periodically to all nodes to correct the drift of the clock on each node.

    Then the local time and the offset should be added in each TX packet to tell other node about the exact time when the packet is send from the source.

Children
No Data
Related