Now it is working. Thanks.

The problem was that I called setSamplingRate() before initializing ADCControl in MicM.nc

After ADCControl initialization, the mote is getting different conversion rate according to the input argument.

I appreciate again.



homin



----- Original Message ----- From: "Michael Schippling" <[EMAIL PROTECTED]>
To: "homin" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Monday, January 23, 2006 10:56 PM
Subject: Re: [Tinyos-help] ADCControl interface


I do use setSamplingRate(), but since it is over 2 weeks since I
examined it, I have no reliable recollection of it's effect. My
sincere belief is that I examined the code and the doc and determined
that 8 would give me about 1/3ms conversion time, meaning the longest
S/H access and, hopefully, the most stable samples.

You say you are getting 16Khz conversions and this jibs with 1/2*1/3ms.
I assume that you are doing something like firing the next conversion
from within the dataReady() of the current one?

The easiest way to tell if setSamplingRate() has no effect is to do the
timing test I outlined with the LED and scope. If it's not working, then
it's an interesting TOS datapoint. But I'm, as usual, not interested in
executing that particular test myself, yet....

MS

homin wrote:
As of now, I have been using nesC programming based on TinyOS.

The interface 'ADCControl' offers command 'setSamplingRate(uint8_t rate).'

Based on my experience, the input argument 'rate' seems to be not working.

The argument rate looks fixed 4, which means around 16.6kHz sampling rate.

Comparing the generated signal with recorded signal, I verified this sampling rate.

Have you tried to use this interface command?


homin


----- Original Message ----- From: "Michael Schippling" <[EMAIL PROTECTED]>
To: "homin" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Monday, January 23, 2006 3:10 PM
Subject: Re: [Tinyos-help] ADCControl interface


setSamplingRate() sets the ADC clock divisor which determines the
length of a single conversion. See the ATMEGA doc for details.
With a value of 8, I calculated the conversion time to be around
.3 ms, actually I think I measured it once now that I think of it.
This is basically the number of clock cycles between starting a
conversion with getData() and getting the dataReady(). Is that
what you are measuring -- you can toggle an LED or something to
see the timing on a scope or analyzer...

MS

homin wrote:
Dear All
My main research is shortly to implement acoustic beamforming system on WSN
where the mote records acoustic signal and forwards to a base station.
For MICAz and MICA2, I have encountered the problem that the function /setSamplingRate is/ not working. I tried several times to change sampling rate but it seems to be fixed around 16kHz, which was verified by sampled data.
The required sampling rate is 4 or 8 kHz for voice sound.
Can anybody help me figure out how to adjust it?
 Thanks in advance,
homin


------------------------------------------------------------------------

_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to