Hello everybody,
Does anyone know the best way to sample an ADC channel @ 100 samples per
second?
My problem is that I can only sample @ 50 Hz. I do this like:
command result_t StdControl.start()
{
call Timer0.startPeriodic(20); //Each 20 milliseconds it fires..
1000/20 = 50 Hz
return SUCCESS;
}
event void Timer0.fired()
{
rcheck(call Leds.yellowToggle());
ADCcheck(call ADC0.getData()); //getData channel 0
}
async event result_t ADC0.dataReady(uint16_t data)
{
ADCcheck(call ADC1.getData()); //getData channel 1
//...
//..
return SUCCESS;
}
ADC0 and ADC1 are MSP430ADCSingle interfaces. This keeps working fine when
using more channels. (I tested it also with 4 channels)
In each ADC ready event I call the getData() command of the next channel to
sample.
When I decrease the timer interval; when I set it to 10 milliseconds
(100Hz). The call to ADC.getData() fails...
This is very strange, when using 4 channels @ 50 Hz it works. BUT when using
only 2 channels and decreasing the timer interval to 10 milliseconds it
fails.
Is my software implementation bad?
Thank you,
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help