Hello, I'm using an Iris mote with the latest tinyos-2.x sources from cvs.
I have a 5 ms timer, which when fired does the following:
{
Read TempC (from mda100bc sensorboard)
Read VoltageC (the internal voltage reference of the micro)
Send values over serial port
}
NOTE: please ignore the fact that the first set of readings will be
incorrect!
The TempC reading seems fine, but the VoltageC reading is incorrect.
When I don't read TempC, VoltageC readings are fine.
I thought maybe it was a matter of ADC resource not being shared properly,
but both TempC and VoltageC use the same low level resource manager for ADC
access.
Here are the readings I am getting:
Read only TempC:
TempC reading: 521 (about 26C)
Read only VoltageC:
VoltageC reading: 339 (about 3.3V, correct reading)
Read TempC then VoltageC:
TempC reading: 521 (about 26C)
VoltageC reading: 295 (about 3.8V)
Read VoltageC then TempC:
TempC reading: 521 (about 26C)
VoltageC reading: 300 (about 3.75V)
It seems to me like it's some sort of resource arbitration problem, as
VoltageC works fine if I don't read TempC. On the other hand, it doesn't
matter which I try to read first, TempC or VoltageC, TempC is always correct
and VoltageC is always incorrect.
I modified the BlinkToRadio tutorial source to read TempC and VoltageC and
send the values over the serial port. Please see the attached source code
for more details.
Am I just missing something, or is this some sort of bug? Any help will be
appreciated!
Thanks,
Anderrson
BlinkToRadioAppC.nc
Description: Cdf file
BlinkToRadioC.nc
Description: Cdf file
#ifndef BLINK_TO_RADIO_H
#define BLINK_TO_RADIO_H
enum {
AM_BLINKTORADIOMSG = 6,
TIMER_PERIOD_MILLI = 5 * 1024,
};
typedef nx_struct BlinkToRadioMsg {
nx_uint16_t temp;
nx_uint16_t voltage;
} BlinkToRadioMsg;
#endif /* BLINK_TO_RADIO_H */
_______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
