Thanks for the guidance. I'm sticking with T2 for now :)

For the benefit of future list-archive seekers :) i found sample ADC
Read configurations for the telosb hamamatsu S1087 light sensor in the
appendix for TEP 109
(http://www.tinyos.net/tinyos-2.1.0/doc/html/tep109.html)

I've changed the DemoSensor app to use this, and then dropped the new
files into Oscilloscope (with the nec'y change in its make file).

 Everything compiles without complaint, but using BaseStation and
Oscilloscope to capture some lux information yields no data. :(


 I'm able to gather a nice java graphs of VoltageC data and also
Temperature info (using the MSP430InternalTemperatureC), so it doesn't
seem to be an issue of incorrectly configured
baseStation/Oscilloscope/serialForwarder (though there is much i don't
understand therein).

It would be helpful to step through execution, to debug the process. Is
this difficult in tinyos? I'm grateful for any direction. I'll attach
code.

Thanks!
-el



On Tue, 2009-07-14 at 09:06 -0600, Michael Schippling wrote:
> Those lines should go in your app's config file.
> In general you can replace DemoSensor with anything
> that implements the ADC interface, e.g., the Hamamatsu
> PAR sensor. Some fiddling with the files and close
> reading of the nescc config docs should do the trick.
> 
> In T1 there are a series of Sense demo apps that do
> pretty much what you want, again using DemoSensor
> in order to obfuscate the actual operation. If you
> find an implementation of DS in one of the sensor
> board directories you will see that it basically
> changes the name of an ADC sensor channel and
> passes it through to the application level.
> 
> MS
> 
> 
> lars vala wrote:
> > Hi everyone,
> > 
> > I am new to tinyos, but have worked through the helpful tutorials at
> > http://docs.tinyos.net, and been reading both the tinyos manual and the
> > shorter nesc one. i'm understanding it slowly and steadily :) 
> > 
> > I want to implement a simple sensing program where one (telosb) mote
> > will take light-reading and transmit it to another, base (telosb)mote
> > connected serially to the PC. They would both blink for a successful
> > transmission.
> > 
> > So as i see it my process involves understanding three pieces of tinyos
> > programming:
> > 1. taking readings, accessing the sensor, etc.
> > 2. transmitting data
> > 3. reading data on pc through the serial connection.
> > 
> > I understand that the TEPs offer the specifications, like 109 for
> > sensors, but i don't have the grasp of nesc (yet!) to understand how to
> > apply it.
> > 
> > I've been googling, searching these archives for some guidance. one post
> > contained this snippet:
> >> DemosensorC is not wired to photo sensor. I wired the Hamamatsu PAR
> > sensor to my application and now it works fine.
> >> HamamatsuC as Sensor;
> >> Main.StdControl -> Sensor;
> >> AlgoM.ADC -> Sensor.PAR;
> > 
> > Context was insufficient for me to know how to apply this code, although
> > i understand that the photo-sensor on our telosb 2420s is the hamamatsu
> > s1087. Does this wiring go in the configuration module or the app
> > itself? Or if i am missing the plot completely, can anyone point me in
> > the right direction? 
> > 
> > Thank you!
> > 
> > Lars 
> > 
> > 
> > 
> > _______________________________________________
> > Tinyos-help mailing list
> > [email protected]
> > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
/*the code i trivially amended:*/

LightC.nc


generic configuration LightC() {
  provides interface Read<uint16_t>;
}
implementation {
  components new HamamatsuS1087ParC();
  Read = HamamatsuS1087ParC.Read;
}



LightSensorC.nc


generic configuration LightSensorC()
{
  provides interface Read<uint16_t>;
}
implementation
{
  components new LightC() as LightSensor;
  Read = LightSensor;
}

/*from TEP109 appendix:*/

HamamatsuS1087ParC.nc


// HIL for the HamamatsuS1087 analog photodiode sensor
generic configuration HamamatsuS1087ParC() {
  provides interface Read<uint16_t>;
  provides interface ReadStream<uint16_t>;
  provides interface DeviceMetadata;
}
implementation {
  // Create a new A/D client and connect it to the Hamamatsu S1087 A/D
  // parameters
  components new AdcReadClientC();
  Read = AdcReadClientC;

  components new AdcReadStreamClientC();
  ReadStream = AdcReadStreamClientC;

  components HamamatsuS1087ParP;
  DeviceMetadata = HamamatsuS1087ParP;
  AdcReadClientC.AdcConfigure -> HamamatsuS1087ParP;
  AdcReadStreamClientC.AdcConfigure -> HamamatsuS1087ParP;
}



HamamatsuS1087ParP.nc


#include "Msp430Adc12.h" 

// A/D parameters for the Hamamatsu - see the MSP430 A/D converter manual,
// Hamamatsu specification, Telos hardware schematic and TinyOS MSP430
// A/D converter component specifications for the explanation of these
// parameters
module HamamatsuS1087ParP {
  provides interface AdcConfigure<const msp430adc12_channel_config_t*>;
  provides interface DeviceMetadata;
}
implementation {
  msp430adc12_channel_config_t config = {
    inch: INPUT_CHANNEL_A4,
    sref: REFERENCE_VREFplus_AVss,
    ref2_5v: REFVOLT_LEVEL_1_5,
    adc12ssel: SHT_SOURCE_ACLK,
    adc12div: SHT_CLOCK_DIV_1,
    sht: SAMPLE_HOLD_4_CYCLES,
    sampcon_ssel: SAMPCON_SOURCE_SMCLK,
    sampcon_id: SAMPCON_CLOCK_DIV_1
  };

  async command const msp430adc12_channel_config_t* AdcConfigure.getConfiguration() {
    return &config;
  }

  command uint8_t DeviceMetadata.getSignificantBits() { return 12; }
}
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to