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