Hi
 
I am using MultiChannel sampling on the msp430 ADC as shown in 
tinyos-2.x/apps/tests/msp430/Adc12. When I run the program, it runs correctly 
for a non-deterministic length of time (sometimes minutes, sometimes a day) and 
then appears to be stuck. Debugging with LEDs and UART shows that the timer for 
sampling continues to fire, but the Resource.reserve call returns an EBUSY 
error type after this time and no more granted events are signalled.

Also, there's no other ADC client in my application. I only use the timer, UART 
and this ADC getData call. The MultiChannel interface is wired to the 
Msp430Adc12ClientAutoRVGC component. I've seen this happen for sampling rates 
of 1kHz down to 167 Hz, but haven't tested for lower sampling rates. 

The code I am using looks like this

event Timer.fired(){                      // this fires every 6ms
    result = call Resource.request();    // returns SUCCESS upto some 
non-deterministic time, during which Resource is granted and I can read ADC 
correctly, after which always returns EBUSY, no more Resource.granted events 
are signalled
}
 
task void releaseResource(){
    call Resource.release();
}

task void processData(){
    .. send samples to UART
}

event Resource.granted(){
    if (MultiChannel.configure(&config, &memCtl, 1, buffer, BUFFER_SIZE, 0) == 
SUCCESS) 
        if (call MultiChannel.getData() != SUCCESS)
            post releaseResource();
    else 
        post releaseResource();
}
 
event MultiChannel.dataReady(bufptr){
    call Resource.release();
    ...make local copy;
    post processData();
}
 
If anyone has observed this or notices something I'm doing wrong, please let me 
know.

Thank you
Sandip


      
____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to