No subject
Tue Jan 13 16:53:41 PST 2009
93.2ms not 100ms now.
Why is it incorrectly operate?
Our project must integrate sensor value with time. Thus exact conversion
period is important.
implementation
{
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
};
event void Boot.booted()
{
call Resource.request(); //from adc test
}
///////////////////////////////////////////////////
adc12memctl_t memctl[16];
uint8_t numMemctl;
#define ADCNUMS 5
#define NUM_SAMPLES 50
uint16_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; //List of additional channels
memctl[i].sref=REFERENCE_AVcc_AVss;
}
numMemctl = ADCNUMS - 1;//chs - 1
//1000000 MCLK / 500 sample per sec for all chs = 2000.
result = call MultiChannel.configure(&config, memctl, numMemctl, buffer,
NUM_SAMPLES, 2000);
if (result == SUCCESS){
call MultiChannel.getData();
}
else{
}
}
//This must be called every 100ms. 10hz.
//But now it is called 93.2ms every.!!! Why?
async event void MultiChannel.dataReady(uint16_t *buf, uint16_t
numSamples)
{
call Leds.led1Toggle(); //check by oscilloscope LED1 pin.
call MultiChannel.getData(); //call next conversion sequence...
}
best regards,
K.S.Lee
--0016364582b4eda55f0462dbcff0
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
<p>Hi all,</p>
<p><br>I am working with Msp430Adc12MultiChannel interface.<br>But it has p=
roblem about conversion period.</p>
<p><br>It has 5 sensors which is assigned to from A0 to A4. Conversion peri=
od for each channel is <br>100hz and all channels have same configuration.<=
br>Thus a ADC into MSP430 will convert 500 per second.<br>To check ADC conv=
ersion complete timing I have used oscilloscope and LED1 pin.<br>
More information about the Tinyos-help
mailing list