[Tinyos-help] Changing Sampling Rate For BSN

Joe Polastre joe at polastre.com
Wed Sep 14 08:03:31 PDT 2005


I'm confused what you're missing.  There's a line in OscilloscopeRF
that looks like this:

call Timer.start(TIMER_REPEAT, 125);

Now, if you look at the Timer interface, you'll find the following
documentation (also available from 'make <platform> docs,here')

  /**
   * Start the timer. 
   * @param type The type of timer to start. Valid values include
   *  'TIMER_REPEAT' for a timer that fires repeatedly, or 
   *  'TIMER_ONE_SHOT' for a timer that fires once.
   *  @param interval The timer interval in <b>binary milliseconds</b> (1/1024
   *  second). Note that the 
   *    timer cannot support an arbitrary range of intervals.
   *    (Unfortunately this interface does not specify the valid range
   *    of timer intervals, which are specific to a platform.)
   *  @return Returns SUCCESS if the timer could be started with the 
   *    given type and interval. Returns FAIL if the type is not
   *    one of TIMER_REPEAT or TIMER_ONE_SHOT, if the timer rate is
   *    too high, or if there are too many timers currently active.
   */
  command result_t start(char type, uint32_t interval);

Thus, if you want to sample at 200Hz == once every 5ms, then you could
change the line in OscilloscopeRF to:

call Timer.start(TIMER_REPEAT, 5);

If you have not yet gone through the TinyOS tutorial, I highly
recommend that you do so.  Much, if not all, of this information is
covered within the tutorial.

-Joe

On 9/14/05, van Best, Chris <chris.van.best at medtronic.com> wrote:
> Hey Joe,
> 
> Thanks for the help, but that far I was already.
> The problem is I can't find the right value :(.
> 
> I think it has to be somewhere in the /tos/platform/MSP340 directory
> Probably in TimerM.nc
> Or in /tos/interfaces directory( in timesync.h or timer.nc)
> 
> As far as I can get, I must change the TIMER_REPEAT value. But I can't
> find it anywhere.
> Maybe I'm just on the wrong track because this musn't be to difficult
> :S.
> 
> Does anyone know where I can find the right value?
> Thanks a lot,
> 
> Chris
> 
> -----Original Message-----
> From: joe.polastre at gmail.com [mailto:joe.polastre at gmail.com] On Behalf
> Of Joe Polastre
> Sent: Tuesday, September 13, 2005 6:23 PM
> To: van Best, Chris
> Cc: tinyos-help at millennium.berkeley.edu
> Subject: Re: [Tinyos-help] Changing Sampling Rate For BSN
> 
> OscilloscopeRF sets the sample rate using a Timer.  Simply change the
> value of the Timer, and then the Timer fires, it samples the ADC.
> 
> -Joe
> 
> On 9/12/05, van Best, Chris <chris.van.best at medtronic.com> wrote:
> >
> > Hi,
> >
> > I have the same problem. Different with me is I'm using a BSN node
> > running with the OscilloscopeRF program.
> > This application refers back to the MSP430 directory (as far as I
> > know). I changed the apllication slightly so it now samples the
> > ADC3-channel instead of the internal temperature sensor.
> >
> > Now I want to change the sample-rate to 200 Hz. But I have no idea
> > where I can find the sample rate in the source-code.
> > Does anyone know where I can find this?
> >
> > Thanks,
> >
> > Chris
> >
> >  ________________________________
> >  From: tinyos-help-bounces at Millennium.Berkeley.EDU
> > [mailto:tinyos-help-bounces at Millennium.Berkeley.EDU] On Behalf Of
> > mturon at xbow.com
> > Sent: Tuesday, September 13, 2005 7:37 AM
> > To: jazdz007 at umn.edu; tinyos-help at Millennium.Berkeley.EDU
> > Subject: RE: [Tinyos-help] Changing Sampling Rate For MDA300
> >
> >
> >
> >
> >
> > Hi Jeremiah,
> >
> >
> >
> > The XMesh apps all have a "appFeatures.h" file that has a constant
> > defined for the default update rate.
> >
> >
> >
> > #define XSENSOR_SAMPLE_RATE  20000
> >
> >
> >
> > This gets passed into the call to start the application timer:
> >
> >           call Timer.start(TIMER_REPEAT, XSENSOR_SAMPLE_RATE);
> >
> >
> >
> > You can change it directly - it is in milliseconds.  The above example
> 
> > is a 20 second interval.
> >
> >
> >
> > Note: MOTE-VIEW 1.2 (to be released soon) will allow you to change the
> 
> > update rate dynamically from the GUI.
> >
> >
> >
> >
> > Martin
> >
> > __________________________________________________
> > Martin Turon  |  Crossbow Technology, Inc.
> >
> >  ________________________________
> >
> >
> > From: tinyos-help-bounces at Millennium.Berkeley.EDU
> > [mailto:tinyos-help-bounces at Millennium.Berkeley.EDU] On Behalf Of
> > Jeremiah D. Jazdzewski
> > Sent: Monday, September 12, 2005 9:53 AM
> > To: tinyos-help at Millennium.Berkeley.EDU
> > Subject: [Tinyos-help] Changing Sampling Rate For MDA300
> >
> >
> >
> > Hi all,
> >
> > I am using a MDA300 with a MICA2 and I am running the Xmesh program on
> it.
> >
> > I am not a programmer, but I need to know how to edit the xmesh
> > program to change the sampling rate at which the MICA2 takes data from
> the MDA300.
> >
> > If a programmer could tell me what source codes need to be edited and
> > what numbers need to be changed in the code, I would very much
> appreciate it.
> >
> > Thanks
> >
> > -Jeremiah Jazdzewski
> > _______________________________________________
> > Tinyos-help mailing list
> > Tinyos-help at Millennium.Berkeley.EDU
> > https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-h
> > elp
> >
> >
> >
>



More information about the Tinyos-help mailing list