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.

Reply
  • 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.

Children
  • Hi Hung,

    Thank you for your response . i have a question about the softdevice , for what reason dose the softdevice use the RTC0 , is it for its internal scheduling and time mesuring ? so if any application use softdevice then the global time will be from the softdevice (which is the LFCLK ) or the application will use the TIMER0 as a refrence for clock or time (which is the HFCLK) ? Thank you !

  • Correct, the softdevice use RTC0 for internal scheduling. There is no such thing as global time. The application is free to use RTC1, TIMER1, TIMER2 if needed. The list of blocked resources are at chapter 7 System on Chip resource requirements in Softdevice product specification

  • By global time i mean does the TIMER0 starts from the time that application start running and then from that time we keep track of time and when SD receives any packets then it let the application know when the last part of the packet is received then we can access that time through the access_message_rx_t ?

  • Hi MMG,

    We have to make it very clear about the softdevice here.

    The softdevice is not involved in Mesh activity. The Mesh stack is not the softdevice. The mesh stack runs on top of the timeslot mechanism provide by softdevice. When starting a timeslot period, TIMER0 is reset.

    What is your plan with timestamp/global time ? If you don't plan to do anything with for example time synchronization between nodes, you really don't need to worry about timestamp.

    The timestamp can be basically explain as the TIMER0 is started when the timeslot starts. Then when a packet arrive on RX, the current value of TIMER0 will be assigned to the timestamp inside access_message_rx_t.

  • Hi Hung , Actually I'm interested in time for my application where global time could provide some more accurate data, I assume it would be similar to synchronization-like behaviour. Hence, I was wondering about global time and if i can use the timer_now() to get time on TIMER0 in my application? Have I understood it correctly that the softdevice is responsible for transferring and receiving packets then when it receives the las part of the message it will signal the reception and the the TIMER0 value will be assigned to the timestamp?

    Also, timeslot mechanism is not that clear for me; For instance, how does the softdevice provide that and when does the timeslot begin and end? Would it be possible to determine when the TIMER0 will be reset or define a static timeslot length? Could you elaborate a little bit more on that?

    Thank you very much for your help!

Related