> result = call PhaseA.configure(&config, memctl , 1 , buffer , 64 , 10 );
Your example configuration means: when getData() is called, a total of 64 samples will be taken, 32 for one channel, 32 for the other channel; the sampling period is 10 jiffies, i.e. every 10 jiffies a sample is taken, alternating between the channels. After 10 * 64 jiffies you should get the dataReady() event with the 64 results. The results are stored in the buffer in the order they are generated/sampled, the first result is stored at buffer[0]. > 2) WHEN I AM LOOKING AT RECEIVED DATA . > ONLY FIRST TWO READINGS HAS SOME VALUE . WHICH IS CONSTANT. 1. Please check whether you can also reproduce this with the latest CVS version, I remember there was a fix added a while ago. 2. Run (verify) the test applications: tinyos-2.x/apps/tests/msp430/Adc*. 3. Check if any Msp430Adc12Overflow events are signalled / increase the sampling period. Jan On Thu, Aug 20, 2009 at 9:35 AM, himanshu barve<[email protected]> wrote: > Hello friends > I am using multichannel ADC interface > "uses interface Msp430Adc12MultiChannel as PhaseA;" > I am configuring it like below . > ----------------------------------------------------------------------------------- > msp430adc12_channel_config_t config = > { > INPUT_CHANNEL_A0, 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 > }; > . > . > memctl.inch=5; //List of additional channels > memctl.sref=REFERENCE_VREFplus_AVss; > config.inch=0; > result = call PhaseA.configure(&config, memctl , 1 , buffer , 64 , 10 ); > if (result == SUCCESS) > { > call Leds.set(1); > //call Leds.led0Toggle(); > call PhaseA.getData(); > } > ------------------------------------------------------------------------------------------------------------------------ > THen in data ready event .. . > -------------------------------------------------------------------------------------------------------------------- > async event void PhaseA.dataReady(uint16_t *bufA, uint16_t numSamples ) > { > > > uint16_t i; > > Local.Node_Id = TOS_NODE_ID; > Local.Counter = Counter; > atomic > { > for(i=0; i<45; i++) ///////////// I AM JUST SENDING 45 SAMPLES OUT OF 64 > . > { > Local.reading[i]=bufA[i]; > } > } > post Send_Data(); > > } > ------------------------------------------------------------------------------------------------------------------------------------------------ > Then send data sends data .. > Its received on base mote . > All other java program , base program working properly .. > MY PROBLEMS > 1) HOW IS THE DATA STRUCTURED IN "bufA " ? > IS IT LIKE [SAMPLE FROM CHANNEL 1 SAMPLE FROM CHANNEL 2 SAMPLE FROM > CHANNEL 1 ..................................AND SO ON] ? ?? ? > 2) WHEN I AM LOOKING AT RECEIVED DATA . > ONLY FIRST TWO READINGS HAS SOME VALUE . WHICH IS CONSTANT. > 3736 695 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 0 0 0 0 > 0 0 0 0 0 0 > > WHEN I CHANGE LOCAL AS BELOW , > > . > . > atomic > { > for(i=0; i<45; i++) ///////////// I AM JUST SENDING 45 SAMPLES OUT OF 64 > . > { > Local.reading[i]=5; > } > } > post Send_Data(); > .......................... > I AM GETTING ALL 45 READINGS EQUAL TO 5 . > WHAT MAY BE THE PROBLEM > PLEASE HELP ME OUT .. > THANKS IN ADVANCE .. > > -- > With Best Regards > Himanshu Barve > M.Tech Electrical Engineering (Power System) > IIT Kharagpur , West Bengal , India > Ph: - +91 9775201181 > > _______________________________________________ > Tinyos-help mailing list > [email protected] > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
