From: andreaskoepke Date: Sat, 10 Mar 2007 21:58:37 +0000 (+0000) Subject: use ACLK as clock source for ADC -- may use less energy X-Git-Tag: tinyos/2.0.1~144 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=9b335cc16cefd4a8ea239727ac508f8b97da2cd5 use ACLK as clock source for ADC -- may use less energy --- diff --git a/tos/platforms/eyesIFX/sensors/BatteryLevelSensorC.nc b/tos/platforms/eyesIFX/sensors/BatteryLevelSensorC.nc index 600c0e2a..68a940d3 100644 --- a/tos/platforms/eyesIFX/sensors/BatteryLevelSensorC.nc +++ b/tos/platforms/eyesIFX/sensors/BatteryLevelSensorC.nc @@ -48,10 +48,10 @@ implementation components new AdcReadClientC() as AdcReadClient; Read = AdcReadClient; - AdcReadClient.AdcConfigure -> Settings.AdcConfigure[INTERNAL_VOLTAGE_REF_2_5V]; + AdcReadClient.AdcConfigure -> Settings.AdcConfigure[INTERNAL_VOLTAGE_REF_2_5V_LOW_FREQ]; components new AdcReadNowClientC() as AdcReadNowClient; ReadNow = AdcReadNowClient; ReadNowResource = AdcReadNowClient; - AdcReadNowClient.AdcConfigure -> Settings.AdcConfigure[INTERNAL_VOLTAGE_REF_2_5V]; + AdcReadNowClient.AdcConfigure -> Settings.AdcConfigure[INTERNAL_VOLTAGE_REF_2_5V_LOW_FREQ]; } diff --git a/tos/platforms/eyesIFX/sensors/sensors.h b/tos/platforms/eyesIFX/sensors/sensors.h index a5e39eea..42aa4ad9 100644 --- a/tos/platforms/eyesIFX/sensors/sensors.h +++ b/tos/platforms/eyesIFX/sensors/sensors.h @@ -53,8 +53,10 @@ enum { RSSI_SENSOR_DEFAULT, INTERNAL_VOLTAGE_REF_2_5V, + INTERNAL_VOLTAGE_REF_2_5V_LOW_FREQ, + INTERNAL_TEMP_HIGH_FREQ, - + INTERNAL_TEMP_LOW_FREQ, // add more entries here // last entry @@ -76,8 +78,8 @@ const msp430adc12_channel_config_t sensorconfigurations[] = { /* PHOTO_SENSOR_DEFAULT */ { INPUT_CHANNEL_A2, REFERENCE_VREFplus_AVss, REFVOLT_LEVEL_1_5, - SHT_SOURCE_SMCLK, SHT_CLOCK_DIV_1, SAMPLE_HOLD_64_CYCLES, - SAMPCON_SOURCE_SMCLK, SAMPCON_CLOCK_DIV_1 + SHT_SOURCE_ACLK, SHT_CLOCK_DIV_1, SAMPLE_HOLD_4_CYCLES, + SAMPCON_SOURCE_ACLK, SAMPCON_CLOCK_DIV_1 }, /* PHOTO_SENSOR_VCC */ { @@ -100,8 +102,8 @@ const msp430adc12_channel_config_t sensorconfigurations[] = { /* TEMP_SENSOR_DEFAULT */ { INPUT_CHANNEL_A0, REFERENCE_VREFplus_AVss, REFVOLT_LEVEL_1_5, - SHT_SOURCE_SMCLK, SHT_CLOCK_DIV_1, SAMPLE_HOLD_16_CYCLES, - SAMPCON_SOURCE_SMCLK, SAMPCON_CLOCK_DIV_1 + SHT_SOURCE_ACLK, SHT_CLOCK_DIV_1, SAMPLE_HOLD_4_CYCLES, + SAMPCON_SOURCE_ACLK, SAMPCON_CLOCK_DIV_1 }, /* RSSI_SENSOR_VCC */ { @@ -127,12 +129,24 @@ const msp430adc12_channel_config_t sensorconfigurations[] = { SHT_SOURCE_SMCLK, SHT_CLOCK_DIV_1, SAMPLE_HOLD_32_CYCLES, SAMPCON_SOURCE_SMCLK, SAMPCON_CLOCK_DIV_1 }, + /* INTERNAL_VOLTAGE_REF_2_5V_LOW_FREQ */ + { + SUPPLY_VOLTAGE_HALF_CHANNEL, REFERENCE_VREFplus_AVss, REFVOLT_LEVEL_2_5, + SHT_SOURCE_ACLK, SHT_CLOCK_DIV_1, SAMPLE_HOLD_4_CYCLES, + SAMPCON_SOURCE_ACLK, SAMPCON_CLOCK_DIV_1 + }, /* INTERNAL_TEMP_HIGH_FREQ */ { TEMPERATURE_DIODE_CHANNEL, REFERENCE_VREFplus_AVss, REFVOLT_LEVEL_1_5, SHT_SOURCE_SMCLK, SHT_CLOCK_DIV_1, SAMPLE_HOLD_32_CYCLES, SAMPCON_SOURCE_SMCLK, SAMPCON_CLOCK_DIV_1 }, + /* INTERNAL_TEMP_LOW_FREQ */ + { + TEMPERATURE_DIODE_CHANNEL, REFERENCE_VREFplus_AVss, REFVOLT_LEVEL_1_5, + SHT_SOURCE_ACLK, SHT_CLOCK_DIV_1, SAMPLE_HOLD_4_CYCLES, + SAMPCON_SOURCE_ACLK, SAMPCON_CLOCK_DIV_1 + }, /* your stuff here */ /* SENSOR_SENTINEL */ {