Don't use my Robo code for Bvoltage. I have a whole different hardware
scheme and it gets different values. However, you should be able to
get the raw ADC readings using ADCC the way I do. The mica2 and 'Z
hardware are different as well, which is why they read different
channels, so your mileage may vary.

If you are a nuts'n'bolts type, look at the micaz schematic, or what
there is of it, in the UserGuide that David Gay just referenced, and
read the ATMEGA section on using the internal ref. It's pretty turgid,
but there may be a clue about the apparent x2 readings you are getting.

sorry, I can't be much more help without actually doing work myself...
MS


R Gartz wrote:

Yes I know they are very suspicious ;)
But I don't have any bit shift anywhere in my program(s)... Those are the actual values I'm getting

Michael, in your robocode you're getting the right values for mica2? But you're not using the VoltageM component.
So, I decided to try the same thing you did: not using VoltageM.
Although I know the Xbow MPR manual describes something about the mapping from ADC7 to the ADC channel 30, and by using VoltageM in micaz.

"RobotM.BVoltage -> ADCC.ADC[ROBOADC_BVOLTAGE];" (I tried both ROBOADC_BVOLTAGE = 7 and ROBOADC_BVOLTAGE=30) but the dataReady-event never fires (although like I said before, I was expecting something like that when not using VoltageM)

So, there remain 2 options:
-the VoltageM component contains an error (e.g. wrong mapping / reading of the ADC channel) -Measuring Voltage in micaz is not possible? (although the xbow MPR manual claims it should be)

greetings and thanks,
R.


On 5/19/06, *Michael Schippling* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    I don't remember the solution to the problem in the previous email you
    reference, but I think they were reading the wrong ADC or getting
    wrong values somehow...perhaps Gina Upperman is still online here and
    can answer.

    But your values look suspiciously like they have been divided by two.
    Do you have an accidental bit shift someplace?

    MS

    R Gartz wrote:
     > Hello,
     >
     > I'm trying to measure the voltage of the batteries of my micaz
    nodes.
     >
     > When using the VoltageM component, I'm always getting values like
    Vbat=
     > 3901, 4638, 4892, 5261, 5398, 5351, 5445, 5398 .... -> So, 5,3
    Volt for
     > two AA batteries?? Seems very strange...
     > When printing the raw 10-bit ADC value (so without the conversion (in
     > the VoltageM component) Vbat = Vref * 1024/ADC_Count) the ADC_Count =
     > 315, 258, 243, 230, 227, 229, 225,...
     > So in order to get more realistic values like Vbat = 2900mV: the
     > ADC_Count should be around 430...
     > Everything is mapped right, I'm measuring the ADC-channel 30 for
    micaz...
     >
     > Anyone knows what is wrong? (the same problem has already been
    posted a
     > month ago,
     >
    
http://mail.millennium.berkeley.edu/pipermail/tinyos-help/2006-April/016227.html)
     >
     >
     > Greetings,
     >
     > Robin
     >
     >
     >
     >
    ------------------------------------------------------------------------
     >
     > _______________________________________________
     > Tinyos-help mailing list
     > [email protected]
    <mailto:[email protected]>
     >
    https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
    <https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help>


_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to