Sorry I actually haven't used the internal ADCs on the MSP so I'm of no help... MS
himanshu barve wrote: > Thats OK. that can be done .. but what is the problem with > MSP430ADC12Single interface .. the program which i have sent in previous > mail is not even working for 2 ticks .. > Am i using proper settings for ADC ? > I will check for your suggestion and let u know. > > 2009/6/25 Michael Schippling <[email protected] <mailto:[email protected]>> > > If I understand correctly your program worked with a Timer at 2 ticks, > but not at 1, right? If so check the return value of the Timer.start() > as there is a lower limit on the tick setting. It may be returning > an error and not starting. The limit used to be 3 in T1 for micas. > MS > > > himanshu barve wrote: > > Hello Friends .. In my application , i am using two ADC channels > .. I need to sample them one after other . I am giving some > lines from my program concerning my problem. In this program i > am trying to wire MSP430ADC12Single interface. > But its not working .. > > module{ > > uses{ > .. > .. > interface MSP430ADC12Single as sensor1; > interface MSP430ADC12Single as sensor2; > .. > .. > } > > command result_t StdControl.init() { > call sensor1.bind(ADC12_SETTINGS( > INPUT_CHANNEL_A0, > REFERENCE_VREFplus_AVss, > SAMPLE_HOLD_512_CYCLES, > SHT_SOURCE_ADC12OSC, > SHT_CLOCK_DIV_1, > SAMPCON_SOURCE_SMCLK, > SAMPCON_CLOCK_DIV_1, > REFVOLT_LEVEL_1_5 > )); > call sensor2.bind(ADC12_SETTINGS( ssame as above except channel)) > } > command result_t StdControl.start() { > call Timer.start( TIMER_REPEAT,1); > return SUCCESS; > } > event result_t Timer.fired() { > call sensor1.getData(); > call sensor4.getData(); > } > > async event result_t sensor1.dataReady(uint16_t data1) { > atomic m_adc1 = data1; > return SUCCESS; > } > async event result_t sensor2.dataReady(uint16_t data2) { > atomic m_adc2 = data2; > call .... some function(m_adc1,m_adc2) > return SUCCESS; > } > > } > -------------------------------------------------------------------- > > Previously the same program was running with ADC interface .. > In previous program timer was in repeat fire mode for 2 ticks. > But i want it to be 1 tick .. so that i will get 20 samples per > 20 milli sec . (which is one cycle for 50Hz system). Thus i > tried above setting .. But its not even working . > > While using ADC interface we do not bind ports as in above . we > use other macro "ASSOCIATE_ADC_CHANNEL" which passes 3 parameter > . Other parameters are preset in ADC interface. of which > difference lies only in two settings. > instead of SAMPLE_HOLD_512_CYCLES --- SAMPLE_HOLD_4_CYCLES > instead of SHT_SOURCE_ADC12OSC,---------SHT_SOURCE_SMCLK > > > After discovering this all .. I tried to run previous program > with changing ADC interface .. with SAMPLE_HOLD_512_CYCLES & > SHT_SOURCE_ADC12OSC but that is also not working .. > Help me out of it ..!! I have tried lot of combinations .. but > none is working .. What i want is fast sampling but two channels > at a time .. > Thanks in advance .. (sorry if i am confusing ..!) > > > > > > -- > With Best Regards > Himanshu Barve > IIT Kharagpur > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Tinyos-help mailing list > [email protected] > <mailto:[email protected]> > > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > > > > > -- > With Best Regards > Himanshu Barve > IIT Kharagpur _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
