[Tinyos-help] [Re: MicroTimer for micaz]

S. Umesh Babu sub at mech.iitkgp.ernet.in
Thu Sep 1 19:20:45 PDT 2005


Thankyou Vlassis

When i go through the MicroTimerM.nc code i see the following lines.

#ifdef PLATFORM_MICA2
  enum { CYCLES_PER_MILLISECOND = 7373L };
#else
  enum { CYCLES_PER_MILLISECOND = 4000L };
#endif

I believe for micaz the CYCLES_PER_MILLISECOND must to greater than above
values.

Can somebody tell me what value should i use, what more modification i
must do in MicoTimerM.nc file to customize microtimer for micaz.

Thankyou
Umesh



> Hi Umesh,

> As for your question, I haven't used the micaz for acoustic sampling.
However I am going to give you some information that wil help you get
unstuck.
>
> The mica2 and micaz have the same processor (Atmel ATMega128) but
different radios (mica2 has the CC1000, micaz has the CC2240). Since you
care about processor specific features (timers, ADC sampling and
interrupts) there shouldn't be any differences between the mica2 and
micaz code for sampling. You should be careful however how you use the
timers. It is my impression that micaz uses more timers than mica2 for
TinyOS related operations but I may be wrong.
>
> For that you have to try things. So did you try using the
> MicroTimer with the micaz code to verify your hypothesis that the
MicroTimer is only for mica2 and mica2dot ?
>
> I think that if you would like to use other timers a good example would
be the microtimer code. This code has the way to set up the timer
interrupt and has an API for starting/stoppping and setting the
microtimer to fire at a desirable rate. The Atmel AVR ATMega128
datasheet on
> http://www.atmel.com/dyn/resources/prod_documents/doc2467.pdf
> is your friend here. If you have some experience with microcontrollers
then the datasheet is very valuable for manipulating the appropriate
registers to do what you want.
>
>
> One more thing. I think that either you or I am confused about what you
want to do.  The processor has two inputs from the microphone circuitry.
One is an ADC input and the other in an interrupt input.
> The ADC input can be configured to be connected either to the microphone
raw output or the digital output of the tone detector.
> Now If I understand it well, you would like to sample the tone detector
digital signal ? Or you would like to sample raw data and detect a 4KHz
tone by some signal processing ?
> Either way you have to use the getData() and dataReady() function calls
after you receive the interrupt from the tone detector.
> For that you have to dig the example applications in the tinyos-1.x/apps
directory regarding the microphone. Search for the strings "getData" and
"dataReady" in the nesc files.
>
> If you work on a LINUX/UNIX machine one of my favorite commands
> to search a text string in a bunch of directories recursively is the
following:
>
> $ find . -name "*.nc" | xargs -r grep dataReady
> This command will search for the string "dataReady" in all files named
"*.nc" from the current directory and all its subdirectories
recursively.
>
> If you have any more questions please let me know.
>
> vlassis
>
> On Thu, 11 Aug 2005, S. Umesh Babu wrote:
>
>>
>> Hello,
>>
>> I am using micaz and MTS310 sensor and trying to detect a 4kHz sound
coming from buzzer(another mote+sensor board).i am using
>> Mic.readToneDetector() command to detect the presence of the sound.
>>
>> I am facing difficulty in using timer.
>>
>> The default available microtimer component seems written for mica2 and
mica2dot.what modification should i do for using with micaz.
>>
>> May i know how to use timer0,timer1, timer2 . Are there any examples
exists for micaz.I am aware of using normal timerc component.Where the
other components are discussed? where can i get more description for
these
>> timers.
>>
>> thankyou for your time
>> Umesh
>>
>> *****************************************
>> This Mail is Certified to be Virus Free.
>> CIC Network Security Group, IIT Kharagpur
>> *****************************************
>>
>>
>


S.Umesh Babu
Research Scholar (Ph.D)
Robotics and Intelligent Systems Lab
IIT Kharagpur,WB,INDIA. 721302

Vist Me at
http://www.geocities.com/umeshphd/



S.Umesh Babu
Research Scholar (Ph.D)
Robotics and Intelligent Systems Lab
IIT Kharagpur,WB,INDIA. 721302

Vist Me at
http://www.geocities.com/umeshphd/


More information about the Tinyos-help mailing list