Hi,
I tried to sample 6 channels together but i always have 0xfff, im not sure of the initialisation of the adc if someone can help me it would be nice...

here is my component

module CeaSensorP
{
   uses
   {
       interface Msp430Adc12MultiChannel as Adc;
       interface Resource;
   }

   provides
   {
       interface CeaSensor;
   }


}

implementation
{
   uint16_t results[6];
async command void CeaSensor.init()
   {
       call Resource.request();
   }
event void Resource.granted()
   {
       atomic
       {
           adc12memctl_t memctl[6] = {
/*{ inch: INPUT_CHANNEL_A0, sref: REFERENCE_VREFplus_AVss, 0 }, */ { inch: INPUT_CHANNEL_A1, sref: REFERENCE_VREFplus_AVss, 0 }, { inch: INPUT_CHANNEL_A2, sref: REFERENCE_VREFplus_AVss, 0 }, { inch: INPUT_CHANNEL_A3, sref: REFERENCE_VREFplus_AVss, 0 }, { inch: INPUT_CHANNEL_A6, sref: REFERENCE_VREFplus_AVss, 0 }, { inch: INPUT_CHANNEL_A7, sref: REFERENCE_VREFplus_AVss, 1 } }; msp430adc12_channel_config_t config =
           {
               inch: INPUT_CHANNEL_A0,
               sref: REFERENCE_VREFplus_AVss,
               ref2_5v: REFVOLT_LEVEL_2_5,
               adc12ssel: SHT_SOURCE_ACLK,
               adc12div: SHT_CLOCK_DIV_1,
               sht: SAMPLE_HOLD_64_CYCLES,
               sampcon_ssel: SAMPCON_SOURCE_SMCLK,
sampcon_id: SAMPCON_CLOCK_DIV_1 };

jiffies = 250; signal CeaSensor.initDone( call Adc.configure(&config, memctl, 5, results, 6, jiffies)); } } async command error_t CeaSensor.sample()
   {
       return call Adc.getData();
   }

   async event void Adc.dataReady( uint16_t *buffer, uint16_t numSamples )
   {
       signal CeaSensor.sampleDone(buffer, numSamples);
   }

}

the buffer signaled by dataReady is always full of 0xfff....

thanks
_______________________________________________
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to