Hi phil,

I just want to sample four channels. But to do it like you say:

>acquire resource
>sample 1
>sample 2
>sample 3
>sample 4
>sample 5
>sample 6
>release resource

For each channel i need a seperate config (4 channels = 4 configs). So do i
need one instance of the ADC interface and one of the resource interface,
and reconfigure it during runtime to sample the different channels?


Request()
Configure(1)
Sample1
Configure(2)
Sample2
Etc..
Release()


Or do i need 4 ADC instances and 4 resource instances? Or maybe 4 ADC
instances and one resource instance?


This is a bit confusing for me.

Thank you,


O.Chougna



granted

-----Original Message-----
From: Philip Levis [mailto:[EMAIL PROTECTED] 
Sent: vrijdag 15 juni 2007 20:27
To: Oussama Chougna
Cc: 'Nicolas Esteves'; [email protected]
Subject: Re: [Tinyos-help] Multichannel Adc sampling and DMA

On Jun 15, 2007, at 1:46 AM, Oussama Chougna wrote:

> Hi Phil,
>
>
> Are you sure about this:
>
>>              Timer.fired() {
>>              call Channe1One.read();
>>              call ChannelTwo.read();
>>              call ChannelThree.read();
>>              call ChannelFour.read();
>>              call ChannelFive.read();
>>              call ChannelSix.read();
>>              }
>
> Is the first approach only possible with the HIL ADC component
> ADCReadClientC? Because with the (msp430) HAL interfaces the client  
> should
> do resource arbitration. (request() , configure() , getData(),  
> dataReady() ,
> release() ). So you cannot call getData() of each channel one after  
> the
> other in the timer.fired() event?
>

Ah, then what you what to do is

acquire resource
sample 1
sample 2
sample 3
sample 4
sample 5
sample 6
release resource

Basically, for maximum efficiency you don't want the lock (resource)  
to go idle. That's why enqueueing all the requests as I showed with  
the HIL is desirable. The lock won't be released until the sixth  
channel is read.



> Which would you recommend for 100 Hz sampling? (HIL or HAL)

You want to sample all 6 sensors at 100Hz? I'd say try using the HIL  
(it's simpler) and if it can't do the job use the HAL. The one thing  
to be careful of is that if you let the ADC go idle long enough, it  
might power down the voltage reference, which has a 17ms warmup time.

Phil

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

Reply via email to