SAMR21: Creating a digital pulse train for syncing sensors

Discussions around product based on ARM Cortex M0+ core.
This forum will be discontinued soon.

Moderator: nferre

colyton
Posts: 1
Joined: Mon Feb 29, 2016 11:01 pm

SAMR21: Creating a digital pulse train for syncing sensors

Mon Feb 29, 2016 11:46 pm

I am looking at creating a group of wireless sensors that are in sync with one another, sampling between 24hz to 240hz. Im going to read, record and reproduce a pulse from a master central unit on every wireless sensor circuit. I have a SAMR21 that i plan to use for this process. The sync pulse from the central unit will come over a 3.5 mm jack or from a photodiode.

Is it possible to do this with the SAMR21 and have little to no drift of the pulse over 10hr+?


Can someone please lend me some guidance about the correct steps in getting something like this to work and ASF modules i should focus on learning. Web links around this topic would be highly appreciated.

I am new to the SAM MPU's, sometimes finding it a bit difficult, but so far loving it :D
sarlacii
Posts: 68
Joined: Mon Jan 26, 2015 2:33 pm

Re: SAMR21: Creating a digital pulse train for syncing senso

Mon Mar 07, 2016 8:49 am

colyton wrote:Is it possible to do this with the SAMR21 and have little to no drift of the pulse over 10hr+?
I guess it's best to say that what you want to do is possible with "any" uC and a suitable crystal OSC! :) But for precise clocks on the SAMD20, there is a high-res 32kHz internal osc (# define CONF_CLOCK_OSC32K_ENABLE true" in conf_clocks.h) that you can then link to one of the unused GCLK generators. You can divide this down to suit your needs, and feed it to one of the internal timers.

Attempting to transmit a precise sync pulse train can run into issues. So perhaps consider a sync data packet every few seconds/minutes/whatever that you then use to sync the local timers of all your devices. If you look at the "drift" you will find that it is infinitesimal over quite a long time (your 10 hours) using a high-res clock. You will however have a permanent difference compared to your master (systematic error for each slave) that comes from the delay associated with communicating the sync.

Lots of fun to be had with this sort of thing - it's part of the fundamental challenge for GPS. So that said - look at GPS and how they do it... that might hold your answer?

Go well.

Return to “SAM D20 Cortex-M0+ MCU”

Who is online

Users browsing this forum: No registered users and 1 guest