Hi Elham! It is not that easy. On the IRIS or MicaZ motes the 32 KHz external clock is divided by 32 so the best resolution you are going to get form that timer is 1 ms. You could run from the MCU clock which ticks at 8 MHz, but then you cannot use the usual Timer interface and the TimerC component. You would have to use Alarm interface which is asynchronous. It is not easy to do so, you really have to understand what you are doing, but it is possible to run an Alarm<TMicro> with any period you like. Probably the rest of the code paths are not going to be fast enough, so you cannot go much below 1-5 KHz sampling rate. I suggest you the read one of the TEPs on Timers in the documentation.
Best, Miklos On Mon, Sep 27, 2010 at 9:40 PM, Elham Dolatabadi <[email protected]> wrote: > I didn't get it completely, Do you think the problem is with the timer or > ADC? > If it is with the Timer, should I change the Timer from TMilli to > T32khz????????? > > On Sun, Sep 26, 2010 at 7:15 PM, Miklos Maroti <[email protected]> > wrote: >> >> Or use an Alarm (async) or you can run the ADC module in streaming mode. >> Miklos >> >> On Sun, Sep 26, 2010 at 7:06 PM, Michael Schippling <[email protected]> >> wrote: >> > Prior to TOS1.1.10 one could use a Timer() interval of 1, >> > but at that version a lower limit of 3 was instilled -- >> > I think to avoid some kind of timing problem with micaz's. >> > The limit was enforced by having start() return an error >> > rather than just upping the ante and returning as it seems >> > to be doing in your case. >> > >> > You could roll back to TOS1.1.7...hah hah, a little joke... >> > or look into other timer implementations in T2, or even >> > poke into the Timer code and remove the limit just to >> > see what happens. >> > >> > MS >> > >> > Elham Dolatabadi wrote: >> >> >> >> >> >> Hello, >> >> >> >> For my application, I use iris mote and mda100cb sensor board. I am >> >> also >> >> working with tinyos-2.1.0. As you know the default sampling interval in >> >> oscilloscope application is 256 ms. When I changed it to 5 ms, all >> >> results were acceptable. However, I need sampling rate of 1 kHz which >> >> is >> >> 1 ms interval. By changing the interval to 1 ms the results were as the >> >> same as 5 ms. It seems that it didn't work. Can any one help me solving >> >> this issue and getting 1 KHz sampling rate?????????? >> >> >> >> E.D >> >> >> >> >> >> >> >> ------------------------------------------------------------------------ >> >> >> >> _______________________________________________ >> >> Tinyos-help mailing list >> >> [email protected] >> >> >> >> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help >> > _______________________________________________ >> > Tinyos-help mailing list >> > [email protected] >> > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help >> > > > _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
