[Tinyos-help] Junk data with Adc on telosb

Nicolas Esteves nicolas.esteves at inrialpes.fr
Mon Aug 6 00:04:40 PDT 2007


Hi Jan


thanks again for your help

I created a component that use multi channel ADC it is configured there


msp430adc12_channel_config_t config = 
{INPUT_CHANNEL_A0,REFERENCE_VREFplus_AVss, ref2_5v, adc12ssel, adc12div, 
sht, sampcon_ssel, sampcon_id};

async command void MultiAdcSensor.configure( adc12memctl_t * channels, 
uint8_t nbChannels, uint16_t nbSamplesByChannel )
    {
        atomic
        {
            if( nbChannels == 0 )
                signal MultiAdcSensor.errorThrown(SENSOR_INVALID_CHANNELS);
            else if ( ! started )
                signal MultiAdcSensor.errorThrown(SENSOR_NOT_STARTED);
               
            if( nbChannels != 0 && started )
            {   
                uint16_t nbSamples = (nbChannels+1)*nbSamplesByChannel;
               
                if( nbSamples > BUFFER_SIZE )
                    nbSamples = BUFFER_SIZE;
                   
                if (call MultiChannel.configure(&config, channels, 
nbChannels, buffer, nbSamples, 0) == SUCCESS)
                {
                    configured = TRUE;
                    signal MultiAdcSensor.sensorReady();
                }   
                else
                    signal 
MultiAdcSensor.errorThrown(SENSOR_CONFIGURATION_FAILED);
               
            }
        }
    }
   
I call it with:

adc12memctl_t memCtl[2] = 
{{INPUT_CHANNEL_A1,REFERENCE_VREFplus_AVss},{INPUT_CHANNEL_A2,REFERENCE_VREFplus_AVss}};
MultiAdcSensor.configure( memCtl, 2, 100 );

to sample channel 0, 1 and 2


for the wiring i use

    components new Msp430Adc12ClientAutoRVGC() as Wrapper;

    MultiAdcSensorP.Resource -> Wrapper;
    MultiAdcSensorP.MultiChannel -> Wrapper.Msp430Adc12MultiChannel;
    Wrapper.AdcConfigure -> MultiAdcSensorP;
   
like in your example

Is something wrong?

Jan Hauer wrote:
> also, make sure you wire to Msp430Adc12ClientAutoRVGC (not
> Msp430Adc12ClientC), because your configuration involves the internal
> reference voltage.
> Jan
>
> On 8/3/07, Jan Hauer <hauer at tkn.tu-berlin.de> wrote:
>   
>> I just checked and for me sampling three channels with your
>> configuration works fine (except I'm using input channel 10 and twice
>> 11). What did you choose for the "jiffies" parameter, can you post
>> your Msp430Adc12MultiChannel.configure call with all parameters ?
>>
>> Jan
>>
>> On 7/31/07, Nicolas Esteves <nicolas.esteves at inrialpes.fr> wrote:
>>     
>>> Thanks a lot :)
>>>
>>> Jan Hauer wrote:
>>>       
>>>> I'll take a look and see if I can reconstruct your problem,
>>>> Jan
>>>> [sorry for the late reply, I just returned from holidays]
>>>>
>>>>
>>>> On 7/26/07, Nicolas Esteves <nicolas.esteves at inrialpes.fr> wrote:
>>>>
>>>>         
>>>>> Hi,
>>>>> When i use the multi channel sampling component (like in the
>>>>> apps/tests/msp430/Adc12) I always have junk data at the beginning of the
>>>>> sampling.
>>>>>
>>>>> I'm sampling channels INPUT_CHANNEL_A0, INPUT_CHANNEL_A1 and
>>>>> INPUT_CHANNEL_A2 with REFERENCE_VREFplus_AVss for each channel and
>>>>> REFVOLT_LEVEL_2_5, SHT_SOURCE_ACLK, SHT_CLOCK_DIV_1,
>>>>> SAMPLE_HOLD_4_CYCLES, SAMPCON_SOURCE_SMCLK, SAMPCON_CLOCK_DIV_1 for the
>>>>> config.
>>>>>
>>>>> I sample each channels like 200 times and the first results are always
>>>>> like 0 or things greater than 4095, there is between 80 and 150 values
>>>>> of this kind. I cant understand where itś coming from.. I tried to delay
>>>>> the sampling after the mote wakeup but nothing changed. I tried to do
>>>>> multiple sequences of capture because i thought that the values may be
>>>>> caused by the wakeup, but nothing changed too. When i do the same with 3
>>>>> distinct SingleChannel everything works fine.
>>>>>
>>>>> So if someone can help me it would be nice
>>>>> thanks in advance
>>>>> _______________________________________________
>>>>> Tinyos-help mailing list
>>>>> Tinyos-help at Millennium.Berkeley.EDU
>>>>> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>>>>
>>>>>
>>>>>           
>>>>
>>>>         
>>>
>>>
>>>       
>
>
>   



More information about the Tinyos-help mailing list