You probably need to make the ADC calls sequentially
by calling one from the done of the other. I'm not sure
that the lowlevel code is smart enough to queue the requests
and there is only one actual ADC, which has a number of
input channels that can be selected.

MS

Anderson Jr Nascimento wrote:
> 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
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to