I have solved the problem. For anyone that has a familiar problem like i did.
the configuration for the adc war wrong. i had accidently set a false
Reference voltage. With the following configuration and interpretation the
code works. i am reading equivalent values from my voltage divider on my
CuteCom terminal under ubuntu.
/* ======================== ADC CONFIGURATION ========================*/
const msp430adc12_channel_config_t config =
{
inch: INPUT_CHANNEL_A0, //Chanel 0 for
input
sref: REFERENCE_AVcc_AVss, //Reference voltage is
set to AVCC
-> 2.32V
ref2_5v: REFVOLT_LEVEL_NONE, //Internal
reference voltage ist
set to 0, use external
adc12ssel: SHT_SOURCE_ACLK,
adc12div: SHT_CLOCK_DIV_1,
sht: SAMPLE_HOLD_4_CYCLES,
sampcon_ssel: SAMPCON_SOURCE_SMCLK,
sampcon_id: SAMPCON_CLOCK_DIV_1
};
/* ===================================================================*/
event void AdcChanelRead.readDone( error_t result, uint16_t val )
{
if (result == SUCCESS)
{
call Leds.led1Toggle();
}
value=(uint16_t)val;
value=2.38 * (value/4096.0)*1000.0;
}
regards,
Kmote
--
View this message in context:
http://tinyos-help.10906.n7.nabble.com/Problems-getting-true-Values-from-ADC-telosb-tp24512p24519.html
Sent from the TinyOS - Help mailing list archive at Nabble.com.
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help