hi anders,

my first observation is that if you want to put together a single-purpose application, then boilerplate isn't a very good place to start; it's pretty complicated so as to demonstrate many different sensing combinations. you might want to look at simpleaccel instead, and change the analog source to ecg; it will make adding changes much more straight-forward, and simplify debugging quite a bit.

that said, if you want to use software for timestamps, then use localtime.

also bear in mind that there's a latency penalty introduced by atomic code blocks (iirc, about 22 ticks for just the setup and teardown of atomicity, plus code).

i hope that this helps,

steve



On 05/13/2011 10:04 AM, Anders Sørensen wrote:
Hi all,

I'm looking to get a rough estimate of the execution time of the 
'triggerConversion' in the BoilerPlate sample firmware. In my case, this 
function reads ECG data from the memory area it resides it, converts it to 
digital values, and makes the converted data available through DMA.

My idea is to get a timestamp from the instant the timer event fires, and then another 
timestamp when the "DMA is done" event is handled. My approach is described in 
detail below.

In the BoilerPlateC.nc file, the 'event void SampleTimer.fired()' function is 
called whenever the sampler timer fires - in my case it's every 20ms (50Hz).
I use a Counter<TMilli, uint16_t>  counter to get this. All good, and the 
values make sense and are proper, i.e. the timer actually fires at the given rate 
(50Hz).

Once the DMA is ready, it fires the asynchronous event 'async event void 
DMA0.transferDone(error_t status)' function in BoilerPlateC.nc.
As mentioned, I also capture a timestamp from the same counter here.

And this is when it gets weird. Every timestamp pair (timer fired and DMA 
ready) are equal. If I am measuring these timings correctly, this means either
  1) the clock's resolution is not high enough to capture the time elapsed from 
_before_ calling 'triggerConversion' to when the data is available through the 
DMA,
  2) the execution time of 'triggerConversion' is actually below 1ms, which 
leads to 1) again.

I have tons of thoughts about what could be wrong, but can someone point me in 
the right direction?

Thanks in advance.
_______________________________________________
Shimmer-users mailing list
[email protected]
https://lists.eecs.harvard.edu/mailman/listinfo/shimmer-users

_______________________________________________
Shimmer-users mailing list
[email protected]
https://lists.eecs.harvard.edu/mailman/listinfo/shimmer-users

Reply via email to