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

Slave PWM sync with master clock

Is there a way to access the lower level clock which a connected slave uses to stay in sync with the master. We want to use this to keep our PWM in sync. We are looking for 8 connected slaves to be in sync and generated a PWM signal. What is the best way to implement this?

Thank you,

Parents
  • Hi

    There is no way to get hold of the base time of the BLE stack if that is what you are asking, but neither do I think this would be of much help. First of it will be different from link to link, and secondly the accuracy will change over time because of the inaccuracies of the system clock.
    As an example, even with a relatively accurate external 20ppm 32kHz clock you would get up to 20us drift per second, which would quickly add up to more than 100us variance from link to link.

    I think the best way to do this is to send a proprietary sync packet using the micro ESB library, as this library allows you much more control of the packet timing, and allows you to update the payload for each packet to reflect the current time.

    One of the devices in the network can send a sync packet and the other devices can adjust their timers based on that.

    For this to work with the SoftDevice you will have to request timeslots from the SoftDevice in which to run the ESB protocol, as described in the following blog: Running micro-ESB concurrently with BLE

    Best regards
    Torbjørn

  • Shouldn't the slaves be always staying in sync with master? Do you think it will go beyond the 100µs? Yes, we are looking to get access to the base time of the BLE stack for this. We will look into the micro-ESB and test it out? Is there any sample that shows the syncing between master and slave?

Reply Children
No Data
Related