Hi! I have to read two ADC channels "simultaneously" too. I've used the "Msp430Adc12ClientAutoRVGC" component.You can use the "Msp430Adc12MultiChannel" interface. First, configure the component (command "configure"): input channels, voltage reference, clock source for S&H, clock source for sampling period... Now you can call command "getData". Samples are saved in a interlaced buffer (ch0-ch1-ch0-ch1-ch0-ch1...). Note the time between two consecutive samples is the "jiffies" parameter on command "configure" i.e. the samples are not simultaneous. Using this component ensure values are read with a constant time between them.
----- Mensaje original ----- De: Mario Torrecillas Rodríguez <[email protected]> Fecha: Jueves, Julio 22, 2010 1:15 pm Asunto: [Tinyos-help] Reading multiple channels at same time A: [email protected] > Hi all!! > > I would like to ask a very simple question: > > I'm trying to read two ADC channels (i want to get multiple > readings for > each one), and, for that task, i'm using two instances of the > component"AdcReadStreamClientC()" (which provides the ReadStream > interface).When I want to read the channels, i just do something > like that. > > call SensorVolt.postBuffer(accelSamples, ACCEL_NSAMPLES); > call SensorVolt.read(ACCEL_PERIOD); > call SensorInt.postBuffer(accelSamplesInt, ACCEL_NSAMPLES); > call SensorInt.read(ACCEL_PERIOD); > > Each component have been configured equally, just with a > different input > channel. > The purpose of this task is to calculate the power of the signal > (the first > one is the voltage and the second one is the current). I'm not > sure about > the correction of this implementation (actually, i'm getting > some strange > reads). > > Ok, the problem, is that i've just read about a different component, > specifically designed for multiple channels, named > Msp430Adc12ClientAutoRVGC(). > What's the difference between using the first solution and the > second one? > Should I use Msp430Adc12ClientAutoRVGC instead two > AdcReadStreamClientC()?Are the same? > > Thanks all in advance:) > ╔══════════════════════════════════════╗ ║ José A. Tarifa Galisteo ║ ║ Estudiante Ingeniería de Telecomunicación ║ Escuela Superior de Ingenieros - U. Sevilla ║ http://alumno.us.es/j/jostargal/ ╚══════════════════════════════════════╝
_______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
