Hi,
This components doesnt work well, but if you use msp430, update tinyos to cvs version and take a look at apps/tests/msp430/Adc12 there is an example of sampling 2 channels. I'm working on a new component that use 3 channeks but i have junk data in the beginning of the sampling so it needs fix.


André Miguel de Almeida Marrão Rodrigues wrote:
Hello

I'm trying to figure our how to use your code in a 3 axis accelorometer.
Could you please send me your CeaSensor component and the test application
that you used?

Best regards,

André

----- Original Message ----- From: "Nicolas Esteves" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Monday, June 18, 2007 4:37 PM
Subject: Re: [Tinyos-help] Multichannel Adc sampling and DMA


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
[email protected]
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