Mohammed,
My name is Bob Blake and I work for Alcoa in Pittsburgh, PA. We are
currently working with the MDA300 and are having problems getting valid
numbers from the counter. I'm putting in 5 volt pulses in a frequency
range from 1 to 20 Hz. Using the software examples that came with the
devices we get numbers that are typically less than expected for the
amount of time between data packets. I added a variable to make the
count cumulative. The code is shown below.
case COUNTER:
atomic {
total_counts = total_counts + data;
data = total_counts;
tmppack=(XDataMsg *)packet.data;
tmppack->xData.datap7.counter =data ;
msg_status|=0x02;}
break;
This was added to the xmesh example program. If I don't add the
total_counts variable then most of the time I get 0 for the counts and
occasionally get a number that does not represent the total counts
between the last non-zero events. Does the counter loose counts when it
is being read or zeroed? Do you have any additional code examples that
use the counter? I've also tried the xSensor example for the MDA300 and
I still get a count that still doesn't seem correct. Do you have any
suggestions? Any help would be appreciated.
Thanks,
Bob Blake
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help