No subject
Tue Jan 13 16:53:41 PST 2009
2ms not 100ms now.</p>
<p><br>Why is it incorrectly operate?<br>Our project must integrate sensor =
value with time. Thus exact conversion period is important.</p>
<p><br>implementation<br>{ <br> <br> &nb=
sp; <br> const msp430adc12_channel_config_t config =3D {<br>&nb=
sp; <br> INPUT_CHANNEL_A0, REFERENCE_AVcc_AVs=
s, REFVOLT_LEVEL_NONE,<br> SHT_SOURCE_SMCLK, SHT_CLOCK_DI=
V_1, SAMPLE_HOLD_64_CYCLES,<br>
SAMPCON_SOURCE_SMCLK, SAMPCON_CLOCK_DIV_1 <br> &nbs=
p; <br> };<br> <br> event void Boot.booted()<=
br> {<br> call Resource.request(); //from adc test<=
br> <br> }<br> //////=
/////////////////////////////////////////////<br>
adc12memctl_t memctl[16];<br> uint8_t numMemctl;<br> #de=
fine ADCNUMS 5 <br> #define NUM_SAMPLES 50<br> uint16_t buffer[=
NUM_SAMPLES];<br> <br> event void Resource.gr=
anted()<br> {<br> error_t result;<br> &n=
bsp; uint8_t i;<br>
<br> for(i=3D0; i<ADCNUMS-1; i++){<=
br> memctl[i].inch=3Di+1; //List of additional chan=
nels<br> memctl[i].sref=3DREFERENCE_AVcc_AVss;<br>&=
nbsp; }<br> <br> numM=
emctl =3D ADCNUMS - 1;//chs - 1<br> <br>  =
; //1000000 MCLK / 500 sample per sec for all chs =3D 2000. <br>
result =3D call MultiChannel.configure(&config, memc=
tl, numMemctl, buffer, NUM_SAMPLES, 2000);<br>  =
; <br> if (result =3D=
=3D SUCCESS){<br> call MultiChannel.getData()=
;<br> }<br> else{<br> =
<br> }<br>
<br> }</p>
<p><br>//This must be called every 100ms. 10hz.<br> =
//But now it is called 93.2ms every.!!! Why?<br> async e=
vent void MultiChannel.dataReady(uint16_t *buf, uint16_t numSamples)<br>&nb=
sp; {<br>call Leds.led1Toggle(); //check by oscilloscope LED1 pin.</p>
<div><br>call MultiChannel.getData(); //call next conversion sequence...<br=
> <br> }</div>
<div> </div>
<div>best regards,</div>
<div>K.S.Lee</div>
--0016364582b4eda55f0462dbcff0--
More information about the Tinyos-help
mailing list