Hi all!

Sorry for the repeat post. The earlier one did not have a subject.

I have been trying to sample adc channels in mda300ca connected with mica2
mote. i am specifically interested in sampling adc channels 0 &1 (or for
that matter any two adc channels). I presume adc channels 0 & 1 are pins
A0 and A1 on MDA300CA. The relevant extract of the code is as below:-

includes sensorboard;
configuration HighFreqADCToRfm {
}
implementation {
  components Main, HighFreqADCToRfmM, LedsC;
  components Sample, MicroTimerM;
  components BufferedLog, ByteEEPROM;
  components GenericComm, ADCC;

HighFreqADCToRfmM.ADCControl -> ADCC.ADCControl;
Sample.ADC0 -> ADCC.ADC[7];// TOS_ADC_VOLTAGE_PORT = 7



module HighFreqADCToRfmM {
  provides {
    interface StdControl;
  }
  uses {
    interface Leds;
        interface Sampling;
    interface SendMsg;
    interface AllocationReq;
    interface ReadData;
        interface ADCControl;
  }

module Sample {
  provides interface Sampling;
  uses {
    interface LogData;
    //async command result_t fastAppend(uint8_t *data, uint8_t n);

    // Interface to shutdown external components that will interfere with
    // high-speed sampling
    interface StdControl as ExternalShutdown;
        interface Leds;
    interface MicroTimer;
    interface ADC as ADC0;
        //interface ADC[uint8_t port];// added vk
    //interface ADC as CalADC;// added vk
    //interface StdControl as ADCControl;// added vk
  }
}

async event result_t MicroTimer.fired() {
    if (!--sampleCount)
      {
        call MicroTimer.stop();
        post done();
          }
    else if (sampling || !call ADC0.getData())
      {
        call MicroTimer.stop();
        post failed();
        }
    else
      sampling = TRUE;
    return SUCCESS;
  }

I want to know the following:

How do I sample channels 0 and 1 on the mda300ca board viz.A0 and A1 and
whether what i am doing is correct?

While using component ADCC and interface ADC how does one pass channel and
excitation information to the ADC?

ADCControl interface has provisions for setting sampling rate. However, if
i am invoking ADC.getData on the firing of MicroTimer.fired event then why
do i need to set the sampling rate? Or can I do without setting the
sampling rate.

When I use ADCC, does it automatically use default excitation voltage or
do I need to provide this from outside? If it is to be done externally,
then will connecting VCC pin to E3.3 pin on mda300ca suffice?

Is ADCC the right choice or do I need to use SamplerC ? If I use SamplerC
then what about the interface to be used to connect to it, since ADC does
not provide channel and sampling rate details.

I have been at it for days trying to get any clues but everything has
proved futile.

I would highly appreciate any help on the matter.

Thanks and regards,

-- 
Vipin Kashyap


-- 
Vipin Kashyap
Roll# 05307415
M Tech (Electronic Systems)
Hostel-9, Room# 294
Ph# +91-9969031997

_______________________________________________
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to