Hi all,This problem is fixed. in CVS, it had been updated previously by Hauer. If you use multiple channels and multiple samples per a channel, you must update a file which is c:\cygwin\opt\tinyos-2.x\tos\chips\msp430\adc12\Msp430Adc12ImplP.nc. In below our code does not have any problem. Maybe it is to be reference for your development.
Now , It is operating well with ADinput 0 to 5 channel and 10 samples per channel. And it uploads 60 samples per 100ms. Thus each channel has 100hz sampling frequnecy. I have tested it with the Matlab serial function for communication and the figure function for graph, 6 variable resisters for each adc input pins. best regards, G.S.Lee ---------- Forwarded message ---------- From: kiseop Lee <[email protected]> Date: 2009/2/28 Subject: telosb. ADC problem. MultiChannel. To: [email protected] Hi all, I am working with ADC interface in telosb MSP430 platform with TinyOS 2.1 SingleChannel interface is operating well. Thus I think display application into PC is good. But MultiChannel interface has some problem. ADC result value is incorrect voltage. Could you check my code? const msp430adc12_channel_config_t config = { INPUT_CHANNEL_A0, REFERENCE_AVcc_AVss, REFVOLT_LEVEL_NONE, SHT_SOURCE_SMCLK, SHT_CLOCK_DIV_1, SAMPLE_HOLD_64_CYCLES, SAMPCON_SOURCE_SMCLK, SAMPCON_CLOCK_DIV_1 }; #define ADCNUMS 6 #define NUM_SAMPLES 60 adc12memctl_t memctl[16]; uint8_t numMemctl; unit16_t buffer[NUM_SAMPLES]; event void Resource.granted() { error_t result; uint8_t i; for(i=0;i<ADCNUMS-1;i++){ memctl[i].inch=i+1; memctl[i].sref=REFERENCE_AVcc_AVss; } numMemctl = ADCNUMS -1; //1000000 MCLK/600 Fs = 1666. 1Mhz and sampling frequency #if 0 result = call MultiChannel.configure(&config, memctl, numMemctl, buffer, NUM_SAMPLES, 1666); #else result = call SingleChannel.configureMultiple(&config,buffer,NUM_SAMPLES,1666); #endif } best regards, G.S.Lee
_______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
