[Tinyos-help] ADC

2008-05-05 Thread subhash nemani
hi
In this code  i'm  calling  all of  the  sensors  connected  to  the  ADC
ports  simultaneously
what will be the time lag between the data acquisition from the ADC ports?
will i get all the samples simultaneously
please give me reply as soon as possible.


extADC1_3phrmsM.nC
Description: Cdf file
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

[Tinyos-help] ADC

2007-06-26 Thread [EMAIL PROTECTED]
Hi i use tmote and tinyos 1.1 ; i must use ADC to sample a voltage on Capacitor 
but i have a problem. In fact i use ADC3 and GND(of ADC) but this pin result 
short-circuit when tmote is on. This is a big problem for me because the 
capacitor discharge and i can't mesaure the really value. How can i resolve my 
problem??

Thanks


--
Leggi GRATIS le tue mail con il telefonino i-mode™ di Wind
http://i-mode.wind.it/


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


[Tinyos-help] ADC

2006-05-10 Thread antonio gonga
how can i read a single pin for example ADC0 ? i need it to continue may job

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


Re: [Tinyos-help] ADC

2008-05-05 Thread Eric Keller
What hardware are you using?  I suspect that it will not work as written, but
if it does, the data will be returned in the order you call the get
data.  I think you have to
trace through the calls that you have made and see what is actually done when
you make the calls.  It's a lot of work.
Eric



On Mon, May 5, 2008 at 2:07 PM, subhash nemani <[EMAIL PROTECTED]> wrote:
> hi
> In this code  i'm  calling  all of  the  sensors  connected  to  the  ADC
> ports  simultaneously
> what will be the time lag between the data acquisition from the ADC ports?
> will i get all the samples simultaneously
>  please give me reply as soon as possible.
>
>
> ___
>  Tinyos-help mailing list
>  Tinyos-help@millennium.berkeley.edu
>  https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC

2008-05-05 Thread Michael Schippling
There is some indication that the mica ADCs (at least) will queue
getData() requests on different channels and fire them sequentially.
However I'm not a trusting sort, so I chain them by starting a new
conversion from the dataReady() of the previous.

The actual conversion time depends on the setting of the pre-scale
clock (again in micas, but I think tmotes have a similar feature).
IIRC the slowest mica2 conversion is about 1/3 milli-sec and the
fastest is on the order of 256x faster. Theres a table in T1
mica2/ADCControl.nc that shows something or other like this.

MS

Eric Keller wrote:
> What hardware are you using?  I suspect that it will not work as written, but
> if it does, the data will be returned in the order you call the get
> data.  I think you have to
> trace through the calls that you have made and see what is actually done when
> you make the calls.  It's a lot of work.
> Eric
> 
> 
> 
> On Mon, May 5, 2008 at 2:07 PM, subhash nemani <[EMAIL PROTECTED]> wrote:
>> hi
>> In this code  i'm  calling  all of  the  sensors  connected  to  the  ADC
>> ports  simultaneously
>> what will be the time lag between the data acquisition from the ADC ports?
>> will i get all the samples simultaneously
>>  please give me reply as soon as possible.
>>
>>
>> ___
>>  Tinyos-help mailing list
>>  Tinyos-help@millennium.berkeley.edu
>>  https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>
> ___
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

-- 
Platform: WinXP/Cygwin
TinyOS version: 1.x, Boomerang
Programmer: MIB510
Device(s): Mica2, MicaZ, Tmote
Sensor board: homebrew

___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC

2008-05-06 Thread Eric Keller
It looks like you are using tinyos-1.x.  I never really tracked down
the adc calls for multiple channels on tinyos-1.x.  If you were using
tinyos-2.x, the best
thing to do is use the Msp430Adc12MultiChannel component.  It gives you
the readings for all the channels at the same time.  This is subject to the
sample/hold time since there is only one adc involved.
Eric



On Tue, May 6, 2008 at 3:43 AM, subhash nemani <[EMAIL PROTECTED]> wrote:
> i'm  using  Tmotesky kit
>
>
On Mon, May 5, 2008 at 2:42 PM, Eric Keller <[EMAIL PROTECTED]> wrote:
> What hardware are you using?  I suspect that it will not work as written, but
>  if it does, the data will be returned in the order you call the get
>  data.  I think you have to
>  trace through the calls that you have made and see what is actually done when
>  you make the calls.  It's a lot of work.
>  Eric
>
>
>
>
>
>  On Mon, May 5, 2008 at 2:07 PM, subhash nemani <[EMAIL PROTECTED]> wrote:
>  > hi
>  > In this code  i'm  calling  all of  the  sensors  connected  to  the  ADC
>  > ports  simultaneously
>  > what will be the time lag between the data acquisition from the ADC ports?
>  > will i get all the samples simultaneously
>  >  please give me reply as soon as possible.
>  >
>  >
>  > ___
>  >  Tinyos-help mailing list
>  >  Tinyos-help@millennium.berkeley.edu
>  >  https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>  >
>
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] ADC Problems

2009-08-03 Thread farooq_s

Hi,

Guys I am trying to attach a light-to-voltage sensor to my atmega128 based
custom node. In order to use this i need to activate the ADC and I have been
unable to do so up till now. When I checked the Sense application for
telosb, it uses the VoltageC which inturn uses the Sensor Specific code of
the MCU.

I wrote the following for my sensor: atmADCP
#include "Atm128Adc.h"

module atmADCP {
  provides interface Atm128AdcConfig;
}
implementation {

  const Atm128Adcsra_t config = {
adps: ATM128_ADC_PRESCALE;
adie: ATM128_ADC_INT_ENABLE_OFF;
adif: ATM128_ADC_INT_FLAG_OFF;
adfr: ATM128_ADC_FREE_RUNNING_OFF;
adsc: ATM128_ADC_START_CONVERSION_ON;
aden: ATM128_ADC_ENABLE_OFF;
};
  
  async command uint8_t Atm128AdcConfig.getChannel()
  {
return ATM128_ADC_SNGL_ADC1;
  }

  async command uint8_t Atm128AdcConfig.getRefVoltage()
  {
return ATM128_ADC_VREF_AVCC;
  }

  async command uint8_t Atm128AdcConfig.getPrescalar()
  {
return ATM128_ADC_PRESCALE;
  }
}

atmADCC:
generic configuration atmADCC() {
  provides interface Read;
}
implementation {
  components new AdcReadClientC();
  Read = AdcReadClientC;

  components atmADCP;
  AdcReadClientC.Atm128AdcConfig -> atmADCP;
}



I have connected the sensor at pin 60(ADC1) but when i install the code onto
the node, the LEDs start to flash without any order, kindly help me with
this.

Regards,
Farooq Sultan
-- 
View this message in context: 
http://www.nabble.com/ADC-Problems-tp24789889p24789889.html
Sent from the TinyOS - Help mailing list archive at Nabble.com.

___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] ADC Value

2010-07-28 Thread Francesco Ficarola
Good morning.

I wrote a simple application to read ADC Value.
Hardware: MIB520 + Iris XM2110 + MDA300CA.

In my application I put a "printf" with my "uint16_t adc_value" from
readDone event. The problem is the range of the values; with java
net.tinyos.tools.PrintfClient I read a value from 768 to 62295 (it can
vary because I connect a potenziometer between Vcc and GND), but it
should be 0-4096, as in the datasheet. Why?

Greetings,
-- 
Francesco Ficarola 
Presidente LUG-PV (http://lugpv.netsons.org)
Mailing List: lugpv_at_lists.linux_dot_it

[GPG KeyID: 0xDBA99D92]
http://lugpv.netsons.org/gpgkeys/francesco_ficarola.asc

Il nuovo modo di fare ricerca: www.tradoogle.it



signature.asc
Description: OpenPGP digital signature
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

[Tinyos-help] ADC fluctuations

2010-11-07 Thread krisa
I am having a problem with reading value from ADC ports of telosb mote
using TinyOS 2.1.1
I have a simple variable resistor sensors (bend sensors) attached to
ports 6.3 - 6.7 (ADC3-ADC7), and while their resistace is not changed
I would assume their readings to be somewhat constant (of course with
some noise), but they are fluctuating in almost a sine like pattern -
while sampling with 100ms rate some 3-4 readings have a value which
seems lke the correct value, then some 4-5 readings have value lower
by some 200-300 or even more.
On  the other hand I have an accelerometer attached to ADC0-ADC2 and
its readings while in peaceful condition only fluctuates a little
(maybe 10-20 units max) and not in such a recognizable pattern - which
seems as it should be.

I am using this configuration for reading the values
 const msp430adc12_channel_config_t config = {
 inch: INPUT_CHANNEL_A0, //Of course changing to the correct port
 sref: REFERENCE_VREFplus_AVss,
 ref2_5v: REFVOLT_LEVEL_2_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
 };
but I have experimented with many others - by some manipulations to
clock selection or sample hold time, I have managed to get constant
readings, but then the readings dont change even if the resistor value
is changed - basically not working.
I have tried both reading thorough the Read interface and
Msp430Adc12MultiChannel through Msp430Adc12ClientAutoRVGC with the
same results  - maybe there is another method?

Also - even if I disconnect the sensor from the port i still get
uneaven readings - sometimes maximum of 4095 and sometimes as low as
0.
I am quite sure that the problem is me not knowing how to read the
sensor data in TinyOS and not broken mote, because It was previously
tested with another programming language which gave more consistent
sensor readings.
The only possiblity what comes to my mind is that there is some kind
of inconsistency with clocks (some interferance pattern?) because the
readings are distorted in a regular pattern and if I change the
sampling rate the distortions also still are sine form only longer or
shorter. (1000 ms sampling yields some 9 high and 9 low readings, 25
ms sampling yields approx 2 high and 2 low readings).

I think the problem is the configuration, and seeing as I am quite new
to mote programming I am a little in dark here - which reference and
clock should I use (it seems they could be different from those used
for the accelerometer)

Also a followup question - the resistor when changed has approx 10kohm
variance which translates in approx 100-200 points of reading change -
is there a way to enhace this so the range would be closer to the
whole scale of 0-4095?

I have spent many days on this problem and would really appreciate any
help or insight in this matter.

Thank you in advance!

-- 
--
Krišjānis Nesenbergs

___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] ADC port

2012-02-29 Thread Mubashir Rehmani
Dear All,

I want to control the I/O of the 10-pin extension connector of (U2) of the
Telosb mote. In fact, i want to use ADC3 and control its power level in
order to connect the digital switch with it. Can anyone tell me how i can
control the voltage level of this ADC3 from the tinyos code?

Please refer the pin diagram of the datasheet (page 23)
http://moss.csc.ncsu.edu/~mueller/rt/rt11/readings/projects/g4/datasheet.pdf

Kind Regards

-- 
Mubashir Husain Rehmani
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] ADC

2007-06-26 Thread Andrew

Hi there,

You'll probably find the input impedance presented by the ADC3 input is 
not a short to ground, but a low enough to discharge of the capacitor 
fairly rapidly. In my limited experience, I have found the ADC input 
impedance to be fairly low, and it can affect the values captured by the 
ADC if the output impedance is not small enough on the device that you 
are connecting to the ADC input. One work around is to buffer the source 
you wish to sample. You can use an opamp to do this. The opamp presents 
a high input impedance (10^12 on some FET opamps) and would result in 
virtually no loading to your source. Opamps typically have a low output 
impedance meaning that when provided a suitable load (in your case an 
ADC input) the voltage presented should remain true to the input 
(provided this is a straight buffer). I gladly accept any corrections!!


Hope this helps,
Andrew



[EMAIL PROTECTED] wrote:

Hi i use tmote and tinyos 1.1 ; i must use ADC to sample a voltage on Capacitor 
but i have a problem. In fact i use ADC3 and GND(of ADC) but this pin result 
short-circuit when tmote is on. This is a big problem for me because the 
capacitor discharge and i can't mesaure the really value. How can i resolve my 
problem??

Thanks


--
Leggi GRATIS le tue mail con il telefonino i-mode™ di Wind
http://i-mode.wind.it/


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

  


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


Re: [Tinyos-help] ADC

2007-06-26 Thread Steve McKown
On Tuesday 26 June 2007 03:15:26 am [EMAIL PROTECTED] wrote:
> Hi i use tmote and tinyos 1.1 ; i must use ADC to sample a voltage on
> Capacitor but i have a problem. In fact i use ADC3 and GND(of ADC) but this
> pin result short-circuit when tmote is on. This is a big problem for me
> because the capacitor discharge and i can't mesaure the really value. How
> can i resolve my problem??

Not sure, but I can see a few ways this could be happening.

1. The IO pins of the msp430 are set at PUC (power up clear) to digital IO 
inputs.  In this state, the pins leak almost no current *unless* the voltage 
they see is not very close to Vcc or Vss (uC GND).  If the msp430 resets 
while or after the cap is charged, the cap may be applying a voltage to the 
pin that could cause it to leak 100+ uA, which could be at least partially 
draining the cap before software takes over and sets the ADC3 pin into its 
peripheral ADC mode.

2. The software is somewhere setting the ADC3 pin to a digital output with a 
level of 0.  This will cause the pin to sink current from the capacitor and 
drain it.  This situation could cause the msp430 to be damaged if the 
capacitor's charge into the pin could exceed the pin's maximum current 
handling capability.

3. The capacitor's energy storage is so small that even the tiny amounts 
leaked at ADC3 or drawn during sampling is adversely affecting the charge.

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


Re: [Tinyos-help] ADC

2007-06-26 Thread Joe Polastre

You need to use and configure the ADC in software using ADCC.  If you
do not use and configure the ADC, then the ports are output and low
(contrary to what Steve wrote).  When a port is not in use on the
MSP430, it must be set to output and low (gnd) to minimize current
leakage.  By configuring the pin using ADCC, it is automatically
reconfigured to be input and not drive the signal.

This is documented in detail at:
http://www.moteiv.com/community/Connecting_External_Sensors

-Joe

On 6/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Hi i use tmote and tinyos 1.1 ; i must use ADC to sample a voltage on Capacitor 
but i have a problem. In fact i use ADC3 and GND(of ADC) but this pin result 
short-circuit when tmote is on. This is a big problem for me because the 
capacitor discharge and i can't mesaure the really value. How can i resolve my 
problem??

Thanks


--
Leggi GRATIS le tue mail con il telefonino i-mode™ di Wind
http://i-mode.wind.it/


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



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


Re: [Tinyos-help] ADC

2007-06-27 Thread Steve McKown
On Tuesday 26 June 2007 10:31:49 am Joe Polastre wrote:
> You need to use and configure the ADC in software using ADCC.  If you
> do not use and configure the ADC, then the ports are output and low
> (contrary to what Steve wrote).

When the msp430 goes through PUC, the PxDIR registers are reset and so the 
pins are digital inputs (per msp430 user's guide, sec 9.3).  Granted, in tos2 
for example, the telosb's MotePlatformC's Init.init() sets unused pins to 
output 0.  I was just pointing out that there is an albeit small window right 
after PUC where they are in fact inputs.

Steve

> When a port is not in use on the 
> MSP430, it must be set to output and low (gnd) to minimize current
> leakage.  By configuring the pin using ADCC, it is automatically
> reconfigured to be input and not drive the signal.
>
> This is documented in detail at:
> http://www.moteiv.com/community/Connecting_External_Sensors
>
> -Joe
>
> On 6/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > Hi i use tmote and tinyos 1.1 ; i must use ADC to sample a voltage on
> > Capacitor but i have a problem. In fact i use ADC3 and GND(of ADC) but
> > this pin result short-circuit when tmote is on. This is a big problem for
> > me because the capacitor discharge and i can't mesaure the really value.
> > How can i resolve my problem??
> >
> > Thanks
> >
> >
> > --
> > Leggi GRATIS le tue mail con il telefonino i-mode™ di Wind
> > http://i-mode.wind.it/
> >
> >
> > ___
> > Tinyos-help mailing list
> > Tinyos-help@Millennium.Berkeley.EDU
> > https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
> ___
> Tinyos-help mailing list
> Tinyos-help@Millennium.Berkeley.EDU
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
> !DSPAM:46814432308192707813856!



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


[Tinyos-help] ADC help

2006-02-02 Thread TEAM X
Hi,I'm trying to connect some components to the ADC channels on a Mica2.  I am not using the Crossbow sensorboards, but all of the code examples I have seen are using this sensorboard. The only ports I have connected are the ADC channel (ADC3) and ground. No matter what voltage I put on the input channel, I get a very large value (>32000) as the input for the ADC.  Am I missing something?
Does anyone have an example of code for the ADC that does not use a Crossbow sensorboard? On a related issue,ADC=(Vin / 1024) * VrefWhere Vin can be between 0 and (2^6-1)*Vref and Vref is 1.23 V.

Does this really mean that the ADC can take in voltages of up to 80V.  I find that hard to believe.Thanks very much,Joe

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


[Tinyos-help] ADC interface

2006-03-07 Thread wassim znaidi
i'm new user in tinyos and i want to know how the command ADC.getData() does workplease can anyone help me to understand how this function get the data and what it returnthanks
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC

2006-05-10 Thread Cory Sharp

Assuming a Tmote platform:

http://www.moteiv.com/community/Connecting_External_Sensors

Cory

On 5/10/06, antonio gonga <[EMAIL PROTECTED]> wrote:



how can i read a single pin for example ADC0 ? i need it to continue may job

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





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


[Tinyos-help] ADC Value

2006-06-16 Thread Chang Li



In the ADC convertion of telos the V = 
Value/4096*Vref, what is the meaning of
4096? Does it apply for all the ADC convertion 
for MSP430 in TinyOS? 
 
Chang
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] ADC sampling rate

2007-10-06 Thread Muhammad Azhar



Hi all,
 
   I understand that the timer used for acoustic ranging done by VU is somewhat 
different from the original implementation.  I've used the timer provided by 
VU, but I seem to run into problems in obtaining the correct quantity of data 
when doing acoustic ranging using micaz motes on TinyOS 1.1.15.
   As a first step, I decided to see how many samples are actually returned by 
OutsideRangingSensorM (i.e. I used a counter each time bufferIndex was reset).  
Hence, in one set of 16 chirps, the counter should return me 16.  However, each 
time a set of 16 chirps has been sent, the counter returns me a value of 3.
   As a next step, I reduced the implementation to such that only one set of 16 
chirps was sampled each time - again it returns me 3 samples.
   Since this program uses ADC.getContinuousData(), I thought that the sampling 
rate for this ADC was too slow - hence in MicM, I explicitly called 
ADCControl.setSamplingRate(0) [as this should be the fastest] in 
StdControl.start(), but unfortunately, it returned 0 samples when I tried 
running the program.  I also tried it out with different sampling rate and this 
was what I got:
 
0,1 - 0 samples received
2 - 8 samples received
3 - 7 samples received
4 - 5 samples received
5 - 4 samples received
6 - 2 samples received
7 - 2 samples received
 
   Thus, I'm quite lost as I can't seem to get all the 16 chirps to be sampled. 
 Any suggestions?
 
Thanks and best regards,
Azhar___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] ADC Problems

2009-08-03 Thread Varun Jain
Hi Farooq,
I have successfully used a PIR Sensor with atmega128 board on Port F0
i.e. ADC Channel 0. Here is the code:


module SensorP
{
  provides {
interface ResourceConfigure;
interface Atm128AdcConfig;
  }
  uses {
interface GeneralIO as SensorPin;
  }
}
implementation
{
  async command uint8_t Atm128AdcConfig.getChannel() {
return ATM128_ADC_SNGL_ADC0; // FOR POTENTIOMETER
  }

  async command uint8_t Atm128AdcConfig.getRefVoltage() {
return ATM128_ADC_VREF_AVCC;
  }

  async command uint8_t Atm128AdcConfig.getPrescaler() {
return ATM128_ADC_PRESCALE; 
  }
  
  async command void ResourceConfigure.configure() {
call SensorPin.makeInput();
call SensorPin.get();
  }

  async command void ResourceConfigure.unconfigure() {
call SensorPin.clr();
  }
}


generic configuration SensorC() {
  provides interface Read;
}
implementation {
  components new AdcReadClientC(),SensorP;
  components HplAtm128GeneralIOC as AtmGeneralIO;
  
  Read = AdcReadClientC;
  AdcReadClientC.Atm128AdcConfig -> SensorP;
  AdcReadClientC.ResourceConfigure -> SensorP;
  
  PIRSensorP.SensorPin -> AtmGeneralIO.PortF0; //Port F0 - Pin 11 on
Pinhead 4 of chipconz
}

-

In your platform you need to declare a component which provides the
"Read" Interface LIKE this:

generic configuration DemoSensorC() {
  provides interface Read;
}
implementation {
  components new SensorC() as Sensor;
  
  Read = Sensor;
}
-

In your application you need to wire up the "Read" interface with your
platform component.


I hope this helps. Also see the Oscilloscope Application.


Cheers,
Varun Jain


-Original Message-
From: tinyos-help-boun...@millennium.berkeley.edu
[mailto:tinyos-help-boun...@millennium.berkeley.edu] On Behalf Of
farooq_s
Sent: Monday, 3 August 2009 10:28 PM
To: tinyos-help@millennium.berkeley.edu
Subject: [Tinyos-help] ADC Problems


Hi,

Guys I am trying to attach a light-to-voltage sensor to my atmega128
based
custom node. In order to use this i need to activate the ADC and I have
been
unable to do so up till now. When I checked the Sense application for
telosb, it uses the VoltageC which inturn uses the Sensor Specific code
of
the MCU.

I wrote the following for my sensor: atmADCP
#include "Atm128Adc.h"

module atmADCP {
  provides interface Atm128AdcConfig;
}
implementation {

  const Atm128Adcsra_t config = {
adps: ATM128_ADC_PRESCALE;
adie: ATM128_ADC_INT_ENABLE_OFF;
adif: ATM128_ADC_INT_FLAG_OFF;
adfr: ATM128_ADC_FREE_RUNNING_OFF;
adsc: ATM128_ADC_START_CONVERSION_ON;
aden: ATM128_ADC_ENABLE_OFF;
};
  
  async command uint8_t Atm128AdcConfig.getChannel()
  {
return ATM128_ADC_SNGL_ADC1;
  }

  async command uint8_t Atm128AdcConfig.getRefVoltage()
  {
return ATM128_ADC_VREF_AVCC;
  }

  async command uint8_t Atm128AdcConfig.getPrescalar()
  {
return ATM128_ADC_PRESCALE;
  }
}

atmADCC:
generic configuration atmADCC() {
  provides interface Read;
}
implementation {
  components new AdcReadClientC();
  Read = AdcReadClientC;

  components atmADCP;
  AdcReadClientC.Atm128AdcConfig -> atmADCP;
}



I have connected the sensor at pin 60(ADC1) but when i install the code
onto
the node, the LEDs start to flash without any order, kindly help me with
this.

Regards,
Farooq Sultan
-- 
View this message in context:
http://www.nabble.com/ADC-Problems-tp24789889p24789889.html
Sent from the TinyOS - Help mailing list archive at Nabble.com.

___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC Problems

2009-08-03 Thread Varun Jain
Hi,

Just one thing, you should post your query to tinyos-help as well because may 
be I cannot answer a particular question but some one else can.

 

All the setting of the registers is done in Hardware Presentation Layer, see 
HplAtm128AdcC.nc…… You need to do a Resource Configuration if you see the 
files at  /tos/chips/atm128/adc/ , you will understand.

 

The values are converted according to the following formula…..

ADC = VIN ⋅ 1024 / VREF

So, it is quite possible that the values you are getting are not constant (as I 
think it would depend on the intensity of light) and hence the behavior you 
see. I think if you add a Java application (See Oscilloscope and one of the 
tutorials explains how to send the value to BaseStation) and read the value on 
a console would be much better way to go about testing your sensor.

 

Lastly, my name is Varun and not Verun J 

 

Cheers,

Varun Jain

 

From: Farooq Sultan [mailto:farooq...@hotmail.com] 
Sent: Tuesday, 4 August 2009 3:40 PM
To: Varun Jain
Subject: RE: [Tinyos-help] ADC Problems

 

Hello Verun,

Thanks for your help with the ADC. But I notice that You are not setting the 
ADCSRA register for the ADC, Can the ADC function that way?

Also I modified my sensorC and sensorP like you did but without using the 
resourceconfigure interface, Here is my demosensorC:

generic configuration DemoSensorC()
{
  provides interface Read;
}
implementation
{
  components new sensorC() as DemoChannel;

  Read = DemoChannel;
}

This is the application (Sense) that i am using:-
configuration SenseAppC 
{ 
} 
implementation { 
  
  components SenseC, MainC, LedsC, new TimerMilliC(), new DemoSensorC() as 
Sensor;

  SenseC.Boot -> MainC;
  SenseC.Leds -> LedsC;
  SenseC.Timer -> TimerMilliC;
  SenseC.Read -> Sensor;
}

#include "Timer.h"

module SenseC
{
  uses {
interface Boot;
interface Leds;
interface Timer;
interface Read;
  }
}
implementation
{
  // sampling frequency in binary milliseconds
  #define SAMPLING_FREQUENCY 100
  
  event void Boot.booted() {
call Timer.startPeriodic(SAMPLING_FREQUENCY);
  }

  event void Timer.fired() 
  {
call Read.read();
  }

  event void Read.readDone(error_t result, uint16_t data) 
  {
if (result == SUCCESS){
  if (data & 0x0004)
call Leds.led2On();
  else
call Leds.led2Off();
  if (data & 0x0002)
call Leds.led1On();
  else
call Leds.led1Off();
  if (data & 0x0001)
call Leds.led0On();
  else
call Leds.led0Off();
}
  }
}

I attached the light-to-voltage sensor(TSL13S) with ADC1 and ran the 
application on the device. The sense application is expectd to display the 3 
lowest order bits of the digitized output on the 3 platform LEDs. In my case 
the Leds blink without any order and dont remain constant. Since the light 
hitting the sensor is not changing i would expect the digitized output to be 
the same, hence the LEDs should become constant for a given lighting situation.

If you have any ideas or any suggestions kindly assist me with this!

Regards,
Farooq 



> Subject: RE: [Tinyos-help] ADC Problems
> Date: Tue, 4 Aug 2009 10:58:47 +1000
> From: va...@spiderbox.com.au
> To: farooq...@hotmail.com; tinyos-help@millennium.berkeley.edu
> 
> Hi Farooq,
> I have successfully used a PIR Sensor with atmega128 board on Port F0
> i.e. ADC Channel 0. Here is the code:
> 
> 
> module SensorP
> {
> provides {
> interface ResourceConfigure;
> interface Atm128AdcConfig;
> }
> uses {
> interface GeneralIO as SensorPin;
> }
> }
> implementation
> {
> async command uint8_t Atm128AdcConfig.getChannel() {
> return ATM128_ADC_SNGL_ADC0; // FOR POTENTIOMETER
> }
> 
> async command uint8_t Atm128AdcConfig.getRefVoltage() {
> return ATM128_ADC_VREF_AVCC;
> }
> 
> async command uint8_t Atm128AdcConfig.getPrescaler() {
> return ATM128_ADC_PRESCALE; 
> }
> 
> async command void ResourceConfigure.configure() {
> call SensorPin.makeInput();
> call SensorPin.get();
> }
> 
> async command void ResourceConfigure.unconfigure() {
> call SensorPin.clr();
> }
> }
> 
> 
> generic configuration SensorC() {
> provides interface Read;
> }
> implementation {
> components new AdcReadClientC(),SensorP;
> components HplAtm128GeneralIOC as AtmGeneralIO;
> 
> Read = AdcReadClientC;
> AdcReadClientC.Atm128AdcConfig -> SensorP;
> AdcReadClientC.ResourceConfigure -> SensorP;
> 
> PIRSensorP.SensorPin -> AtmGeneralIO.PortF0; //Port F0 - Pin 11 on
> Pinhead 4 of chipconz
> }
> 
> -
> 
> In your platform you need to declare a component which provides the
> "Read" Interface LIKE this:
> 
> g

Re: [Tinyos-help] ADC Value

2010-07-28 Thread Miklos Maroti
Hi!

It should be between 0 and 1023, because the ADC is 10-bit on the
IRIS. Either there is a problem in the driver that return the uint16_t
value, or you have a problem in your application. You should toggle an
LED if the uint16_t value in readDone is larger than 1024.

Miklos

On Wed, Jul 28, 2010 at 3:18 PM, Francesco Ficarola
 wrote:
> Good morning.
>
> I wrote a simple application to read ADC Value.
> Hardware: MIB520 + Iris XM2110 + MDA300CA.
>
> In my application I put a "printf" with my "uint16_t adc_value" from
> readDone event. The problem is the range of the values; with java
> net.tinyos.tools.PrintfClient I read a value from 768 to 62295 (it can
> vary because I connect a potenziometer between Vcc and GND), but it
> should be 0-4096, as in the datasheet. Why?
>
> Greetings,
> --
> Francesco Ficarola 
> Presidente LUG-PV (http://lugpv.netsons.org)
> Mailing List: lugpv_at_lists.linux_dot_it
>
> [GPG KeyID: 0xDBA99D92]
> http://lugpv.netsons.org/gpgkeys/francesco_ficarola.asc
>
> Il nuovo modo di fare ricerca: www.tradoogle.it
>
>
> ___
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC Value

2010-07-28 Thread Francesco Ficarola
Miklos Maroti ha scritto:
> Hi!
> 
> It should be between 0 and 1023, because the ADC is 10-bit on the
> IRIS. Either there is a problem in the driver that return the uint16_t
> value, or you have a problem in your application. You should toggle an
> LED if the uint16_t value in readDone is larger than 1024.
> 
> Miklos

Thanks for your help Miklos.
Nevertheless I know that with MDA300CA ADC is 12-bit (in fact 4096 =
2^12). However I solved it: the problem is tinyos version. With TinyOS
2.1.1 I get the wrong values (768-65295), instead with TinyOS 2.1.0 I
get the right values (3-4095). It is a mystery...
-- 
Francesco Ficarola 
Presidente LUG-PV (http://lugpv.netsons.org)
Mailing List: lugpv_at_lists.linux_dot_it

[GPG KeyID: 0xDBA99D92]
http://lugpv.netsons.org/gpgkeys/francesco_ficarola.asc

Il nuovo modo di fare ricerca: www.tradoogle.it



signature.asc
Description: OpenPGP digital signature
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] ADC Value

2010-07-28 Thread Miklos Maroti
Cool. I did not know what sensor you are using. Miklos

On Wed, Jul 28, 2010 at 5:30 PM, Francesco Ficarola
 wrote:
> Miklos Maroti ha scritto:
>> Hi!
>>
>> It should be between 0 and 1023, because the ADC is 10-bit on the
>> IRIS. Either there is a problem in the driver that return the uint16_t
>> value, or you have a problem in your application. You should toggle an
>> LED if the uint16_t value in readDone is larger than 1024.
>>
>> Miklos
>
> Thanks for your help Miklos.
> Nevertheless I know that with MDA300CA ADC is 12-bit (in fact 4096 =
> 2^12). However I solved it: the problem is tinyos version. With TinyOS
> 2.1.1 I get the wrong values (768-65295), instead with TinyOS 2.1.0 I
> get the right values (3-4095). It is a mystery...
> --
> Francesco Ficarola 
> Presidente LUG-PV (http://lugpv.netsons.org)
> Mailing List: lugpv_at_lists.linux_dot_it
>
> [GPG KeyID: 0xDBA99D92]
> http://lugpv.netsons.org/gpgkeys/francesco_ficarola.asc
>
> Il nuovo modo di fare ricerca: www.tradoogle.it
>
>
> ___
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] ADC reading fluctuations

2010-11-07 Thread krisa
I am having a problem with reading value from ADC ports of telosb mote
using TinyOS 2.1.1
I have a simple variable resistor sensors (bend sensors) attached to
ports 6.3 - 6.7 (ADC3-ADC7), and while their resistace is not changed
I would assume their readings to be somewhat constant (of course with
some noise), but they are fluctuating in almost a sine like pattern -
while sampling with 100ms rate some 3-4 readings have a value which
seems lke the correct value, then some 4-5 readings have value lower
by some 200-300 or even more.
On  the other hand I have an accelerometer attached to ADC0-ADC2 and
its readings while in peaceful condition only fluctuates a little
(maybe 10-20 units max) and not in such a recognizable pattern - which
seems as it should be.

I am using this configuration for reading the values
  const msp430adc12_channel_config_t config = {
  inch: INPUT_CHANNEL_A0, //Of course changing to the correct port
  sref: REFERENCE_VREFplus_AVss,
  ref2_5v: REFVOLT_LEVEL_2_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
  };
but I have experimented with many others - by some manipulations to
clock selection or sample hold time, I have managed to get constant
readings, but then the readings dont change even if the resistor value
is changed - basically not working.
I have tried both reading thorough the Read interface and
Msp430Adc12MultiChannel through Msp430Adc12ClientAutoRVGC with the
same results  - maybe there is another method?

Also - even if I disconnect the sensor from the port i still get
uneaven readings - sometimes maximum of 4095 and sometimes as low as
0.
I am quite sure that the problem is me not knowing how to read the
sensor data in TinyOS and not broken mote, because It was previously
tested with another programming language which gave more consistent
sensor readings.
The only possiblity what comes to my mind is that there is some kind
of inconsistency with clocks (some interferance pattern?) because the
readings are distorted in a regular pattern and if I change the
sampling rate the distortions also still are sine form only longer or
shorter. (1000 ms sampling yields some 9 high and 9 low readings, 25
ms sampling yields approx 2 high and 2 low readings).

I think the problem is the configuration, and seeing as I am quite new
to mote programming I am a little in dark here - which reference and
clock should I use (it seems they could be different from those used
for the accelerometer)

Also a followup question - the resistor when changed has approx 10kohm
variance which translates in approx 100-200 points of reading change -
is there a way to enhace this so the range would be closer to the
whole scale of 0-4095?

I have spent many days on this problem and would really appreciate any
help or insight in this matter.

Thank you in advance!


-- 
--
Krišjānis Nesenbergs

___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC port

2012-02-29 Thread Eric Decker
On Tue, Feb 28, 2012 at 11:58 PM, Mubashir Rehmani wrote:

> Dear All,
>
> I want to control the I/O of the 10-pin extension connector of (U2) of the
> Telosb mote. In fact, i want to use ADC3 and control its power level in
> order to connect the digital switch with it. Can anyone tell me how i can
> control the voltage level of this ADC3 from the tinyos code?
>

you aren't understanding how this ADC stuff really works..

ADC3 is an input to the ADC subsystem so it is nonsensical to talk about
controlling the voltage level from the tinyos code.

I suggest that you read the TI msp430f1611 manual in conjunction with the
moteiv telosb schematic to understand what hardware is provided and how it
works.

>
> Please refer the pin diagram of the datasheet (page 23)
>
> http://moss.csc.ncsu.edu/~mueller/rt/rt11/readings/projects/g4/datasheet.pdf
>
> Kind Regards
>
> --
> Mubashir Husain Rehmani
>
>
>
> ___
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>



-- 
Eric B. Decker
Senior (over 50 :-) Researcher
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] ADC port

2012-02-29 Thread Mubashir Rehmani
Thanks Eric for your answer.

In fact, in the telosb motive data sheet,
http://moss.csc.ncsu.edu/~mueller/rt/rt11/readings/projects/g4/datasheet.pdf
It is written on page 24 that *"If expansion pin 10 (ADC3) is used for
digital I/O instead of analog inputs, R14 must be populated with a 0 ohm
resistor to enable the pin for digital I/O (GIO0) on the microcontroller.
R16 must be populated with a 0 ohm resistor to enable GIO1. R14 and R16 are
located on the top side of Telos between the USB controller and the radio."*

So, what i want to do is that i want to use the expansion pin 10 (ADC3) and
control the I/O signals through tinyos. More precisely, i want to attach an
electronic switch, which enables or disable an external device (antenna)
with the signal i provide it to this expansion pin 10 (ADC3). Do you have
any idea how to achieve this?

Kind Regards

On 29 February 2012 10:16, Eric Decker  wrote:

>
>
> On Tue, Feb 28, 2012 at 11:58 PM, Mubashir Rehmani 
> wrote:
>
>> Dear All,
>>
>> I want to control the I/O of the 10-pin extension connector of (U2) of
>> the Telosb mote. In fact, i want to use ADC3 and control its power level in
>> order to connect the digital switch with it. Can anyone tell me how i can
>> control the voltage level of this ADC3 from the tinyos code?
>>
>
> you aren't understanding how this ADC stuff really works..
>
> ADC3 is an input to the ADC subsystem so it is nonsensical to talk about
> controlling the voltage level from the tinyos code.
>
> I suggest that you read the TI msp430f1611 manual in conjunction with the
> moteiv telosb schematic to understand what hardware is provided and how it
> works.
>
>>
>> Please refer the pin diagram of the datasheet (page 23)
>>
>> http://moss.csc.ncsu.edu/~mueller/rt/rt11/readings/projects/g4/datasheet.pdf
>>
>> Kind Regards
>>
>> --
>> Mubashir Husain Rehmani
>>
>>
>>
>> ___
>> Tinyos-help mailing list
>> Tinyos-help@millennium.berkeley.edu
>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>
>
>
>
> --
> Eric B. Decker
> Senior (over 50 :-) Researcher
>
>
>


-- 
Mubashir Husain Rehmani
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] ADC port

2012-02-29 Thread André Rodrigues
Hi

If all you want is to output 0 or 1 on pin 10, I would say that you just have 
to use port 6.3. In that case you do not neet to use any resistors.

But Eric could confirm (or not) my opinion.

Next, study one of the available device drivers to learn how to select the port 
for IO and how to set/clr the bit.

Regards,

André

  - Original Message - 
  From: Mubashir Rehmani 
  To: Eric Decker 
  Cc: tinyos-help@millennium.berkeley.edu 
  Sent: Wednesday, February 29, 2012 9:23 AM
  Subject: Re: [Tinyos-help] ADC port


  Thanks Eric for your answer.

  In fact, in the telosb motive data sheet, 
  http://moss.csc.ncsu.edu/~mueller/rt/rt11/readings/projects/g4/datasheet.pdf
  It is written on page 24 that "If expansion pin 10 (ADC3) is used for digital 
I/O instead of analog inputs, R14 must be populated with a 0 ohm resistor to 
enable the pin for digital I/O (GIO0) on the microcontroller.
  R16 must be populated with a 0 ohm resistor to enable GIO1. R14 and R16 are 
located on the top side of Telos between the USB controller and the radio."

  So, what i want to do is that i want to use the expansion pin 10 (ADC3) and 
control the I/O signals through tinyos. More precisely, i want to attach an 
electronic switch, which enables or disable an external device (antenna) with 
the signal i provide it to this expansion pin 10 (ADC3). Do you have any idea 
how to achieve this?

  Kind Regards


  On 29 February 2012 10:16, Eric Decker  wrote:




On Tue, Feb 28, 2012 at 11:58 PM, Mubashir Rehmani  
wrote:

  Dear All,

  I want to control the I/O of the 10-pin extension connector of (U2) of 
the Telosb mote. In fact, i want to use ADC3 and control its power level in 
order to connect the digital switch with it. Can anyone tell me how i can 
control the voltage level of this ADC3 from the tinyos code?


you aren't understanding how this ADC stuff really works..

ADC3 is an input to the ADC subsystem so it is nonsensical to talk about 
controlling the voltage level from the tinyos code.

I suggest that you read the TI msp430f1611 manual in conjunction with the 
moteiv telosb schematic to understand what hardware is provided and how it 
works. 


  Please refer the pin diagram of the datasheet (page 23)
  
http://moss.csc.ncsu.edu/~mueller/rt/rt11/readings/projects/g4/datasheet.pdf

  Kind Regards

  -- 
  Mubashir Husain Rehmani




  ___
  Tinyos-help mailing list
  Tinyos-help@millennium.berkeley.edu
  https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help




-- 
Eric B. Decker
Senior (over 50 :-) Researcher






  -- 
  Mubashir Husain Rehmani





--


  ___
  Tinyos-help mailing list
  Tinyos-help@millennium.berkeley.edu
  https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] ADC port

2012-02-29 Thread Mubashir Rehmani
Hi Angré,

Yes, all i want is to have output 0 or 1 on pin 10. If i clearly
understood, port 6.3 is pin 10 (ADC3) of expansion connector U2?

Kind Regards

2012/2/29 André Rodrigues 

> **
> Hi
>
> If all you want is to output 0 or 1 on pin 10, I would say that you just
> have to use port 6.3. In that case you do not neet to use any resistors.
>
> But Eric could confirm (or not) my opinion.
>
> Next, study one of the available device drivers to learn how to select the
> port for IO and how to set/clr the bit.
>
> Regards,
>
> André
>
>
> - Original Message -
> *From:* Mubashir Rehmani 
> *To:* Eric Decker 
> *Cc:* tinyos-help@millennium.berkeley.edu
> *Sent:* Wednesday, February 29, 2012 9:23 AM
> *Subject:* Re: [Tinyos-help] ADC port
>
> Thanks Eric for your answer.
>
> In fact, in the telosb motive data sheet,
>
> http://moss.csc.ncsu.edu/~mueller/rt/rt11/readings/projects/g4/datasheet.pdf
> It is written on page 24 that *"If expansion pin 10 (ADC3) is used for
> digital I/O instead of analog inputs, R14 must be populated with a 0 ohm
> resistor to enable the pin for digital I/O (GIO0) on the microcontroller.
> R16 must be populated with a 0 ohm resistor to enable GIO1. R14 and R16
> are located on the top side of Telos between the USB controller and the
> radio."*
>
> So, what i want to do is that i want to use the expansion pin 10 (ADC3)
> and control the I/O signals through tinyos. More precisely, i want to
> attach an electronic switch, which enables or disable an external device
> (antenna) with the signal i provide it to this expansion pin 10 (ADC3). Do
> you have any idea how to achieve this?
>
> Kind Regards
>
> On 29 February 2012 10:16, Eric Decker  wrote:
>
>>
>>
>>  On Tue, Feb 28, 2012 at 11:58 PM, Mubashir Rehmani > > wrote:
>>
>>> Dear All,
>>>
>>> I want to control the I/O of the 10-pin extension connector of (U2) of
>>> the Telosb mote. In fact, i want to use ADC3 and control its power level in
>>> order to connect the digital switch with it. Can anyone tell me how i can
>>> control the voltage level of this ADC3 from the tinyos code?
>>>
>>
>> you aren't understanding how this ADC stuff really works..
>>
>> ADC3 is an input to the ADC subsystem so it is nonsensical to talk about
>> controlling the voltage level from the tinyos code.
>>
>> I suggest that you read the TI msp430f1611 manual in conjunction with the
>> moteiv telosb schematic to understand what hardware is provided and how it
>> works.
>>
>>>
>>> Please refer the pin diagram of the datasheet (page 23)
>>>
>>> http://moss.csc.ncsu.edu/~mueller/rt/rt11/readings/projects/g4/datasheet.pdf
>>>
>>> Kind Regards
>>>
>>> --
>>> Mubashir Husain Rehmani
>>>
>>>
>>>
>>> ___
>>> Tinyos-help mailing list
>>> Tinyos-help@millennium.berkeley.edu
>>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>>
>>
>>
>>
>> --
>> Eric B. Decker
>> Senior (over 50 :-) Researcher
>>
>>
>>
>
>
> --
> Mubashir Husain Rehmani
>
>
>  --
>
> ___
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
>


-- 
Mubashir Husain Rehmani
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] ADC port

2012-02-29 Thread André Rodrigues
yes
  - Original Message - 
  From: Mubashir Rehmani 
  To: André Rodrigues 
  Cc: Eric Decker ; tinyos-help@millennium.berkeley.edu 
  Sent: Wednesday, February 29, 2012 9:57 AM
  Subject: Re: [Tinyos-help] ADC port


  Hi Angré,

  Yes, all i want is to have output 0 or 1 on pin 10. If i clearly understood, 
port 6.3 is pin 10 (ADC3) of expansion connector U2?

  Kind Regards


  2012/2/29 André Rodrigues 

Hi

If all you want is to output 0 or 1 on pin 10, I would say that you just 
have to use port 6.3. In that case you do not neet to use any resistors.

But Eric could confirm (or not) my opinion.

Next, study one of the available device drivers to learn how to select the 
port for IO and how to set/clr the bit.

Regards,

André

  - Original Message - 
  From: Mubashir Rehmani 
  To: Eric Decker 
  Cc: tinyos-help@millennium.berkeley.edu 
  Sent: Wednesday, February 29, 2012 9:23 AM
  Subject: Re: [Tinyos-help] ADC port


  Thanks Eric for your answer.

  In fact, in the telosb motive data sheet, 
  
http://moss.csc.ncsu.edu/~mueller/rt/rt11/readings/projects/g4/datasheet.pdf
  It is written on page 24 that "If expansion pin 10 (ADC3) is used for 
digital I/O instead of analog inputs, R14 must be populated with a 0 ohm 
resistor to enable the pin for digital I/O (GIO0) on the microcontroller.
  R16 must be populated with a 0 ohm resistor to enable GIO1. R14 and R16 
are located on the top side of Telos between the USB controller and the radio."

  So, what i want to do is that i want to use the expansion pin 10 (ADC3) 
and control the I/O signals through tinyos. More precisely, i want to attach an 
electronic switch, which enables or disable an external device (antenna) with 
the signal i provide it to this expansion pin 10 (ADC3). Do you have any idea 
how to achieve this?

  Kind Regards


  On 29 February 2012 10:16, Eric Decker  wrote:




On Tue, Feb 28, 2012 at 11:58 PM, Mubashir Rehmani 
 wrote:

  Dear All,

  I want to control the I/O of the 10-pin extension connector of (U2) 
of the Telosb mote. In fact, i want to use ADC3 and control its power level in 
order to connect the digital switch with it. Can anyone tell me how i can 
control the voltage level of this ADC3 from the tinyos code?


you aren't understanding how this ADC stuff really works..

ADC3 is an input to the ADC subsystem so it is nonsensical to talk 
about controlling the voltage level from the tinyos code.

I suggest that you read the TI msp430f1611 manual in conjunction with 
the moteiv telosb schematic to understand what hardware is provided and how it 
works. 


  Please refer the pin diagram of the datasheet (page 23)
  
http://moss.csc.ncsu.edu/~mueller/rt/rt11/readings/projects/g4/datasheet.pdf

  Kind Regards

  -- 
  Mubashir Husain Rehmani




  ___
  Tinyos-help mailing list
  Tinyos-help@millennium.berkeley.edu
  
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help




-- 
Eric B. Decker
Senior (over 50 :-) Researcher






  -- 
  Mubashir Husain Rehmani





--


  ___
  Tinyos-help mailing list
  Tinyos-help@millennium.berkeley.edu
  https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help




  -- 
  Mubashir Husain Rehmani


___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] ADC port

2012-02-29 Thread Mubashir Rehmani
Thanks André. Really thanks.

Kind Regards

2012/2/29 André Rodrigues 

> **
> yes
>
> - Original Message -
> *From:* Mubashir Rehmani 
> *To:* André Rodrigues 
> *Cc:* Eric Decker  ;
> tinyos-help@millennium.berkeley.edu
> *Sent:* Wednesday, February 29, 2012 9:57 AM
> *Subject:* Re: [Tinyos-help] ADC port
>
> Hi Angré,
>
> Yes, all i want is to have output 0 or 1 on pin 10. If i clearly
> understood, port 6.3 is pin 10 (ADC3) of expansion connector U2?
>
> Kind Regards
>
> 2012/2/29 André Rodrigues 
>
>> **
>> Hi
>>
>> If all you want is to output 0 or 1 on pin 10, I would say that you just
>> have to use port 6.3. In that case you do not neet to use any resistors.
>>
>> But Eric could confirm (or not) my opinion.
>>
>> Next, study one of the available device drivers to learn how to select
>> the port for IO and how to set/clr the bit.
>>
>> Regards,
>>
>> André
>>
>>
>>  - Original Message -
>> *From:* Mubashir Rehmani 
>> *To:* Eric Decker 
>> *Cc:* tinyos-help@millennium.berkeley.edu
>> *Sent:* Wednesday, February 29, 2012 9:23 AM
>> *Subject:* Re: [Tinyos-help] ADC port
>>
>> Thanks Eric for your answer.
>>
>> In fact, in the telosb motive data sheet,
>>
>> http://moss.csc.ncsu.edu/~mueller/rt/rt11/readings/projects/g4/datasheet.pdf
>> It is written on page 24 that *"If expansion pin 10 (ADC3) is used for
>> digital I/O instead of analog inputs, R14 must be populated with a 0 ohm
>> resistor to enable the pin for digital I/O (GIO0) on the microcontroller.
>> R16 must be populated with a 0 ohm resistor to enable GIO1. R14 and R16
>> are located on the top side of Telos between the USB controller and the
>> radio."*
>>
>> So, what i want to do is that i want to use the expansion pin 10 (ADC3)
>> and control the I/O signals through tinyos. More precisely, i want to
>> attach an electronic switch, which enables or disable an external device
>> (antenna) with the signal i provide it to this expansion pin 10 (ADC3). Do
>> you have any idea how to achieve this?
>>
>> Kind Regards
>>
>> On 29 February 2012 10:16, Eric Decker  wrote:
>>
>>>
>>>
>>>  On Tue, Feb 28, 2012 at 11:58 PM, Mubashir Rehmani <
>>> mshrehm...@gmail.com> wrote:
>>>
>>>> Dear All,
>>>>
>>>> I want to control the I/O of the 10-pin extension connector of (U2) of
>>>> the Telosb mote. In fact, i want to use ADC3 and control its power level in
>>>> order to connect the digital switch with it. Can anyone tell me how i can
>>>> control the voltage level of this ADC3 from the tinyos code?
>>>>
>>>
>>> you aren't understanding how this ADC stuff really works..
>>>
>>> ADC3 is an input to the ADC subsystem so it is nonsensical to talk about
>>> controlling the voltage level from the tinyos code.
>>>
>>> I suggest that you read the TI msp430f1611 manual in conjunction with
>>> the moteiv telosb schematic to understand what hardware is provided and how
>>> it works.
>>>
>>>>
>>>> Please refer the pin diagram of the datasheet (page 23)
>>>>
>>>> http://moss.csc.ncsu.edu/~mueller/rt/rt11/readings/projects/g4/datasheet.pdf
>>>>
>>>> Kind Regards
>>>>
>>>> --
>>>> Mubashir Husain Rehmani
>>>>
>>>>
>>>>
>>>> ___
>>>> Tinyos-help mailing list
>>>> Tinyos-help@millennium.berkeley.edu
>>>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>>>
>>>
>>>
>>>
>>> --
>>> Eric B. Decker
>>> Senior (over 50 :-) Researcher
>>>
>>>
>>>
>>
>>
>> --
>> Mubashir Husain Rehmani
>>
>>
>>  --
>>
>> ___
>> Tinyos-help mailing list
>> Tinyos-help@millennium.berkeley.edu
>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>
>>
>
>
> --
> Mubashir Husain Rehmani
>
>
>


-- 
Mubashir Husain Rehmani
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] ADC port

2012-02-29 Thread Eric Decker
2012/2/29 Mubashir Rehmani 

> Hi Angré,
>
> Yes, all i want is to have output 0 or 1 on pin 10. If i clearly
> understood, port 6.3 is pin 10 (ADC3) of expansion connector U2?
>

Should be.  You will have to program Port 6.3 to be digital I/O rather than
connect it to the ADC subsystem.  P6SEL.  You should study the pin
schematic but it looks like to me that if you want digital i/o you want
P6.3SEL set to a 1.

The schematic and description you were quoting before was from a tote sky
which while very close to a telosb does have some differences.   Also from
what I have seen there is a 2004 and a 2005 version of the TelosB.  The
2005 version doesn't have the resistor placement nor the connections to
GIOn.

Which adds to the confusion.



>
> Kind Regards
>
>
> 2012/2/29 André Rodrigues 
>
>> **
>> Hi
>>
>> If all you want is to output 0 or 1 on pin 10, I would say that you just
>> have to use port 6.3. In that case you do not neet to use any resistors.
>>
>> But Eric could confirm (or not) my opinion.
>>
>> Next, study one of the available device drivers to learn how to select
>> the port for IO and how to set/clr the bit.
>>
>> Regards,
>>
>> André
>>
>>
>> - Original Message -
>> *From:* Mubashir Rehmani 
>> *To:* Eric Decker 
>> *Cc:* tinyos-help@millennium.berkeley.edu
>> *Sent:* Wednesday, February 29, 2012 9:23 AM
>> *Subject:* Re: [Tinyos-help] ADC port
>>
>> Thanks Eric for your answer.
>>
>> In fact, in the telosb motive data sheet,
>>
>> http://moss.csc.ncsu.edu/~mueller/rt/rt11/readings/projects/g4/datasheet.pdf
>> It is written on page 24 that *"If expansion pin 10 (ADC3) is used for
>> digital I/O instead of analog inputs, R14 must be populated with a 0 ohm
>> resistor to enable the pin for digital I/O (GIO0) on the microcontroller.
>> R16 must be populated with a 0 ohm resistor to enable GIO1. R14 and R16
>> are located on the top side of Telos between the USB controller and the
>> radio."*
>>
>> So, what i want to do is that i want to use the expansion pin 10 (ADC3)
>> and control the I/O signals through tinyos. More precisely, i want to
>> attach an electronic switch, which enables or disable an external device
>> (antenna) with the signal i provide it to this expansion pin 10 (ADC3). Do
>> you have any idea how to achieve this?
>>
>> Kind Regards
>>
>> On 29 February 2012 10:16, Eric Decker  wrote:
>>
>>>
>>>
>>>  On Tue, Feb 28, 2012 at 11:58 PM, Mubashir Rehmani <
>>> mshrehm...@gmail.com> wrote:
>>>
>>>> Dear All,
>>>>
>>>> I want to control the I/O of the 10-pin extension connector of (U2) of
>>>> the Telosb mote. In fact, i want to use ADC3 and control its power level in
>>>> order to connect the digital switch with it. Can anyone tell me how i can
>>>> control the voltage level of this ADC3 from the tinyos code?
>>>>
>>>
>>> you aren't understanding how this ADC stuff really works..
>>>
>>> ADC3 is an input to the ADC subsystem so it is nonsensical to talk about
>>> controlling the voltage level from the tinyos code.
>>>
>>> I suggest that you read the TI msp430f1611 manual in conjunction with
>>> the moteiv telosb schematic to understand what hardware is provided and how
>>> it works.
>>>
>>>>
>>>> Please refer the pin diagram of the datasheet (page 23)
>>>>
>>>> http://moss.csc.ncsu.edu/~mueller/rt/rt11/readings/projects/g4/datasheet.pdf
>>>>
>>>> Kind Regards
>>>>
>>>> --
>>>> Mubashir Husain Rehmani
>>>>
>>>>
>>>>
>>>> ___
>>>> Tinyos-help mailing list
>>>> Tinyos-help@millennium.berkeley.edu
>>>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>>>
>>>
>>>
>>>
>>> --
>>> Eric B. Decker
>>> Senior (over 50 :-) Researcher
>>>
>>>
>>>
>>
>>
>> --
>> Mubashir Husain Rehmani
>>
>>
>>  --
>>
>> ___
>> Tinyos-help mailing list
>> Tinyos-help@millennium.berkeley.edu
>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>
>>
>
>
> --
> Mubashir Husain Rehmani
>
>
>


-- 
Eric B. Decker
Senior (over 50 :-) Researcher
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] ADC port

2012-02-29 Thread Mubashir Rehmani
Thanks Eric for your answer. Now the things are clear to me.

Kind Regards

On 29 February 2012 11:52, Eric Decker  wrote:

>
>
> 2012/2/29 Mubashir Rehmani 
>
>> Hi Angré,
>>
>> Yes, all i want is to have output 0 or 1 on pin 10. If i clearly
>> understood, port 6.3 is pin 10 (ADC3) of expansion connector U2?
>>
>
> Should be.  You will have to program Port 6.3 to be digital I/O rather
> than connect it to the ADC subsystem.  P6SEL.  You should study the pin
> schematic but it looks like to me that if you want digital i/o you want
> P6.3SEL set to a 1.
>
> The schematic and description you were quoting before was from a tote sky
> which while very close to a telosb does have some differences.   Also from
> what I have seen there is a 2004 and a 2005 version of the TelosB.  The
> 2005 version doesn't have the resistor placement nor the connections to
> GIOn.
>
> Which adds to the confusion.
>
>
>
>>
>> Kind Regards
>>
>>
>> 2012/2/29 André Rodrigues 
>>
>>> **
>>> Hi
>>>
>>> If all you want is to output 0 or 1 on pin 10, I would say that you just
>>> have to use port 6.3. In that case you do not neet to use any resistors.
>>>
>>> But Eric could confirm (or not) my opinion.
>>>
>>> Next, study one of the available device drivers to learn how to select
>>> the port for IO and how to set/clr the bit.
>>>
>>> Regards,
>>>
>>> André
>>>
>>>
>>> - Original Message -
>>> *From:* Mubashir Rehmani 
>>> *To:* Eric Decker 
>>> *Cc:* tinyos-help@millennium.berkeley.edu
>>> *Sent:* Wednesday, February 29, 2012 9:23 AM
>>> *Subject:* Re: [Tinyos-help] ADC port
>>>
>>> Thanks Eric for your answer.
>>>
>>> In fact, in the telosb motive data sheet,
>>>
>>> http://moss.csc.ncsu.edu/~mueller/rt/rt11/readings/projects/g4/datasheet.pdf
>>> It is written on page 24 that *"If expansion pin 10 (ADC3) is used for
>>> digital I/O instead of analog inputs, R14 must be populated with a 0 ohm
>>> resistor to enable the pin for digital I/O (GIO0) on the microcontroller.
>>> R16 must be populated with a 0 ohm resistor to enable GIO1. R14 and R16
>>> are located on the top side of Telos between the USB controller and the
>>> radio."*
>>>
>>> So, what i want to do is that i want to use the expansion pin 10 (ADC3)
>>> and control the I/O signals through tinyos. More precisely, i want to
>>> attach an electronic switch, which enables or disable an external device
>>> (antenna) with the signal i provide it to this expansion pin 10 (ADC3). Do
>>> you have any idea how to achieve this?
>>>
>>> Kind Regards
>>>
>>> On 29 February 2012 10:16, Eric Decker  wrote:
>>>
>>>>
>>>>
>>>>  On Tue, Feb 28, 2012 at 11:58 PM, Mubashir Rehmani <
>>>> mshrehm...@gmail.com> wrote:
>>>>
>>>>> Dear All,
>>>>>
>>>>> I want to control the I/O of the 10-pin extension connector of (U2) of
>>>>> the Telosb mote. In fact, i want to use ADC3 and control its power level 
>>>>> in
>>>>> order to connect the digital switch with it. Can anyone tell me how i can
>>>>> control the voltage level of this ADC3 from the tinyos code?
>>>>>
>>>>
>>>> you aren't understanding how this ADC stuff really works..
>>>>
>>>> ADC3 is an input to the ADC subsystem so it is nonsensical to talk
>>>> about controlling the voltage level from the tinyos code.
>>>>
>>>> I suggest that you read the TI msp430f1611 manual in conjunction with
>>>> the moteiv telosb schematic to understand what hardware is provided and how
>>>> it works.
>>>>
>>>>>
>>>>> Please refer the pin diagram of the datasheet (page 23)
>>>>>
>>>>> http://moss.csc.ncsu.edu/~mueller/rt/rt11/readings/projects/g4/datasheet.pdf
>>>>>
>>>>> Kind Regards
>>>>>
>>>>> --
>>>>> Mubashir Husain Rehmani
>>>>>
>>>>>
>>>>>
>>>>> ___
>>>>> Tinyos-help mailing list
>>>>> Tinyos-help@millennium.berkeley.edu
>>>>>
>>>>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Eric B. Decker
>>>> Senior (over 50 :-) Researcher
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Mubashir Husain Rehmani
>>>
>>>
>>>  --
>>>
>>> ___
>>> Tinyos-help mailing list
>>> Tinyos-help@millennium.berkeley.edu
>>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>>
>>>
>>
>>
>> --
>> Mubashir Husain Rehmani
>>
>>
>>
>
>
> --
> Eric B. Decker
> Senior (over 50 :-) Researcher
>
>
>


-- 
Mubashir Husain Rehmani
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

[Tinyos-help] ADC external sensors

2007-06-18 Thread [EMAIL PROTECTED]
Hi i have a problem. I'm using a tmote sky with tinyos 1.1 and i must sample 
the voltage on a external capacitor. I set the ADC3 of the expansion connector 
but, when i see the value with the java Listen application, the tmote doesn't 
sample anything. The question is: all the channels are the same? The code i 
wrote to connect the external capacitor is:

enum
{
  TOS_ADC_SUPERCAP_PORT = unique("ADCPort"),

  TOSH_ACTUAL_ADC_SUPERCAP_PORT = ASSOCIATE_ADC_CHANNEL(
INPUT_CHANNEL_A3,
REFERENCE_VREFplus_AVss,
REFVOLT_LEVEL_2_5
  ),
};

which is the error? Is this the only part of code that i must change from the 
tutorial examples? 
Thanks 

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


[Tinyos-help] ADC-DMA help.

2005-10-25 Thread Mike Deneen
Hello,

I have managed to implement the Vanderbilt Time Sync code along with
ADC-DMA code with the intent of streaming 1khz adc samples to a base
station.  I have the ADC set up to sample at 1khz and then switch
buffers.  The full buffer is processed and sent out in a 128 byte
packet.

Right now, experimenting with two, I have read the global time, started
sampling, finished sampling, read the global time again.  With two
motes taking 73 samples/buffer there is a finishing time difference of
up to a millisecond.

Is the ADC really sampling at 1khz?  Is there a better way to
align the motes?  How much drift is expected?  It is
important for me to sample at the same time, mote to mote.

Thanks for any insight you can give.

-Mike
___
Tinyos-help mailing list
[EMAIL PROTECTED]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] ADC sampling rate

2006-01-25 Thread Alexandros Karagiannis




Hello,

I'm novice in this field so I have to apologize in advance if any of
the questions following seem to be not adnanced. 
I use Tmote sky and my primary target is to trasmit a ECG to a WSN and
receive it to a host in order to process it with matlab.I read
tutorials and any other helping stuff and I found an application report
including sample code which I tried to modify in order to fit my needs.
I haven't actually connected the ECG output to the appropriate pin of
the Tmote sky (Analog Input 0 ADC0 pin 3 from Tmote sky datasheet) and
at  the first tests i use a sinus input of variable frequency.

The problem is that for low frequencies (5 - 10Hz)  to approximately
120-160Hz i get a signal in matlab which i believe is satisfactory but
when i set the Timer.start( TIMER_REPEAT, x) where x is the value i
modify in order to set the sapling rate, i get a signal that is
distorted even if the input sinus is much lower in frequency.
I thought that the x value in Timer.start( TIMER_REPEAT, x) sets the
sampling rate of ADC because in the body of Timer.start(
TIMER_REPEAT,x) i check if data have been set and i call the getData()
to take the next sample. I have to stress that x is higher than 1ms
which i believe is the higher sampling rate (1KHz). Of course i 've
read that i can set the sampling rate even higher but i don't know the
way to do it. I assume that when i set the sapling rate in higher
frequencies, there must be simultaneous events fired that overwrite
data queued to be sent. This doesn't happen in lower frequencies. But i
have to know if this x value actually sets the sapling rate. Another
strange thing i noticed is that when i set the x value and connect to
the appropriate input pin a signal of the same frequency, i get a
perfect signal plotted in matlab. This is strange beacause in my mind i
thought i violated the sampling theorem.

Another thing i'd like to know is the time between the sampling and the
signal transmission from the mote.I don't have a clue about it.

Is it possible data to be overwritten by another sampling task and to
lose data before transmitting them?

I read in this forum that enabling DMA is very helpful. Is it to avoid
data losses and fast transmission to the RF part? How can i do it ?

I've tested a code that counts Timer.fired events and SendMsg.sendDone
and set the absolute value of the subtraction of the two counters to
the data field in ADC.dataReady. After testing different sampling rates
i noticed that for low sampling rates this value is constant.For
sampling rates above 160-170Hz this value was constantly rising. 

The code i run is

 EcgSenseM.nc

includes IntMsg;

module EcgSenseM
{
  provides interface StdControl;
  uses interface Timer;
  uses interface SendMsg;
  uses interface Leds;
  uses interface ADC;
  uses interface ADCControl;
}
implementation
{
  TOS_Msg m_msg;
  int m_int;
  bool m_sending;
  
  

  command result_t StdControl.init()
  {
    atomic m_int = 0;
    m_sending = FALSE;
    call Leds.init();
    call Leds.redOn();
    call ADCControl.init();
    call ADCControl.bindPort( TOS_ADC_ADC0_PORT,
TOSH_ACTUAL_ADC_ADC0_PORT );
    return SUCCESS;
  }

  command result_t StdControl.start()
  {
    call Timer.start( TIMER_REPEAT, 4);
    call ADC.getData();
    return SUCCESS;
  }

  command result_t StdControl.stop()
  {
    return SUCCESS;
  }

  event result_t Timer.fired()
  {
    if( m_sending == FALSE )
    {
  int n;
  IntMsg* body = (IntMsg*)m_msg.data;
  atomic n = m_int;
  body->val = n;
  body->src = "">
  if( call SendMsg.send( TOS_BCAST_ADDR, sizeof(IntMsg), &m_msg
) == SUCCESS )
  {
        m_sending = TRUE;
        //call SendMsg.send(TOS_BCAST_ADDR, sizeof(IntMsg), &m_msg
);
      call Leds.greenToggle();
  }
    }
    call ADC.getData();
    call Leds.yellowToggle();
    return SUCCESS;
  }

  async event result_t ADC.dataReady( uint16_t data )
  {
    atomic m_int = data;
    return SUCCESS;
  }

  event result_t SendMsg.sendDone( TOS_MsgPtr msg, result_t success )
  {
    m_sending = FALSE;
    return SUCCESS;
  }
}
. 
EcgSense.nc

includes adc0;
includes IntMsg;


configuration EcgSense
{
   provides {
  interface StdControl;
   }
}

implementation
{
   components Main, EcgSenseM, TimerC, GenericComm, LedsC, ADCC;

   Main.StdControl -> EcgSenseM;
   Main.StdControl -> GenericComm.Control;
   Main.StdControl -> ADCC;
   Main.StdControl -> TimerC;

   StdControl = EcgSenseM;

   EcgSenseM.Timer -> TimerC.Timer[unique("Timer")];
   EcgSenseM.SendMsg -> GenericComm.SendMsg[AM_INTMSG];
   EcgSenseM.Leds -> LedsC;
   EcgSenseM.ADC -> ADCC.ADC[TOS_ADC_ADC0_PORT];
   EcgSenseM.ADCControl -> ADCC;
}

Thank you and sorry for the extended post. 


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


[Tinyos-help] ADC voltage reference

2006-02-01 Thread Jordi Vilaseca
I'm working with cricket mote's and I want to convert Tos_msg signal strength to Volts. I have found the relation: 
(ADC_Value / 1024) * Vref = RSSI Voltage.
I've read that Atmega 128L has two possible references: AVCC ( analog supply voltage) or an internal reference of 2.56V. Wich reference is used in mica2 / cricket mote's to do the convertion?
 
Jordi Vilaseca
 
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC help

2006-02-03 Thread Michael Schippling

There are some examples of using the ADC component directly in my huge
bolus of code at:   http://www.etantdonnes.com/Motes/robocode.tar.gz
Most likely you have not made the ADC and input so you are converting
the equivalent of a logic 1...

The only special sensorboard stuff is that they switch on internal
sensors (photo,temp) using digital outputs from some specific pins
and then make sure to switch the ADC to the right channel. The code
should work pretty well without the SB attached. You should be able to
connect your input to ADC1 and use the Photo component to get started.

I'm a little confused by your math...basically Vref is the Max voltage
and 0 is the Min. I think it should be   ADC =  (Vin / Vref) * 1024
where 1024 is the maximum reading from a 10 bit converter. Also I believe
Vref is the supply voltage or very near, so 3 volts.

MS


TEAM X wrote:

Hi,

I'm trying to connect some components to the ADC channels on a Mica2.  I am not using the Crossbow sensorboards, but all of the code examples I have seen are using this sensorboard. 
The only ports I have connected are the ADC channel (ADC3) and ground. No matter what voltage I put on the input channel, I get a very large value (>32000) as the input for the ADC.  Am I missing something?




Does anyone have an example of code for the ADC that does not use a Crossbow sensorboard? 


On a related issue,
ADC=(Vin / 1024) * Vref
Where Vin can be between 0 and (2^6-1)*Vref and Vref is 1.23 V.


Does this really mean that the ADC can take in voltages of up to 80V.  I find 
that hard to believe.

Thanks very much,
Joe




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

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


Re: [Tinyos-help] ADC help

2006-02-03 Thread TEAM X
Thanks for the help, I will take a look at your code.  But I just want to put this out there.According to the comments in tos/platform/mica2/ADCREFM.nc :/*  OS component abstraction of the analog to digital converter using a
 *  fixed reference input.  I assumes the presence of a TOS_ADC_BANDGAP_PORT *  to provide that referenced reading. This module was designed to *  accomodate platforms that use varying/unstable ADC references. It also
 *  works around limitations where the measured variable cannot be larger than *  the actual ADC reference * *  The conversion result is given by the equation: * * ADC = (Vport * 1024) / Vref
 * *  Where Vport can be between zero and (2^6-1)*Vref (I.E. Vport CAN be larger *  than Vref) * *  Note: On the ATmega128, Vref (using this module) is 1.23 Volts */(2^6-1)=6363*1.23 = 
77.49This is obviously incorrect, so I would to know what the real range of inputs on the ADC is if anyone knows.Thanks again,JoeOn 2/3/06, 
Michael Schippling <[EMAIL PROTECTED]> wrote:
There are some examples of using the ADC component directly in my hugebolus of code at:   
http://www.etantdonnes.com/Motes/robocode.tar.gzMost likely you have not made the ADC and input so you are converting
the equivalent of a logic 1...
The only special sensorboard stuff is that they switch on internalsensors (photo,temp) using digital outputs from some specific pinsand then make sure to switch the ADC to the right channel. The codeshould work pretty well without the SB attached. You should be able to
connect your input to ADC1 and use the Photo component to get started.I'm a little confused by your math...basically Vref is the Max voltageand 0 is the Min. I think it should be   ADC =  (Vin / Vref) * 1024
where 1024 is the maximum reading from a 10 bit converter. Also I believeVref is the supply voltage or very near, so 3 volts.MSTEAM X wrote:> Hi,>> I'm trying to connect some components to the ADC channels on a Mica2.  I am not using the Crossbow sensorboards, but all of the code examples I have seen are using this sensorboard.
> The only ports I have connected are the ADC channel (ADC3) and ground. No matter what voltage I put on the input channel, I get a very large value (>32000) as the input for the ADC.  Am I missing something?

 Does anyone have an example of code for the ADC that does not use a Crossbow sensorboard?>> On a related issue,> ADC=(Vin / 1024) * Vref> Where Vin can be between 0 and (2^6-1)*Vref and Vref is 
1.23 V.>>> Does this really mean that the ADC can take in voltages of up to 80V.  I find that hard to believe.>> Thanks very much,> Joe>>> 
>> ___> Tinyos-help mailing list> 
Tinyos-help@Millennium.Berkeley.EDU> 
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

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


Re: [Tinyos-help] ADC help

2006-02-03 Thread Michael Schippling

huh...I'd better go look at the code and schematic for the acutal Vref..
I should already know this, but I've not been concerned with accuracy
in my conversions...

But the interpretation of the formula is incorrect. The formula is the
same as the one I sent. Vport is the acutal analog voltage at the
converter input (not the binary output (ADC) which is written as (2^6-1)).
Effectively it's the ratio of the input to Vref times the max for the
number of bits of conversion. Mica's have 10bit converters so that's 1024.
I don't know where the 2^6 comes from...maybe an older device with 6 bit
converters, or a typo.

In any case the maximum voltage on the pin is speced at something around
Vcc + 1 or there-abouts. I stand by the assertion that the max input reading
is _close_ to the Vref because that's how successive approximation converters
work...I will spend a bit of time looking into what Vref actually is...

MS

TEAM X wrote:
Thanks for the help, I will take a look at your code.  But I just want 
to put this out there.

According to the comments in tos/platform/mica2/ADCREFM.nc :

/*  OS component abstraction of the analog to digital converter using a
 *  fixed reference input.  I assumes the presence of a TOS_ADC_BANDGAP_PORT
 *  to provide that referenced reading. This module was designed to
 *  accomodate platforms that use varying/unstable ADC references. It also
 *  works around limitations where the measured variable cannot be 
larger than

 *  the actual ADC reference
 *
 *  The conversion result is given by the equation:
 *
 * ADC = (Vport * 1024) / Vref
 *
 *  Where Vport can be between zero and (2^6-1)*Vref (I.E. Vport CAN be 
larger

 *  than Vref)
 *
 *  Note: On the ATmega128, Vref (using this module) is 1.23 Volts
 */

(2^6-1)=63
63*1.23 = 77.49

This is obviously incorrect, so I would to know what the real range of 
inputs on the ADC is if anyone knows.


Thanks again,
Joe

On 2/3/06, * Michael Schippling* <[EMAIL PROTECTED] 
> wrote:


There are some examples of using the ADC component directly in my huge
bolus of code at:   http://www.etantdonnes.com/Motes/robocode.tar.gz
Most likely you have not made the ADC and input so you are converting
the equivalent of a logic 1...

The only special sensorboard stuff is that they switch on internal
sensors (photo,temp) using digital outputs from some specific pins
and then make sure to switch the ADC to the right channel. The code
should work pretty well without the SB attached. You should be able to
connect your input to ADC1 and use the Photo component to get started.

I'm a little confused by your math...basically Vref is the Max voltage
and 0 is the Min. I think it should be   ADC =  (Vin / Vref) * 1024
where 1024 is the maximum reading from a 10 bit converter. Also I
believe
Vref is the supply voltage or very near, so 3 volts.

MS


TEAM X wrote:
 > Hi,
 >
 > I'm trying to connect some components to the ADC channels on a
Mica2.  I am not using the Crossbow sensorboards, but all of the
code examples I have seen are using this sensorboard.
 > The only ports I have connected are the ADC channel (ADC3) and
ground. No matter what voltage I put on the input channel, I get a
very large value (>32000) as the input for the ADC.  Am I missing
something?
 >
 >
 >
 > Does anyone have an example of code for the ADC that does not use
a Crossbow sensorboard?
 >
 > On a related issue,
 > ADC=(Vin / 1024) * Vref
 > Where Vin can be between 0 and (2^6-1)*Vref and Vref is 1.23 V.
 >
 >
 > Does this really mean that the ADC can take in voltages of up to
80V.  I find that hard to believe.
 >
 > Thanks very much,
 > Joe
 >
 >
 >


 >
 > ___
 > Tinyos-help mailing list
 > Tinyos-help@Millennium.Berkeley.EDU

 >
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help



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


Re: [Tinyos-help] ADC Vref???

2006-02-04 Thread Michael Schippling


Here's (my interpretation of) the real poop on the ADC range.
The short answer is that the Vref is VCC and that's the max you
can convert...Also, this is good news if you are running on
batteries with passive sensors because their output will droop
with the battery voltage, in sync with the conversion reference.


From the ATMEGA 128 manual --

The ADC converts an analog input voltage to a 10-bit digital value through 
successive
approximation. The minimum value represents GND and the maximum value represents
the voltage on the AREF pin minus 1 LSB. Optionally, AVCC or an internal 2.56V 
reference
voltage may be connected to the AREF pin by writing to the REFSn bits in the
ADMUX Register. The internal voltage reference may thus be decoupled by an 
external
capacitor at the AREF pin to improve noise immunity.

>
> ...
>

The reference voltage for the ADC (VREF) indicates the conversion range for the 
ADC.
Single ended channels that exceed VREF will result in codes close to 0x3FF. 
VREF can be
selected as either AVCC, internal 2.56V reference, or external AREF pin.
AVCC is connected to the ADC through a passive switch. The internal 2.56V 
reference
is generated from the internal bandgap reference (VBG) through an internal 
amplifier. In
either case, the external AREF pin is directly connected to the ADC, and the 
reference
voltage can be made more immune to noise by connecting a capacitor between the
AREF pin and ground. VREF can also be measured at the AREF pin with a high 
impedant
voltmeter. Note that VREF is a high impedant source, and only a capacitive load 
should
be connected in a system.
If the user has a fixed voltage source connected to the AREF pin, the user may 
not use
the other reference voltage options in the application, as they will be shorted 
to the
external voltage. If no external voltage is applied to the AREF pin, the user 
may switch
between AVCC and 2.56 V as reference selection.


So the reference choices are either AVCC (the separate power pin for the
ADCs, so you can decouple it from the digital noise better), the
internal 2.56v reference, or an external voltage applied to the AREF pin.
In any case that voltage (minus 1 bit) is the maximum you can convert.

According to the schematic AVCC is connected via a filter to VCC so it's
basically the battery or power-supply voltage. Also on the schematic,
AREF is connected to VSNSR which is connected to VCC by a 0 ohm resistor...
Given that the power switch is bypassed by a 0 ohm resistor as well,
this may be a misnomer for an infinite resistor, meaning that it is not
connected to anything but that it _could_ be if one found the right pads
on the board. However this is belied by the software setting described
below, and my experience that the VSNSR voltage is close to VCC.

So then it boils down to how the REFS register bits are set when doing
a conversion. Now we gotta look at the code...which hardly ever makes any
sense to me...

It looks like the REFS bits are set to 00 in the HPLADCM.nc ADC.init() at
outp(0, ADMUX), which is "use the external voltage at the AREF pin".
I can't find any other reference to REFS anywhere so I'm going to assume
that this means that the ADC Vref is actually VSNSR which is actually VCC,
the confusion over the hermeneutics of a 0 ohm resistor not-with-standing.

The other confusion is that there is a separate CalADC interface which
uses an internal 1.23v calibration reference to adjust ADC readings.
This is what you saw in ADCREFM.nc. I think this only comes into play
if you wire to CalADC instead of ADC. But YMMV.

Anyway...the comments that set this ship sailing: "(2^6-1) * Vref"
and "Vref is 1.23 Volts", seem to be totally wrong at worst and
misleading at best.

phwew...
MS

Michael Schippling wrote:

huh...I'd better go look at the code and schematic for the acutal Vref..
I should already know this, but I've not been concerned with accuracy
in my conversions...

But the interpretation of the formula is incorrect. The formula is the
same as the one I sent. Vport is the acutal analog voltage at the
converter input (not the binary output (ADC) which is written as (2^6-1)).
Effectively it's the ratio of the input to Vref times the max for the
number of bits of conversion. Mica's have 10bit converters so that's 1024.
I don't know where the 2^6 comes from...maybe an older device with 6 bit
converters, or a typo.

In any case the maximum voltage on the pin is speced at something around
Vcc + 1 or there-abouts. I stand by the assertion that the max input 
reading
is _close_ to the Vref because that's how successive approximation 
converters

work...I will spend a bit of time looking into what Vref actually is...

MS

TEAM X wrote:
Thanks for the help, I will take a look at your code.  But I just want 
to put this out there.

According to the comments in tos/platform/mica2/ADCREFM.nc :

/*  OS component abstraction of the analog to digital converter using a
 *  fixed reference input.  I assumes the presence of a 

Re: [Tinyos-help] ADC interface

2006-03-07 Thread Michael Schippling

getData starts a conversion cycle on the configuration-specified ADC
and returns SUCCESS or something like that.

dataReady(uint16_t d) is called, some 25 clocks later, and the arg
is the converted value. You can imagine it as an interrupt routine.

For an example see the Oscilloscope demo app.
MS

wassim znaidi wrote:
i'm new user in tinyos and i want to know how the command ADC.getData() 
does work
please can anyone help me to understand how this function get the data 
and what it return


thanks




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

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


Re: [Tinyos-help] ADC Value

2006-06-16 Thread Matthew J Whelan
4096 is the range of the ADC in bits.  12-bit conversion = 2^12 = 4096. [EMAIL PROTECTED] wrote: -To: From: "Chang Li" <[EMAIL PROTECTED]>Sent by: [EMAIL PROTECTED]Date: 06/16/2006 05:55PMSubject: [Tinyos-help] ADC ValueIn the ADC convertion of telos the V =Value/4096*Vref, what is the meaning of 4096? Does it apply for all the ADC convertion for MSP430 in TinyOS?  Chang ___Tinyos-help mailing listTinyos-help@Millennium.Berkeley.EDUhttps://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] ADC switch channel

2006-09-26 Thread lamiaimeil
Hi all,
I have a 3-axis accelerometer mount on tmote sky.
Every axis (x,y and z) is connected with a different
pin of the expansion connector and I want to sample a
channel and switch to the next (from x to y and from y
to z) cyclical. I must do it at 6000Hz but I see that
the ADC time for switch from a channel to another is
10ms(!) so I can go at maximum rate of 100Hz.. I can't
believe that an ADC that can sample at 200KHz take
10ms for switching on channels.. How can I do to
improve this frequency?
I try to look on MSP430 user guide and I see there is
a register called ADC12MCTLx (ADC12 Conversion Memory
Control Registers) where I can switch the input
channel setting INCHx. Do this mean I must use
assembly code? If yes, how can I do this?
Thanks in advance.
Andrea.

__
Do You Yahoo!?
Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto 
spazio gratuito per i tuoi file e i messaggi 
http://mail.yahoo.it 
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] Adc module compiler warnings

2007-08-24 Thread John Griessen

I found a missing wiring to autoRVG module and got a compile
of my Adc mux sensorboard modules.

Are these compiler warnings needing investigation?


 make ecosens1
mkdir -p build/ecosens1
compiling Testch12AdcC to a ecosens1 binary
ncc -o build/ecosens1/main.exe -Os -O -mdisable-hwmul -Wall -Wshadow 
-DDEF_TOS_AM_GROUP=0x7d -Wnesc-all -target=ecosens1 
-fnesc-cfile=build/ecosens1/app.c -board=ch12Adc 
-DIDENT_PROGRAM_NAME=\"Testch12AdcC\" -DIDENT_USER_ID=\"john\" 
-DIDENT_HOSTNAME=\"ecolab\" -DIDENT_USER_HASH=0x41bf5233L 
-DIDENT_UNIX_TIME=0x46cf4c92L -DIDENT_UID_HASH=0x38406f0aL 
Testch12AdcC.nc -lm
/opt/tinyos-2.x/tos/sensorboards/ch12Adc/ch12AdcP.nc: In function 
`ch12AdcP$ch12Adc$getData':
/opt/tinyos-2.x/tos/sensorboards/ch12Adc/ch12AdcP.nc:46: warning: no 
return statement in function returning non-void
/opt/tinyos-2.x/tos/sensorboards/ch12Adc/ch12AdcP.nc: In function 
`ch12AdcP$ch12Adc$configure':
/opt/tinyos-2.x/tos/sensorboards/ch12Adc/ch12AdcP.nc:40: warning: no 
return statement in function returning non-void

compiled Testch12AdcC to build/ecosens1/main.exe
5558 bytes in ROM
 317 bytes in RAM

one function is
   call Resource.request();
(there is a   event void Resource.granted() to handle it)
other is
call multichannel.configure(config, memctl, numMemctl, buffer, 
numSamples, jiffies);


If you have some minutes to look, the latest code files are here:


http://ecosensory.com/Testch12AdcC.nc
http://ecosensory.com/Testch12AdcP.nc
http://ecosensory.com/ch12AdcC.nc
http://ecosensory.com/ch12AdcP.nc

Thanks,

John Griessen
--
Ecosensory
tinyOS devel on:  ubuntu Linux;   tinyOS v2.0.2;   telosb ecosens1
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


RE: [Tinyos-help] ADC sampling rate

2007-10-07 Thread Muhammad Azhar

My apologies, there was some error in the data shown below.  The actual value 
is actually:
 
setSamplingRate(i)
i = 0 & 1 -> no response
i = 2 -> 0 samples received
i = 3 -> 8 samples received
i = 4 -> 7 samples received
i = 5 -> 5 samples received
i = 6 -> 3 samples received
i = 7 -> 2 samples received
 
   Would be great if anyone can tell me what might have gone wrong (I have not 
changed the implementation of VU's timer just for your info - and I made sure 
that the "original" micaz folder was renamed micaz2, and the one used for 
acoustic ranging is called micaz - hence, typing "make micaz" should point to 
the correct directory for acousting ranging).
 
Regards,
Azhar


From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: [Tinyos-help] ADC sampling 
rateDate: Sun, 7 Oct 2007 06:14:54 +




Hi all,I understand that the timer used for acoustic ranging done by VU is 
somewhat different from the original implementation.  I've used the timer 
provided by VU, but I seem to run into problems in obtaining the correct 
quantity of data when doing acoustic ranging using micaz motes on TinyOS 
1.1.15.   As a first step, I decided to see how many samples are actually 
returned by OutsideRangingSensorM (i.e. I used a counter each time bufferIndex 
was reset).  Hence, in one set of 16 chirps, the counter should return me 16.  
However, each time a set of 16 chirps has been sent, the counter returns me a 
value of 3.   As a next step, I reduced the implementation to such that only 
one set of 16 chirps was sampled each time - again it returns me 3 samples.   
Since this program uses ADC.getContinuousData(), I thought that the sampling 
rate for this ADC was too slow - hence in MicM, I explicitly called 
ADCControl.setSamplingRate(0) [as this should be the fastest] in 
StdControl.star!
 t(), but unfortunately, it returned 0 samples when I tried running the 
program.  I also tried it out with different sampling rate and this was what I 
got: 0,1 - 0 samples received2 - 8 samples received3 - 7 samples received4 - 5 
samples received5 - 4 samples received6 - 2 samples received7 - 2 samples 
receivedThus, I'm quite lost as I can't seem to get all the 16 chirps to be 
sampled.  Any suggestions? Thanks and best regards,Azhar___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

[Tinyos-help] ADC issues with atmega128

2009-08-03 Thread farooq_s

Hi,

At last i succeeded in establishing radio contact between my custom nodes. I
have added a light-to-voltage sensor to the ADC1 pin of my ATmega128 MCU.
Now I cannot figure out how to make the ADC operational. There are so many
interfaces and configurations in the adc folder in tinyos that i am totally
confused.

In the tutorials I found that the VoltageC() has something to do with the
sensor and the pin to which it is attached. I tried studying that as well
but to no avail. 

Kindly help me in this regard guys, I really need to make the ADC going!

Regards,
Farooq Sultan
-- 
View this message in context: 
http://www.nabble.com/ADC-issues-with-atmega128-tp24775854p24775854.html
Sent from the TinyOS - Help mailing list archive at Nabble.com.

___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] ADC free run mode

2010-05-19 Thread Omar Bouzid
Hi all,
I want to know how can I use the ADC free run mode in tinyos-2.x using Micaz to 
sample continuously the mts310 microphone sensor? Or how can I modify DetectorC 
code in the soundlocalizer application so that it saves the data sampled in a 
buffer rather doing threshold test?

Your help is highly appreciated.

Thanks,
Omar 

___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] ADC Reading in MDA300CA

2010-07-20 Thread Francesco Ficarola
Good evening.
I'm Francesco Ficarola, an italian student (so sorry for my bad
english) of the Computer Engeneering (II level degree) in "La
Sapienza" University. I download MDA300CA driver by
"tinyos-2.x-contrib/uoit/mda300ca" because I must do a thesis about
this platform. My hardware is MIB520, Iris Mote XM2110CA and MDA300CA
Sensor Board.
I wrote my first application in nesC (TinyOS 2.1.1) to read the ADC
values of the MDA300CA single channels, but certainly there is
something wrong because the readDone event is never called. I know it
because in this event I call Leds.led1Toggle() to debug it and it
doesn't turn on. Can you help me, please? You can find my code in
attached.

Thanks in advance for availability.

Greetings,
Francesco Ficarola


ADCRead.tar.gz
Description: GNU Zip compressed data
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] ADC reading fluctuations

2010-11-08 Thread Michael Schippling
You may be getting power line noise. Try shorting the ADC input
to ground to see if the fluctuation goes away. If not there may
be a problem with your power supply itself -- although the
accelerometer reading would indicate otherwise. If the noise
goes away when shorted you can try shielding the sensor wires
and fiddling with the wiring and routing. It could also be a
ground loop if you aren't connecting your ground wires to a
common point.

I'm not clear how you are connecting your bend sensor. If it
is a "straight-ahead" variable resistance, you need to have
a fixed resistor in series Oh, maybe that's the issue
Are you just running it between the ADC input and ground?
If so a better way would be to have a resistor from the
Vref or power supply to the sensor, who's other end is
grounded. Then attach the ADC input to the resistor-sensor
connection point. That makes the whole thing a voltage divider.
Start with a 10K resistor, since that's how much your bender
changes. You can use ohms law to figure out a more optimal
value based on the min/max resistance of the sensor. Bear in
mind that the ADC input has an impedance which will be in
parallel with your sensor, IIRC, something around 250Kohms.

MS

krisa wrote:
> I am having a problem with reading value from ADC ports of telosb mote
> using TinyOS 2.1.1
> I have a simple variable resistor sensors (bend sensors) attached to
> ports 6.3 - 6.7 (ADC3-ADC7), and while their resistace is not changed
> I would assume their readings to be somewhat constant (of course with
> some noise), but they are fluctuating in almost a sine like pattern -
> while sampling with 100ms rate some 3-4 readings have a value which
> seems lke the correct value, then some 4-5 readings have value lower
> by some 200-300 or even more.
> On  the other hand I have an accelerometer attached to ADC0-ADC2 and
> its readings while in peaceful condition only fluctuates a little
> (maybe 10-20 units max) and not in such a recognizable pattern - which
> seems as it should be.
> 
> I am using this configuration for reading the values
>   const msp430adc12_channel_config_t config = {
>   inch: INPUT_CHANNEL_A0, //Of course changing to the correct port
>   sref: REFERENCE_VREFplus_AVss,
>   ref2_5v: REFVOLT_LEVEL_2_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
>   };
> but I have experimented with many others - by some manipulations to
> clock selection or sample hold time, I have managed to get constant
> readings, but then the readings dont change even if the resistor value
> is changed - basically not working.
> I have tried both reading thorough the Read interface and
> Msp430Adc12MultiChannel through Msp430Adc12ClientAutoRVGC with the
> same results  - maybe there is another method?
> 
> Also - even if I disconnect the sensor from the port i still get
> uneaven readings - sometimes maximum of 4095 and sometimes as low as
> 0.
> I am quite sure that the problem is me not knowing how to read the
> sensor data in TinyOS and not broken mote, because It was previously
> tested with another programming language which gave more consistent
> sensor readings.
> The only possiblity what comes to my mind is that there is some kind
> of inconsistency with clocks (some interferance pattern?) because the
> readings are distorted in a regular pattern and if I change the
> sampling rate the distortions also still are sine form only longer or
> shorter. (1000 ms sampling yields some 9 high and 9 low readings, 25
> ms sampling yields approx 2 high and 2 low readings).
> 
> I think the problem is the configuration, and seeing as I am quite new
> to mote programming I am a little in dark here - which reference and
> clock should I use (it seems they could be different from those used
> for the accelerometer)
> 
> Also a followup question - the resistor when changed has approx 10kohm
> variance which translates in approx 100-200 points of reading change -
> is there a way to enhace this so the range would be closer to the
> whole scale of 0-4095?
> 
> I have spent many days on this problem and would really appreciate any
> help or insight in this matter.
> 
> Thank you in advance!
> 
> 
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC reading fluctuations

2010-11-08 Thread Yong, Chee Yeew
Not being a lot of help here, but I measured / calculated the input
impedance of the MDA300 ADC input recently, and it gave me 500kOhms.

> -Original Message-
> From: tinyos-help-boun...@millennium.berkeley.edu
> [mailto:tinyos-help-boun...@millennium.berkeley.edu]on Behalf 
> Of Michael
> Schippling
> Sent: 08 November 2010 16:31
> To: krisa
> Cc: tinyos-help@millennium.berkeley.edu
> Subject: Re: [Tinyos-help] ADC reading fluctuations
> 
> 
> You may be getting power line noise. Try shorting the ADC input
> to ground to see if the fluctuation goes away. If not there may
> be a problem with your power supply itself -- although the
> accelerometer reading would indicate otherwise. If the noise
> goes away when shorted you can try shielding the sensor wires
> and fiddling with the wiring and routing. It could also be a
> ground loop if you aren't connecting your ground wires to a
> common point.
> 
> I'm not clear how you are connecting your bend sensor. If it
> is a "straight-ahead" variable resistance, you need to have
> a fixed resistor in series Oh, maybe that's the issue
> Are you just running it between the ADC input and ground?
> If so a better way would be to have a resistor from the
> Vref or power supply to the sensor, who's other end is
> grounded. Then attach the ADC input to the resistor-sensor
> connection point. That makes the whole thing a voltage divider.
> Start with a 10K resistor, since that's how much your bender
> changes. You can use ohms law to figure out a more optimal
> value based on the min/max resistance of the sensor. Bear in
> mind that the ADC input has an impedance which will be in
> parallel with your sensor, IIRC, something around 250Kohms.
> 
> MS
> 
> krisa wrote:
> > I am having a problem with reading value from ADC ports of 
> telosb mote
> > using TinyOS 2.1.1
> > I have a simple variable resistor sensors (bend sensors) attached to
> > ports 6.3 - 6.7 (ADC3-ADC7), and while their resistace is 
> not changed
> > I would assume their readings to be somewhat constant (of 
> course with
> > some noise), but they are fluctuating in almost a sine like 
> pattern -
> > while sampling with 100ms rate some 3-4 readings have a value which
> > seems lke the correct value, then some 4-5 readings have value lower
> > by some 200-300 or even more.
> > On  the other hand I have an accelerometer attached to ADC0-ADC2 and
> > its readings while in peaceful condition only fluctuates a little
> > (maybe 10-20 units max) and not in such a recognizable 
> pattern - which
> > seems as it should be.
> > 
> > I am using this configuration for reading the values
> >   const msp430adc12_channel_config_t config = {
> >   inch: INPUT_CHANNEL_A0, //Of course changing to the 
> correct port
> >   sref: REFERENCE_VREFplus_AVss,
> >   ref2_5v: REFVOLT_LEVEL_2_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
> >   };
> > but I have experimented with many others - by some manipulations to
> > clock selection or sample hold time, I have managed to get constant
> > readings, but then the readings dont change even if the 
> resistor value
> > is changed - basically not working.
> > I have tried both reading thorough the Read interface and
> > Msp430Adc12MultiChannel through Msp430Adc12ClientAutoRVGC with the
> > same results  - maybe there is another method?
> > 
> > Also - even if I disconnect the sensor from the port i still get
> > uneaven readings - sometimes maximum of 4095 and sometimes as low as
> > 0.
> > I am quite sure that the problem is me not knowing how to read the
> > sensor data in TinyOS and not broken mote, because It was previously
> > tested with another programming language which gave more consistent
> > sensor readings.
> > The only possiblity what comes to my mind is that there is some kind
> > of inconsistency with clocks (some interferance pattern?) 
> because the
> > readings are distorted in a regular pattern and if I change the
> > sampling rate the distortions also still are sine form only 
> longer or
> > shorter. (1000 ms sampling yields some 9 high and 9 low readings, 25
> > ms sampling yields approx 2 high and 2 low readings).
> > 
> > I think the problem is the configuration, and seeing as I 
> am quite new
> > to mote programming I am a little in dark here - which reference and
> > clock should I use (it see

Re: [Tinyos-help] ADC reading fluctuations

2010-11-08 Thread Michael Schippling
Less than an order of magnitude off...
Not bad for failing memory circuits.
I think the ATMEGA might have been around 250K.
Or maybe the 165f818 PIC...
MS


Yong, Chee Yeew wrote:
> Not being a lot of help here, but I measured / calculated the input
> impedance of the MDA300 ADC input recently, and it gave me 500kOhms.
> 
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC reading fluctuations

2010-11-09 Thread krisa
A huge thank you!
I Knew just connecting the variable resistor to adc pin and ground
seemed like not the best choice, but didn't know about voltage divider
(as I am quite new to electronics)
With 10 kohm resistor in voltage divider it just worked (I got
readings of approx 2000 while the variable resistor vas strainght
(~10kohm) and approx 3700 when it was bent (~25kohm) So for this
particular use it works well enough, but because I would also like to
get a bit smarter - could you explain how the impedance of ADC input
you mentioned affects the whole thing? And how do I measure it - with
multimeter on ADC/ground pins?
Also If I understand correctly - then simply connecting the ADC to
ground should not have worked at all? And the voltage that I was
reading - that came as a feedback from the ground wire then?

Thanks again!

On Tue, Nov 9, 2010 at 1:31 AM, Michael Schippling  wrote:
> Less than an order of magnitude off...
> Not bad for failing memory circuits.
> I think the ATMEGA might have been around 250K.
> Or maybe the 165f818 PIC...
> MS
>
>
> Yong, Chee Yeew wrote:
>>
>> Not being a lot of help here, but I measured / calculated the input
>> impedance of the MDA300 ADC input recently, and it gave me 500kOhms.
>>
>



-- 
--
Krišjānis Nesenbergs

___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] ADC reading fluctuations

2010-11-09 Thread Michael Schippling
Presuming you are wired the way I said, the ADC input of the
micro-controller is now in parallel with your sensor. You can
use the {guessed,calculated,speced} input impedance to figure
out a more exact resistor divider. There are devices that have
much higher impedance where you might have to worry about the
input, but given that your sensor divider seems to be an order
of magnitude smaller than the input it probably doesn't make
much difference.

To guesstimate the input impedance, wire a variable resistor from
the Vref directly to the ADC input similar to what you had before.
In this case, the bottom half of your resistor divider would be
the input itself. Then you could twiddle the pot around until you
got a half-scale ADC reading. So the input impedance would be equal
to the resistor value.

good luck...
MS


krisa wrote:
> A huge thank you!
> I Knew just connecting the variable resistor to adc pin and ground
> seemed like not the best choice, but didn't know about voltage divider
> (as I am quite new to electronics)
> With 10 kohm resistor in voltage divider it just worked (I got
> readings of approx 2000 while the variable resistor vas strainght
> (~10kohm) and approx 3700 when it was bent (~25kohm) So for this
> particular use it works well enough, but because I would also like to
> get a bit smarter - could you explain how the impedance of ADC input
> you mentioned affects the whole thing? And how do I measure it - with
> multimeter on ADC/ground pins?
> Also If I understand correctly - then simply connecting the ADC to
> ground should not have worked at all? And the voltage that I was
> reading - that came as a feedback from the ground wire then?
> 
> Thanks again!
> 
> On Tue, Nov 9, 2010 at 1:31 AM, Michael Schippling  wrote:
>> Less than an order of magnitude off...
>> Not bad for failing memory circuits.
>> I think the ATMEGA might have been around 250K.
>> Or maybe the 165f818 PIC...
>> MS
>>
>>
>> Yong, Chee Yeew wrote:
>>> Not being a lot of help here, but I measured / calculated the input
>>> impedance of the MDA300 ADC input recently, and it gave me 500kOhms.
>>>
> 
> 
> 
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] ADC Readings and VREF

2010-12-02 Thread Francesco Ficarola
Hi everybody.

I want to read ADC values by IRIS XM2110CA. I use a break-out board to
access to the pins. The formula to convert the ADC value to the voltage is:

Voltage = VCC * ADC_VALUE / 1024

Right?

But... if VCC decreases as the batteries run down and so it has a
dynamic value, how can i know the right voltage in the ADC channel? In
the Atm128AdcConfig interface I tried to configure the getRefVoltage()
command to:
- ATM128_ADC_VREF_OFF
- ATM128_ADC_VREF_AVCC
- ATM128_ADC_VREF_2_56

Unfortunately nothing has changed, the ADC voltage always depends from VCC.

Moreover, I have a problem with some batteries. For example, with the
Duracell batteries, the ADC readings are very fluctuating. Conversely,
with the Brondi batteries or also with the Lab Power Supply, the ADC
readings are constant. Why?

Greetings,
-- 
Francesco Ficarola 
[GPG KeyID: 0xDBA99D92]



signature.asc
Description: OpenPGP digital signature
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

[Tinyos-help] ADC Readings and VoltageC

2011-01-20 Thread Francesco Ficarola
Hi everybody!

I have an IRIS mote (XM2110CA) and when I read a simple voltage
battery thanks to VoltageC component I get a corret reading, but if I
introduce also some ADC readings (for example with a potentiometer) by
channel 0/1/2... (with a break-out board like this:
http://www.etantdonnes.com/Motes/MicaBOB/), then VoltageC values
change and depend on the resistance of the potentiometer... It's very
strange. Why?

P.S. If I read ADC values thanks to MDA300CA sensorboard, then
VoltageC shows correct values. Also with telosb mote the ADC readings
and VoltageC values are correct and indipendent.

Regards,
Francesco Ficarola
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


[Tinyos-help] ADC multi channel setting

2011-05-10 Thread Seyed Alireza Ahmadi
Hi All,

Can you please tell me what "jiffies" in the ADC setting and how it effects my 
conversion. Is there is there a standard value for it or how can figure the 
correct value for my applications?
The questions above are also in my mind for the numSamples required in the ADC 
setting.
As last can you please give me a sample code for the ADC multichannel (2 input 
channel)I could use as guidance.

Yours sincerely
Alireza


Seyed Alireza Ahmadi , M.Sc. Student
Systems, Control and Robotics Program
School of Electrical Engineering
KTH - Royal Institute of Technology
Stockholm, Sweden
Phone: +46 (0) 737401098
email: saahm...@kth.se

___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

[Tinyos-help] ADC resource sharing problem

2011-05-13 Thread Arena Marco
Dear All,
I'm trying to simultaneously support 2 sensors on a single shimmer mote. I want 
to individually access the 2 sensors (e.g. sampling at different times) and I'm 
are trying to use TinyOS Resource interface to share the ADC but I'm dealing 
with some problems: it seems that the ADC is correctly configured but I'm not 
signaled by the ADC correctly. It is like ADC.dataReady (I use interface 
Msp430Adc12MultiChannel as ADC) is getting signalled to each driver every time 
the ADC is sampled but sampling the two sensor with a different rate, instead 
of receiving a dataReady event for each sensor at the shortest sampling time I 
have the opposite behaviour. It looks like resource arbiter doesn't work (it 
seems that the Resource.release event is not called at the right moment), do 
you have any suggestion?
==
Here is the code of one of the two sensor, the other one is similar:
configuration HilAccSensorC
{
  provides interface Sensor;
}
implementation
{
  components MainC, Mma7260P;
  components new Msp430Adc12ClientAutoRVGC() as ADC;
  components HilAccSensorP, SensorsRegistryC;
  //---
 components LedsC;
 //--
  ADC.AdcConfigure -> HilAccSensorP;
  HilAccSensorP.Resource -> ADC.Resource;
  HilAccSensorP.ADC -> ADC;
  MainC.SoftwareInit -> Mma7260P.Init;
  MainC.SoftwareInit -> HilAccSensorP.Init;
  //--
 HilAccSensorP.Leds -> LedsC;
 //--
  HilAccSensorP.Boot -> MainC;
  Sensor = HilAccSensorP;
  HilAccSensorP.Mma7260 -> Mma7260P;
  HilAccSensorP.SensorsRegistry -> SensorsRegistryC;
}
-
#include "Msp430Adc12.h"
#include "Mma7260.h"
module HilAccSensorP {
  provides interface AdcConfigure;
  provides interface Init;
  provides interface Sensor;
  uses interface Mma7260;
  uses interface Boot;
  uses interface SensorsRegistry;
  uses interface Msp430Adc12MultiChannel as ADC;
  uses interface Resource;
  //--
  uses interface Leds;
  //--
}
implementation {
uint16_t accData[3],dbuff[3];
uint8_t blinky = 0;
uint8_t valueTypesList[3] = { CH_1, CH_2, CH_3 };
uint8_t acquireTypesList[1] = { ALL };
 uint8_t enableADC;

  const msp430adc12_channel_config_t config = {
  inch: INPUT_CHANNEL_A3,
  sref: REFERENCE_VREFplus_AVss,
  ref2_5v: REFVOLT_LEVEL_2_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
  };
  adc12memctl_t memctl[2] = {
   { INPUT_CHANNEL_A4, REFVOLT_LEVEL_2_5, 0},
   { INPUT_CHANNEL_A5, REFVOLT_LEVEL_2_5, 1} };
  command error_t Init.init() {
return SUCCESS;
  }

event void Boot.booted() {
  call Mma7260.setSensitivity(RANGE_6_0G);

   // the driver self-registers to the sensor registry
   call SensorsRegistry.registerSensor(ACC_SENSOR);
   atomic {
enableADC = 0;
  }
   }
async command const msp430adc12_channel_config_t* 
AdcConfigure.getConfiguration()
{
  return &config;
}
event void Resource.granted() {
  call ADC.configure(&config,memctl,2,dbuff,3,0);
}
command uint8_t Sensor.getSignificantBits() {
  return 12;
}
task void dataReady() {
  signal Sensor.acquisitionDone(SUCCESS, acquireTypesList[0]);
   call Leds.led0Toggle();
   call Resource.release();
}

command error_t Sensor.acquireData(enum AcquireTypes acquireType) {
  call Leds.led1Toggle();
   if (acquireType != acquireTypesList[0])
 return FAIL;
   atomic {
  enableADC = 1;
   }
   call Resource.request();
  return call ADC.getData();
}
async event void ADC.dataReady(uint16_t *data,uint16_t numSamples) {
  if(enableADC == 1)
   {
atomic {
   enableADC = 0;

   if (numSamples > 3)
 numSamples = 3;
   memcpy(accData, data, sizeof(*data)*numSamples);
}
post dataReady();
   }
 }

command uint16_t Sensor.getValue(enum ValueTypes valueType) {
   switch (valueType) {
  case CH_1 : return accData[0];
  case CH_2 : return accData[1];
  case CH_3 : return accData[2];
  default : return 0x;
}
}
command void Sensor.getAllValues(uint16_t* buffer, uint8_t* valuesNr) {
   *valuesNr = sizeof valueTypesList;
   atomic {
   memcpy(buffer, accData, sizeof(*accData)*3);
  }
}
command enum SensorCode Sensor.getSensorCode() {
  return ACC_SENSOR;
}
command uint16_t Sensor.getSensorID() {
  return 0x2249; // the ID has been randomly choosen
}
command uint8_t* Sensor.getValueTypesList(uint8_t* valuesTypeNr) {
  *valuesTypeNr = sizeof valueTypesList;
  return valueTypesList;
}
command uint8_t* Sensor.getAcquireTypesList(uint8_t* acquireTypesNr) {
  *acquireTypesNr = sizeof acquireTypesList;
  return acquireTypesList;
}
}

___
Tinyos-help mailing lis

[Tinyos-help] ADC for the TOSSIM

2011-10-11 Thread Indtiny s
Hi,
Is there any ADC sample code for the TOSSIM,. I want to read ADC random
values and send to the destination .

regards
Indu
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] ADC switch channel

2006-10-11 Thread Jan Hauer

Hi Andrea,

what you want to do is possible with the msp430 ADC12, but it has not
been implemented, neither in TinyOS 1.x nor 2.x. With the current
implementation/interfaces you can only sample *the same* channel with
one command (that's why in TinyOS 2.x it is called
"Msp430Adc12SingleChannel"). Changing the implementation to work with
multiple channels should not be much effort. It has not been done yet,
mainly because we have not thought about a proper interface definition
- e.g. you could to pass an array of [channel, reference voltage] and
a length parameter to bind() (in TinyOS 1.x). I have always planned to
implement it (probably first in 2.x), but I'm not sure when I'll do it
- I try to find some time (not so many people seem to need this
functionality?).

Jan

On 9/26/06, lamiaimeil <[EMAIL PROTECTED]> wrote:

Hi all,
I have a 3-axis accelerometer mount on tmote sky.
Every axis (x,y and z) is connected with a different
pin of the expansion connector and I want to sample a
channel and switch to the next (from x to y and from y
to z) cyclical. I must do it at 6000Hz but I see that
the ADC time for switch from a channel to another is
10ms(!) so I can go at maximum rate of 100Hz.. I can't
believe that an ADC that can sample at 200KHz take
10ms for switching on channels.. How can I do to
improve this frequency?
I try to look on MSP430 user guide and I see there is
a register called ADC12MCTLx (ADC12 Conversion Memory
Control Registers) where I can switch the input
channel setting INCHx. Do this mean I must use
assembly code? If yes, how can I do this?
Thanks in advance.
Andrea.

__
Do You Yahoo!?
Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto 
spazio gratuito per i tuoi file e i messaggi
http://mail.yahoo.it
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


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


Re: [Tinyos-help] ADC switch channel

2006-10-11 Thread R. Steve McKown
Hi Jan,
(and those looking for multi-channel ADC)

On Wednesday 11 October 2006 07:14 am, Jan Hauer wrote:
> what you want to do is possible with the msp430 ADC12, but it has not
> been implemented, neither in TinyOS 1.x nor 2.x.

I've been meaning to clean up a modification of the msp430 adc12 peripheral I 
put together to support sequence of channels and repeating sequence of 
channels, as covered in the msp430 family user guide.  The code is compatible 
with tinyos-2.x CVS devel branch from 2006-09-26 but doesn't implement the 
newer FastClient interface.

This code works well but is lightly used.  It's being used to sample a 3-axis 
accelerometer at 30kSa/sec (10kSa/sec * 3 channels) as well as low-frequency 
sampling of a group of ADC inputs using 'standard' ADC interfaces (Read, 
ReadNow, ReadStream).

The code changes the adc12 interface (Msp430Adc12.nc) and the configuration 
structure (msp430adc12_channel_config_t).  The former change is mostly hidden 
by updated adc client components; the latter change requires user code to 
update its component(s) containing configuration structure(s).

I've included some Makefile snippets to show how to use this code without 
altering your /opt/tinyos-2.x tree, and some code snippets to show how it 
works.

I've been meaning to open a dialog with you about how I could contribute to 
enhancing the standard peripheral code.  I would appreciate your thoughts.

For those looking for multi-sequence conversions, this code should be workable 
for you in the mean time.  Please note this code is not likely to be plug and 
play for you, so I'd avoid it unless you are ready to dig in and tweak it to 
fit your version of TinyOS.  It shouldn't be too difficult.

All the best
Steve


msp430sequence.tgz
Description: application/tgz
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] ADC switch channel

2006-10-11 Thread Jan Hauer

On 10/11/06, R. Steve McKown <[EMAIL PROTECTED]> wrote:

Hi Jan,
(and those looking for multi-channel ADC)

On Wednesday 11 October 2006 07:14 am, Jan Hauer wrote:
> what you want to do is possible with the msp430 ADC12, but it has not
> been implemented, neither in TinyOS 1.x nor 2.x.

I've been meaning to clean up a modification of the msp430 adc12 peripheral I
put together to support sequence of channels and repeating sequence of
channels, as covered in the msp430 family user guide.  The code is compatible
with tinyos-2.x CVS devel branch from 2006-09-26 but doesn't implement the
newer FastClient interface.

This code works well but is lightly used.  It's being used to sample a 3-axis
accelerometer at 30kSa/sec (10kSa/sec * 3 channels) as well as low-frequency
sampling of a group of ADC inputs using 'standard' ADC interfaces (Read,
ReadNow, ReadStream).

The code changes the adc12 interface (Msp430Adc12.nc) and the configuration
structure (msp430adc12_channel_config_t).  The former change is mostly hidden
by updated adc client components; the latter change requires user code to
update its component(s) containing configuration structure(s).

I've included some Makefile snippets to show how to use this code without
altering your /opt/tinyos-2.x tree, and some code snippets to show how it
works.

I've been meaning to open a dialog with you about how I could contribute to
enhancing the standard peripheral code.  I would appreciate your thoughts.

For those looking for multi-sequence conversions, this code should be workable
for you in the mean time.  Please note this code is not likely to be plug and
play for you, so I'd avoid it unless you are ready to dig in and tweak it to
fit your version of TinyOS.  It shouldn't be too difficult.

All the best
Steve


I updated the msp430 ADC12 TinyOS 2.x code last Monday to include DMA
support and also did a couple of other changes (new HAL interface,
renaming, optimization...), so the code might not be compatible with
HEAD. TEP 101 is still not finalized, but I don't expect any major
changes to come. Since people seem interested in multi-channel
sampling, I'm going to check something in (hopefully) in the next few
days (for 2.x).

I have only glanced over your code, but my plan was to add a separate
interface Msp430Adc12MultipleChannel instead of extending the main
interface (this is the reason why the current interface is called
Msp430Adc12SingleChannel). I'm not sure about the union approach
(passing a pointer to a pointer is a litte contrary to traditional
TinyOS design patterns :)), but maybe I can integrate some of your
code in the new version - I have to check and will talk to you
(offline).

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


Re: [Tinyos-help] ADC-DMA help.

2005-10-25 Thread Michael Schippling

Wow, 1.3% error in your time sync...seems pretty good to me.
But I guess it's cumulative, eh?

I might suspect something causing you to miss a timer interrupt,
maybe the transmit task or something? You might try flashing the
LED on each sample and looking for a missing pulse with a logic
analyzer.

MS

Mike Deneen wrote:

Hello,

I have managed to implement the Vanderbilt Time Sync code along with 
ADC-DMA code with the intent of streaming 1khz adc samples to a base 
station.  I have the ADC set up to sample at 1khz and then switch 
buffers.  The full buffer is processed and sent out in a 128 byte packet.


Right now, experimenting with two, I have read the global time, started 
sampling, finished sampling, read the global time again.  With two motes 
taking 73 samples/buffer there is a finishing time difference of up to a 
millisecond.


Is the ADC really sampling at 1khz?  Is there a better way to align the 
motes?  How much drift is expected?  It is important for me to sample at 
the same time, mote to mote.


Thanks for any insight you can give.

-Mike




___
Tinyos-help mailing list
[EMAIL PROTECTED]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

___
Tinyos-help mailing list
[EMAIL PROTECTED]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC-DMA help.

2005-10-25 Thread Mike Deneen
Just had a breakthrough here.  We were using the SMCLK for sample
conversion.  We switched to ACLK and things tightened right
up.  We've managed to start sampling (typically...) within 1-2
ticks of the ACLK.

But to answer your question, yes, it is cumulative.  

;)

-MOn 10/25/05, Michael Schippling <[EMAIL PROTECTED]> wrote:
Wow, 1.3% error in your time sync...seems pretty good to me.But I guess it's cumulative, eh?I might suspect something causing you to miss a timer interrupt,maybe the transmit task or something? You might try flashing the
LED on each sample and looking for a missing pulse with a logicanalyzer.MSMike Deneen wrote:> Hello,>> I have managed to implement the Vanderbilt Time Sync code along with> ADC-DMA code with the intent of streaming 1khz adc samples to a base
> station.  I have the ADC set up to sample at 1khz and then switch> buffers.  The full buffer is processed and sent out in a 128 byte packet.>> Right now, experimenting with two, I have read the global time, started
> sampling, finished sampling, read the global time again.  With two motes> taking 73 samples/buffer there is a finishing time difference of up to a> millisecond.>> Is the ADC really sampling at 1khz?  Is there a better way to align the
> motes?  How much drift is expected?  It is important for me to sample at> the same time, mote to mote.>> Thanks for any insight you can give.>> -Mike>>> 
>> ___> Tinyos-help mailing list> [EMAIL PROTECTED]> 
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
___
Tinyos-help mailing list
[EMAIL PROTECTED]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC sampling rate

2006-01-25 Thread Michael Schippling

A few suggestions

I'm not entirely clear from your message if you understand that the
Timer.start() 'x' argument is the number of millisec to timeout.
Therefore 1 is the shortest and should give about 1khz sample rate
in your program. With a value of 4 you should see 250Hz which matches
your 120Hz non-aliased measurement pretty good.

But what is probably your problem is that you are sending one message
per sample, and you are never going to get to 1000 msgs/sec...I don't
know about the Tmote, but I just measured the micaz at about 100/sec
in the best of all possible worlds. You should collect a number of
readings before sending them off and use alternating buffers, like
the Oscilloscope demo app.

Even with that I'm not sure you can maintain a solid sample rate
because the message send will take some time...hopefully most of
it will be in short interrupts to reload the send register. You'll
just have to see how much timing jitter your data can stand.

What is the useful upper freq limit on an ECG anyway (I assume we
are talking about Cardio-grams)? Since you're only talking one ADC
I guess it's a single electrode, so phase relationships are not of
interest...do you really need to go over 100Hz?

MS



Alexandros Karagiannis wrote:

Hello,

I'm novice in this field so I have to apologize in advance if any of the 
questions following seem to be not adnanced.
I use Tmote sky and my primary target is to trasmit a ECG to a WSN and 
receive it to a host in order to process it with matlab.I read tutorials 
and any other helping stuff and I found an application report including 
sample code which I tried to modify in order to fit my needs. I haven't 
actually connected the ECG output to the appropriate pin of the Tmote 
sky (Analog Input 0 ADC0 pin 3 from Tmote sky datasheet) and at  the 
first tests i use a sinus input of variable frequency.


The problem is that for low frequencies (5 - 10Hz)  to approximately 
120-160Hz i get a signal in matlab which i believe is satisfactory but 
when i set the Timer.start( TIMER_REPEAT, x) where x is the value i 
modify in order to set the sapling rate, i get a signal that is 
distorted even if the input sinus is much lower in frequency.
I thought that the x value in Timer.start( TIMER_REPEAT, x) sets the 
sampling rate of ADC because in the body of Timer.start( TIMER_REPEAT,x) 
i check if data have been set and i call the getData() to take the next 
sample. I have to stress that x is higher than 1ms which i believe is 
the higher sampling rate (1KHz). Of course i 've read that i can set the 
sampling rate even higher but i don't know the way to do it. I assume 
that when i set the sapling rate in higher frequencies, there must be 
simultaneous events fired that overwrite data queued to be sent. This 
doesn't happen in lower frequencies. But i have to know if this x value 
actually sets the sapling rate. Another strange thing i noticed is that 
when i set the x value and connect to the appropriate input pin a signal 
of the same frequency, i get a perfect signal plotted in matlab. This is 
strange beacause in my mind i thought i violated the sampling theorem.


Another thing i'd like to know is the time between the sampling and the 
signal transmission from the mote.I don't have a clue about it.


Is it possible data to be overwritten by another sampling task and to 
lose data before transmitting them?


I read in this forum that enabling DMA is very helpful. Is it to avoid 
data losses and fast transmission to the RF part? How can i do it ?


I've tested a code that counts Timer.fired events and SendMsg.sendDone 
and set the absolute value of the subtraction of the two counters to the 
data field in ADC.dataReady. After testing different sampling rates i 
noticed that for low sampling rates this value is constant.For sampling 
rates above 160-170Hz this value was constantly rising.


The code i run is

 *EcgSenseM.nc*

includes IntMsg;

module EcgSenseM
{
  provides interface StdControl;
  uses interface Timer;
  uses interface SendMsg;
  uses interface Leds;
  uses interface ADC;
  uses interface ADCControl;
}
implementation
{
  TOS_Msg m_msg;
  int m_int;
  bool m_sending;
 
 


  command result_t StdControl.init()
  {
atomic m_int = 0;
m_sending = FALSE;
call Leds.init();
call Leds.redOn();
call ADCControl.init();
call ADCControl.bindPort( TOS_ADC_ADC0_PORT, 
TOSH_ACTUAL_ADC_ADC0_PORT );

return SUCCESS;
  }

  command result_t StdControl.start()
  {
call Timer.start( TIMER_REPEAT, 4);
call ADC.getData();
return SUCCESS;
  }

  command result_t StdControl.stop()
  {
return SUCCESS;
  }

  event result_t Timer.fired()
  {
if( m_sending == FALSE )
{
  int n;
  IntMsg* body = (IntMsg*)m_msg.data;
  atomic n = m_int;
  body->val = n;
  body->src = TOS_LOCAL_ADDRESS;
  if( call SendMsg.send( TOS_BCAST_ADDR, sizeof(IntMsg), &m_msg ) == 
SUCCESS )

  {
m_sending = TRUE;
//call 

Re: [Tinyos-help] ADC sampling rate

2006-01-26 Thread Alexandros Karagiannis




Hello and thank you for the reply,

My previous post was a little bit confusing and i have to apologize for
this. We suspected that there must be data overwrites before the RF and
from your reply we are certain that the "limited" capacity of sending
messages may be tha cause.

I meant that the 'x' argument of Timer.start(TIMER_REPEAT, x) sets
the timeout and because i call getData() in the body of
Timer.fired(...), in this way i have the sampling rate i want. 

The sampling rate for an ECG signal is approximately 200-300Hz
beacause the frequency range of an ECG signal is  0-100Hz. So we can
set the timeout constant to 4,or 3 or 2,or 1 ms in order to have a
sampling rate of ADC high enough.Testing for frequencies higher
than
40-60Hz signal input we got signal distorted even if we set the
timeout
interval to 4ms or lower values.

We have cosntructed an electrocardiogram circuit of 3 electrodes and we
get the output signal to a signle ADC pin.Do you know what is the maximum
supported sampling rate for ADC without using any other method to
increase the sampling rate?

Another
strange thing we noticed is that when we set the x value (thus define a
specific sampling rate) and connect to
the appropriate input pin a signal of the same frequency as the
sampling rate, we get a
perfect signal plotted in matlab. This is strange because we
thought we violated the sampling theorem.

Any ideas about enabling DMA? Do you think this could help in
this case? Is there any source where we could find sample codes and
help about DMA?




Michael Schippling wrote:
A few
suggestions
  
  
I'm not entirely clear from your message if you understand that the
  
Timer.start() 'x' argument is the number of millisec to timeout.
  
Therefore 1 is the shortest and should give about 1khz sample rate
  
in your program. With a value of 4 you should see 250Hz which matches
  
your 120Hz non-aliased measurement pretty good.
  
  
But what is probably your problem is that you are sending one message
  
per sample, and you are never going to get to 1000 msgs/sec...I don't
  
know about the Tmote, but I just measured the micaz at about 100/sec
  
in the best of all possible worlds. You should collect a number of
  
readings before sending them off and use alternating buffers, like
  
the Oscilloscope demo app.
  
  
Even with that I'm not sure you can maintain a solid sample rate
  
because the message send will take some time...hopefully most of
  
it will be in short interrupts to reload the send register. You'll
  
just have to see how much timing jitter your data can stand.
  
  
What is the useful upper freq limit on an ECG anyway (I assume we
  
are talking about Cardio-grams)? Since you're only talking one ADC
  
I guess it's a single electrode, so phase relationships are not of
  
interest...do you really need to go over 100Hz?
  
  
MS
  
  
  
  
Alexandros Karagiannis wrote:
  
  Hello,


I'm novice in this field so I have to apologize in advance if any of
the questions following seem to be not adnanced.

I use Tmote sky and my primary target is to trasmit a ECG to a WSN and
receive it to a host in order to process it with matlab.I read
tutorials and any other helping stuff and I found an application report
including sample code which I tried to modify in order to fit my needs.
I haven't actually connected the ECG output to the appropriate pin of
the Tmote sky (Analog Input 0 ADC0 pin 3 from Tmote sky datasheet) and
at  the first tests i use a sinus input of variable frequency.


The problem is that for low frequencies (5 - 10Hz)  to approximately
120-160Hz i get a signal in matlab which i believe is satisfactory but
when i set the Timer.start( TIMER_REPEAT, x) where x is the value i
modify in order to set the sapling rate, i get a signal that is
distorted even if the input sinus is much lower in frequency.

I thought that the x value in Timer.start( TIMER_REPEAT, x) sets the
sampling rate of ADC because in the body of Timer.start(
TIMER_REPEAT,x) i check if data have been set and i call the getData()
to take the next sample. I have to stress that x is higher than 1ms
which i believe is the higher sampling rate (1KHz). Of course i 've
read that i can set the sampling rate even higher but i don't know the
way to do it. I assume that when i set the sapling rate in higher
frequencies, there must be simultaneous events fired that overwrite
data queued to be sent. This doesn't happen in lower frequencies. But i
have to know if this x value actually sets the sapling rate. Another
strange thing i noticed is that when i set the x value and connect to
the appropriate input pin a signal of the same frequency, i get a
perfect signal plotted in matlab. This is strange beacause in my mind i
thought i violated the sampling theorem.


Another thing i'd like to know is the time between the sampling and the
signal transmission from the mote.I don't have a clue about it.


Is it possible data to be overw

Re: [Tinyos-help] ADC sampling rate

2006-01-26 Thread Michael Schippling

Not that I know dink about cardiology of course...but a heatbeat is
about 180/min (3/sec) at fastest unless you're in defib or something.
So a sample rate of 100/sec gives you at least 16 harmonics of the
original. Also the 3 electrodes are spaced around the chest so you
get overlapping phases of the pulse?

I guess I should go talk to my doctor...

Anyway...assuming the tmote has about the same xmit rate as micaz,
you were probably getting less than 100 samples/sec at your receiver
and this works out to a 'clean' 50Hz signal, which is right on the
money in your 40-60hz measurement.

Of course my mathematics, statistics, and lies may be indistinguishable.

For the x=signal problem, my only suggestion is...did you actually
measure the frequency of the received signal? Unless you had _exactly_
the same signal freq as sample rate you would see some kind of alias
that {pre,pro}cessed through the samples. What you might have seen is
a way-low harmonic of the nice high-freq sinewave. Also see my comment
in previous paragraph...

You would have to look at the spec sheet for the controller to see how
fast the ADC can go. On the mica's the absolute minimum is 13 clock ticks,
or 25 if you constantly switch it on and off like the standard ADC code...
Of course if you are using the regular Timer to run it, the minimum is 1ms,
because that's the Timer's resolution. There is some example code for
doing High Speed Sampling to capture audio, someplace, I think.

I don't know about DMA. That sounds like something that no decent
micro-Controller should have intercourse with. Assuming you are trying
to run continuously, your system is limited by the message rate. DMA
would run way fast if you were capturing and storing a buffer, but
you still have to keep transmitting the data.

good luck with it
MS

Alexandros Karagiannis wrote:

  Hello and thank you for the reply,

My previous post was a little bit confusing and i have to apologize for 
this. We suspected that there must be data overwrites before the RF and 
from your reply we are certain that the "limited" capacity of sending 
messages may be tha cause.


I meant that the 'x' argument of Timer.start(TIMER_REPEAT, *x) *sets the 
timeout and because i call getData() in the body of Timer.fired(...), in 
this way i have the sampling rate i want.


The sampling rate for an ECG signal is approximately 200-300Hz beacause 
the frequency range of an ECG signal is  0-100Hz. So we can set the 
timeout constant to 4,or 3 or 2,or 1 ms in order to have a sampling rate 
of ADC high enough.Testing for frequencies *higher than 40-60Hz* signal 
input we got *signal distorted even if we set the timeout interval to 
4ms or lower values*.


We have cosntructed an electrocardiogram circuit of 3 electrodes and we 
get the output signal to a signle ADC pin.Do you know what is the 
*maximum supported sampling rate for ADC* without using any other method 
to increase the sampling rate?


Another strange thing we noticed is that when we set the x value (thus 
define a specific sampling rate) and connect to the appropriate input 
pin a signal o*f the same frequency* as the sampling rate, we *get a 
perfect signal plotted in matlab*. This is strange because we thought we 
violated the sampling theorem.


**Any ideas about enabling DMA? Do you think this could help in this 
case? Is there any source where we could find sample codes and help 
about DMA?





Michael Schippling wrote:


A few suggestions

I'm not entirely clear from your message if you understand that the
Timer.start() 'x' argument is the number of millisec to timeout.
Therefore 1 is the shortest and should give about 1khz sample rate
in your program. With a value of 4 you should see 250Hz which matches
your 120Hz non-aliased measurement pretty good.

But what is probably your problem is that you are sending one message
per sample, and you are never going to get to 1000 msgs/sec...I don't
know about the Tmote, but I just measured the micaz at about 100/sec
in the best of all possible worlds. You should collect a number of
readings before sending them off and use alternating buffers, like
the Oscilloscope demo app.

Even with that I'm not sure you can maintain a solid sample rate
because the message send will take some time...hopefully most of
it will be in short interrupts to reload the send register. You'll
just have to see how much timing jitter your data can stand.

What is the useful upper freq limit on an ECG anyway (I assume we
are talking about Cardio-grams)? Since you're only talking one ADC
I guess it's a single electrode, so phase relationships are not of
interest...do you really need to go over 100Hz?

MS



Alexandros Karagiannis wrote:


Hello,

I'm novice in this field so I have to apologize in advance if any of 
the questions following seem to be not adnanced.
I use Tmote sky and my primary target is to trasmit a ECG to a WSN 
and receive it to a host in order to process it with matlab.I read 
tutorials and any othe

Re: [Tinyos-help] ADC sampling rate

2006-01-26 Thread Joe Polastre
> I don't know about DMA. That sounds like something that no decent
> micro-Controller should have intercourse with.

To educate you on the benefits of DMA controllers, I suggest the
following references:

Operating System Concepts
by Abraham Silberschatz, Peter Baer Galvin, Greg Gagne

CC2430 DMA, see section 13.2 for all the benefits
http://www.chipcon.com/files/CC2430_Data_Sheet_1_02.pdf

EM250 DMA, see section 4.3 for the benefits when processing packets
http://www.ember.com/downloads/pdfs/EM250_Datasheet_v3.pdf

Very cool DMA filter that cannot be achieved at the same sampling
rates without DMA
http://focus.ti.com/lit/an/slaa228/slaa228.pdf?AP-DigitalFIRFilterDesignUsingtheMSP430F16x

TI won an award for including DMA on their chips
http://focus.ti.com/docs/pr/pressrelease.jhtml?prelId=sc04168

Microcontrollers without DMA is so 1990s technology.  Step up.

-Joe

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


Re: [Tinyos-help] ADC sampling rate

2006-01-26 Thread Michael Schippling

I guess we're in for another round of macro-controller expansion...
The memory pager on my PIC blew up when I tried to solve the traveling
salesman problem in N dimensions...4004 redux.

thanks for the other pointers
MS


Joe Polastre wrote:

I don't know about DMA. That sounds like something that no decent
micro-Controller should have intercourse with.


Microcontrollers without DMA is so 1990s technology.  Step up.

-Joe

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


Re: [Tinyos-help] Adc module compiler warnings

2007-08-24 Thread John Griessen

John Griessen wrote:

I found a missing wiring to autoRVG module and got a compile
of my Adc mux sensorboard modules.

Are these compiler warnings needing investigation?


I figured out they are about lacking return of SUCCESS or FAIL is all.

Nevermind.

John Griessen

--
Ecosensory
tinyOS devel on:  ubuntu Linux;   tinyOS v2.0.2;   telosb ecosens1
___
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC free run mode

2010-05-26 Thread Miklos Maroti
Hi Omar,

This library modifies the default ReadStream implementation on the
atmega128 MCU to use in free running mode.

http://szte-wsn.cvs.sourceforge.net/viewvc/szte-wsn/tinyos/tos/lib/Atm128FastAdc/

In the same repository you will see a sound recorder MicReadStreamTest
application that uses this module to record sound at 17 khz and stream
it to the base station (you will need a fast basestation).

Best,
Miklos



On Wed, May 19, 2010 at 4:24 PM, Omar Bouzid  wrote:
> Hi all,
> I want to know how can I use the ADC free run mode in tinyos-2.x using Micaz 
> to sample continuously the mts310 microphone sensor? Or how can I modify 
> DetectorC code in the soundlocalizer application so that it saves the data 
> sampled in a buffer rather doing threshold test?
>
> Your help is highly appreciated.
>
> Thanks,
> Omar
>
> ___
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>

___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC free run mode

2010-05-27 Thread Miklos Maroti
Hi Omar!

Here:

http://szte-wsn.cvs.sourceforge.net/viewvc/szte-wsn/tinyos/apps/MicReadStreamTest/

Miklos

On Thu, May 27, 2010 at 10:48 AM, Omar Bouzid
 wrote:
> Hi Miklos,
>
> Thanks a lot for your reply. I'll have a deep look on this library but I 
> cannot find the MicReadStreamTest
> Application that you have mentioned in this email. So, please let me know 
> where I can find it.
>
> Best regards,
> Omar
>
>>-Original Message-
>>From: mmar...@gmail.com [mailto:mmar...@gmail.com] On Behalf Of Miklos
>>Maroti
>>Sent: 26 May 2010 21:58
>>To: Omar Bouzid
>>Cc: tinyos-help@millennium.berkeley.edu
>>Subject: Re: [Tinyos-help] ADC free run mode
>>
>>Hi Omar,
>>
>>This library modifies the default ReadStream implementation on the
>>atmega128 MCU to use in free running mode.
>>
>>http://szte-wsn.cvs.sourceforge.net/viewvc/szte-
>>wsn/tinyos/tos/lib/Atm128FastAdc/
>>
>>In the same repository you will see a sound recorder MicReadStreamTest
>>application that uses this module to record sound at 17 khz and stream
>>it to the base station (you will need a fast basestation).
>>
>>Best,
>>Miklos
>>
>>
>>
>>On Wed, May 19, 2010 at 4:24 PM, Omar Bouzid
>> wrote:
>>> Hi all,
>>> I want to know how can I use the ADC free run mode in tinyos-2.x using
>>Micaz to sample continuously the mts310 microphone sensor? Or how can I
>>modify DetectorC code in the soundlocalizer application so that it saves
>>the data sampled in a buffer rather doing threshold test?
>>>
>>> Your help is highly appreciated.
>>>
>>> Thanks,
>>> Omar
>>>
>>> ___
>>> Tinyos-help mailing list
>>> Tinyos-help@millennium.berkeley.edu
>>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-
>>help
>>>
>
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC free run mode

2010-05-27 Thread Miklos Maroti
Hi Omar,

You should reduce the sampling rate considerably on the MicaZ. It
works on IRIS motes where the radio stack does not disable the
interrupts for more than 1-2 microseconds. No, there is no readme yet,
maybe we will put together a technical report on it.

Miklos

On Thu, May 27, 2010 at 1:47 PM, Omar Bouzid  wrote:
> Hi Miklos,
>
> Is there any README file that explains how to use these applications?, cause 
> I have downloaded them on the MICAZ with mts300 sensor board and I haven't 
> got any error while executing make command, but I got no response even the 
> leds didn't blink. I am not sure if I should change any setting in the 
> Makefile.
>
> I appreciate any help I advance.
>
> Thanks,
> Omar
>
>>-Original Message-
>>From: mmar...@gmail.com [mailto:mmar...@gmail.com] On Behalf Of Miklos
>>Maroti
>>Sent: 27 May 2010 10:04
>>To: Omar Bouzid
>>Cc: tinyos-help@millennium.berkeley.edu
>>Subject: Re: [Tinyos-help] ADC free run mode
>>
>>Hi Omar!
>>
>>Here:
>>
>>http://szte-wsn.cvs.sourceforge.net/viewvc/szte-
>>wsn/tinyos/apps/MicReadStreamTest/
>>
>>Miklos
>>
>>On Thu, May 27, 2010 at 10:48 AM, Omar Bouzid
>> wrote:
>>> Hi Miklos,
>>>
>>> Thanks a lot for your reply. I'll have a deep look on this library but
>>I cannot find the MicReadStreamTest
>>> Application that you have mentioned in this email. So, please let me
>>know where I can find it.
>>>
>>> Best regards,
>>> Omar
>>>
>>>>-Original Message-
>>>>From: mmar...@gmail.com [mailto:mmar...@gmail.com] On Behalf Of Miklos
>>>>Maroti
>>>>Sent: 26 May 2010 21:58
>>>>To: Omar Bouzid
>>>>Cc: tinyos-help@millennium.berkeley.edu
>>>>Subject: Re: [Tinyos-help] ADC free run mode
>>>>
>>>>Hi Omar,
>>>>
>>>>This library modifies the default ReadStream implementation on the
>>>>atmega128 MCU to use in free running mode.
>>>>
>>>>http://szte-wsn.cvs.sourceforge.net/viewvc/szte-
>>>>wsn/tinyos/tos/lib/Atm128FastAdc/
>>>>
>>>>In the same repository you will see a sound recorder MicReadStreamTest
>>>>application that uses this module to record sound at 17 khz and stream
>>>>it to the base station (you will need a fast basestation).
>>>>
>>>>Best,
>>>>Miklos
>>>>
>>>>
>>>>
>>>>On Wed, May 19, 2010 at 4:24 PM, Omar Bouzid
>>>> wrote:
>>>>> Hi all,
>>>>> I want to know how can I use the ADC free run mode in tinyos-2.x
>>using
>>>>Micaz to sample continuously the mts310 microphone sensor? Or how can
>>I
>>>>modify DetectorC code in the soundlocalizer application so that it
>>saves
>>>>the data sampled in a buffer rather doing threshold test?
>>>>>
>>>>> Your help is highly appreciated.
>>>>>
>>>>> Thanks,
>>>>> Omar
>>>>>
>>>>> ___
>>>>> Tinyos-help mailing list
>>>>> Tinyos-help@millennium.berkeley.edu
>>>>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-
>>>>help
>>>>>
>>>
>

___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC free run mode

2010-05-29 Thread Omar Bouzid
Hi Miklos,

Thanks a lot for your reply. I'll have a deep look on this library but I cannot 
find the MicReadStreamTest
Application that you have mentioned in this email. So, please let me know where 
I can find it.

Best regards,
Omar

>-Original Message-
>From: mmar...@gmail.com [mailto:mmar...@gmail.com] On Behalf Of Miklos
>Maroti
>Sent: 26 May 2010 21:58
>To: Omar Bouzid
>Cc: tinyos-help@millennium.berkeley.edu
>Subject: Re: [Tinyos-help] ADC free run mode
>
>Hi Omar,
>
>This library modifies the default ReadStream implementation on the
>atmega128 MCU to use in free running mode.
>
>http://szte-wsn.cvs.sourceforge.net/viewvc/szte-
>wsn/tinyos/tos/lib/Atm128FastAdc/
>
>In the same repository you will see a sound recorder MicReadStreamTest
>application that uses this module to record sound at 17 khz and stream
>it to the base station (you will need a fast basestation).
>
>Best,
>Miklos
>
>
>
>On Wed, May 19, 2010 at 4:24 PM, Omar Bouzid
> wrote:
>> Hi all,
>> I want to know how can I use the ADC free run mode in tinyos-2.x using
>Micaz to sample continuously the mts310 microphone sensor? Or how can I
>modify DetectorC code in the soundlocalizer application so that it saves
>the data sampled in a buffer rather doing threshold test?
>>
>> Your help is highly appreciated.
>>
>> Thanks,
>> Omar
>>
>> ___
>> Tinyos-help mailing list
>> Tinyos-help@millennium.berkeley.edu
>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-
>help
>>

___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC free run mode

2010-05-29 Thread Omar Bouzid
Hi Miklos,

Is there any README file that explains how to use these applications?, cause I 
have downloaded them on the MICAZ with mts300 sensor board and I haven't got 
any error while executing make command, but I got no response even the leds 
didn't blink. I am not sure if I should change any setting in the Makefile.

I appreciate any help I advance.

Thanks,
Omar

>-Original Message-
>From: mmar...@gmail.com [mailto:mmar...@gmail.com] On Behalf Of Miklos
>Maroti
>Sent: 27 May 2010 10:04
>To: Omar Bouzid
>Cc: tinyos-help@millennium.berkeley.edu
>Subject: Re: [Tinyos-help] ADC free run mode
>
>Hi Omar!
>
>Here:
>
>http://szte-wsn.cvs.sourceforge.net/viewvc/szte-
>wsn/tinyos/apps/MicReadStreamTest/
>
>Miklos
>
>On Thu, May 27, 2010 at 10:48 AM, Omar Bouzid
> wrote:
>> Hi Miklos,
>>
>> Thanks a lot for your reply. I'll have a deep look on this library but
>I cannot find the MicReadStreamTest
>> Application that you have mentioned in this email. So, please let me
>know where I can find it.
>>
>> Best regards,
>> Omar
>>
>>>-Original Message-
>>>From: mmar...@gmail.com [mailto:mmar...@gmail.com] On Behalf Of Miklos
>>>Maroti
>>>Sent: 26 May 2010 21:58
>>>To: Omar Bouzid
>>>Cc: tinyos-help@millennium.berkeley.edu
>>>Subject: Re: [Tinyos-help] ADC free run mode
>>>
>>>Hi Omar,
>>>
>>>This library modifies the default ReadStream implementation on the
>>>atmega128 MCU to use in free running mode.
>>>
>>>http://szte-wsn.cvs.sourceforge.net/viewvc/szte-
>>>wsn/tinyos/tos/lib/Atm128FastAdc/
>>>
>>>In the same repository you will see a sound recorder MicReadStreamTest
>>>application that uses this module to record sound at 17 khz and stream
>>>it to the base station (you will need a fast basestation).
>>>
>>>Best,
>>>Miklos
>>>
>>>
>>>
>>>On Wed, May 19, 2010 at 4:24 PM, Omar Bouzid
>>> wrote:
>>>> Hi all,
>>>> I want to know how can I use the ADC free run mode in tinyos-2.x
>using
>>>Micaz to sample continuously the mts310 microphone sensor? Or how can
>I
>>>modify DetectorC code in the soundlocalizer application so that it
>saves
>>>the data sampled in a buffer rather doing threshold test?
>>>>
>>>> Your help is highly appreciated.
>>>>
>>>> Thanks,
>>>> Omar
>>>>
>>>> ___
>>>> Tinyos-help mailing list
>>>> Tinyos-help@millennium.berkeley.edu
>>>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-
>>>help
>>>>
>>

___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC free run mode

2010-06-01 Thread Miklos Maroti
Hi Omar!

On Tue, Jun 1, 2010 at 1:25 PM, Omar Bouzid  wrote:
> Hi Miklos,
>
> Regarding the sampling rate I tried to implement the "SoundLocalizer" 
> application developed in Chapter 13 of "TinyOS Programming" on MICAZ with 
> MTS300 sensor board and it works fine. This application as it mentioned in 
> the book uses ADC free run mode and samples at a high frequency 
> (ATM128_ADC_PRESCALE_16). This might mean that there shouldn't be a problem 
> if we implement MicReadStreamTest application on MICAZ. Even that I tried to 
> reduce the sampling rate in this application but I still didn't receive any 
> response. Also, I tried to trace the execution of MicReadStreamTest 
> application it seems to be that the readDone is not signalled which makes the 
> rest of the code doesn't work properly. So, do you have any suggestion 
> regarding this problem? BTW should I leave two lines   CFLAGS += 
> -I$(SZTETOSDIR)/lib/Atm128FastAdc
>        CFLAGS += -I$(SZTETOSDIR)/lib/
> in Makefile without any change?

The SZTETOSDIR environment variable should point to a complete
download of the szte-wsn repository. As you can see our code uses the
Atm128FastAdc library, so that should be in your path, otherwise it
will use the old adc implementation which will not work.

Miklos

>
> Your help is highly appreciated.
> Thanks,
> Omar
>
>>-Original Message-
>>From: mmar...@gmail.com [mailto:mmar...@gmail.com] On Behalf Of Miklos
>>Maroti
>>Sent: 27 May 2010 13:22
>>To: Omar Bouzid
>>Cc: tinyos-help@millennium.berkeley.edu
>>Subject: Re: [Tinyos-help] ADC free run mode
>>
>>Hi Omar,
>>
>>You should reduce the sampling rate considerably on the MicaZ. It
>>works on IRIS motes where the radio stack does not disable the
>>interrupts for more than 1-2 microseconds. No, there is no readme yet,
>>maybe we will put together a technical report on it.
>>
>>Miklos
>>
>>On Thu, May 27, 2010 at 1:47 PM, Omar Bouzid
>> wrote:
>>> Hi Miklos,
>>>
>>> Is there any README file that explains how to use these applications?,
>>cause I have downloaded them on the MICAZ with mts300 sensor board and I
>>haven't got any error while executing make command, but I got no
>>response even the leds didn't blink. I am not sure if I should change
>>any setting in the Makefile.
>>>
>>> I appreciate any help I advance.
>>>
>>> Thanks,
>>> Omar
>>>
>>>>-Original Message-
>>>>From: mmar...@gmail.com [mailto:mmar...@gmail.com] On Behalf Of Miklos
>>>>Maroti
>>>>Sent: 27 May 2010 10:04
>>>>To: Omar Bouzid
>>>>Cc: tinyos-help@millennium.berkeley.edu
>>>>Subject: Re: [Tinyos-help] ADC free run mode
>>>>
>>>>Hi Omar!
>>>>
>>>>Here:
>>>>
>>>>http://szte-wsn.cvs.sourceforge.net/viewvc/szte-
>>>>wsn/tinyos/apps/MicReadStreamTest/
>>>>
>>>>Miklos
>>>>
>>>>On Thu, May 27, 2010 at 10:48 AM, Omar Bouzid
>>>> wrote:
>>>>> Hi Miklos,
>>>>>
>>>>> Thanks a lot for your reply. I'll have a deep look on this library
>>but
>>>>I cannot find the MicReadStreamTest
>>>>> Application that you have mentioned in this email. So, please let me
>>>>know where I can find it.
>>>>>
>>>>> Best regards,
>>>>> Omar
>>>>>
>>>>>>-Original Message-
>>>>>>From: mmar...@gmail.com [mailto:mmar...@gmail.com] On Behalf Of
>>Miklos
>>>>>>Maroti
>>>>>>Sent: 26 May 2010 21:58
>>>>>>To: Omar Bouzid
>>>>>>Cc: tinyos-help@millennium.berkeley.edu
>>>>>>Subject: Re: [Tinyos-help] ADC free run mode
>>>>>>
>>>>>>Hi Omar,
>>>>>>
>>>>>>This library modifies the default ReadStream implementation on the
>>>>>>atmega128 MCU to use in free running mode.
>>>>>>
>>>>>>http://szte-wsn.cvs.sourceforge.net/viewvc/szte-
>>>>>>wsn/tinyos/tos/lib/Atm128FastAdc/
>>>>>>
>>>>>>In the same repository you will see a sound recorder
>>MicReadStreamTest
>>>>>>application that uses this module to record sound at 17 khz and
>>stream
>>>>>>it to the base station (you will need a fast basestation).
>>>>>>
>>>>>>Best,
>>>>>>Miklos
>>>>>>
>>>>>>
>>>>>>
>>>>>>On Wed, May 19, 2010 at 4:24 PM, Omar Bouzid
>>>>>> wrote:
>>>>>>> Hi all,
>>>>>>> I want to know how can I use the ADC free run mode in tinyos-2.x
>>>>using
>>>>>>Micaz to sample continuously the mts310 microphone sensor? Or how
>>can
>>>>I
>>>>>>modify DetectorC code in the soundlocalizer application so that it
>>>>saves
>>>>>>the data sampled in a buffer rather doing threshold test?
>>>>>>>
>>>>>>> Your help is highly appreciated.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Omar
>>>>>>>
>>>>>>> ___
>>>>>>> Tinyos-help mailing list
>>>>>>> Tinyos-help@millennium.berkeley.edu
>>>>>>> https://www.millennium.berkeley.edu/cgi-
>>bin/mailman/listinfo/tinyos-
>>>>>>help
>>>>>>>
>>>>>
>>>
>

___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC Reading in MDA300CA

2010-07-20 Thread Michael Schippling
I'm not certain that read() is queue-able. You may need to
start a subsequent read() from the readDone() of the previous.
First try putting your led1 toggle in Sensor_7 done, because
(if they are not queueing) that one is probably the one that
actually executes. Also try doing just one read() and see
if you can get that to work.

MS

ps...your English is infinitely better than my Italian...

Francesco Ficarola wrote:
> Good evening.
> I'm Francesco Ficarola, an italian student (so sorry for my bad
> english) of the Computer Engeneering (II level degree) in "La
> Sapienza" University. I download MDA300CA driver by
> "tinyos-2.x-contrib/uoit/mda300ca" because I must do a thesis about
> this platform. My hardware is MIB520, Iris Mote XM2110CA and MDA300CA
> Sensor Board.
> I wrote my first application in nesC (TinyOS 2.1.1) to read the ADC
> values of the MDA300CA single channels, but certainly there is
> something wrong because the readDone event is never called. I know it
> because in this event I call Leds.led1Toggle() to debug it and it
> doesn't turn on. Can you help me, please? You can find my code in
> attached.
> 
> Thanks in advance for availability.
> 
> Greetings,
> Francesco Ficarola
> 
> 
> 
> 
> ___
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC Reading in MDA300CA

2010-07-20 Thread Francesco Ficarola
Michael Schippling ha scritto:
> I'm not certain that read() is queue-able. You may need to
> start a subsequent read() from the readDone() of the previous.
> First try putting your led1 toggle in Sensor_7 done, because
> (if they are not queueing) that one is probably the one that
> actually executes. Also try doing just one read() and see
> if you can get that to work.
> 
> MS

First thank you very much for your reply. I had already tried to make
the application with a single channel (so with a single read call and a
single readDone event), but nothing has changed: the event readDone is
never called and the led doesn't turn on. Now, as you suggested, I tried
also to move the call led1Toggle() in the readDone of the Sensor_7;
unfortunately I have not been successful. Any other ideas?

Thanks again.

Francesco Ficarola
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC Reading in MDA300CA

2010-07-20 Thread Francesco Ficarola
Michael Schippling ha scritto:
> ps...your English is infinitely better than my Italian...

Ops, I had not noticed it, hehe, thank you! :) But I want certainly
improve it as much as possible. ;)

Have a nice day,
-- 
Francesco Ficarola 
Presidente LUG-PV (http://lugpv.netsons.org)
Mailing List: lugpv_at_lists.linux_dot_it

[GPG KeyID: 0xDBA99D92]
http://lugpv.netsons.org/gpgkeys/francesco_ficarola.asc

Il nuovo modo di fare ricerca: www.tradoogle.it



signature.asc
Description: OpenPGP digital signature
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] ADC Reading in MDA300CA

2010-07-21 Thread Michael Schippling
I haven't used that interface so I don't know...
Moving the led call was just to see if only the last
conversion was happening, which apparently it isn't...

See if you can find an example in the existing code.
Start with a single channel. Perhaps there is an init()
or start() that needs to be done first?

MS

Francesco Ficarola wrote:
> Michael Schippling ha scritto:
>> I'm not certain that read() is queue-able. You may need to
>> start a subsequent read() from the readDone() of the previous.
>> First try putting your led1 toggle in Sensor_7 done, because
>> (if they are not queueing) that one is probably the one that
>> actually executes. Also try doing just one read() and see
>> if you can get that to work.
>>
>> MS
> 
> First thank you very much for your reply. I had already tried to make
> the application with a single channel (so with a single read call and a
> single readDone event), but nothing has changed: the event readDone is
> never called and the led doesn't turn on. Now, as you suggested, I tried
> also to move the call led1Toggle() in the readDone of the Sensor_7;
> unfortunately I have not been successful. Any other ideas?
> 
> Thanks again.
> 
> Francesco Ficarola
> ___
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC Reading in MDA300CA

2010-07-21 Thread Francesco Ficarola
Michael Schippling ha scritto:
> I haven't used that interface so I don't know...
> Moving the led call was just to see if only the last
> conversion was happening, which apparently it isn't...

Ah ok... don't worry.

> See if you can find an example in the existing code.
> Start with a single channel. Perhaps there is an init()
> or start() that needs to be done first?
> 
> MS

Unfortunately there is no example on the internet, or I didn't find it.
The Readme.doc (in tinyos-2.x-contrib/uoit/) shows how to use this
driver and so I did it. I used only interface Boot and so the booted
event. How can I implement the init()?

-- 
Francesco Ficarola 
Presidente LUG-PV (http://lugpv.netsons.org)
Mailing List: lugpv_at_lists.linux_dot_it

[GPG KeyID: 0xDBA99D92]
http://lugpv.netsons.org/gpgkeys/francesco_ficarola.asc

Il nuovo modo di fare ricerca: www.tradoogle.it



signature.asc
Description: OpenPGP digital signature
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

[Tinyos-help] ADC characteristics in MICA2 board

2008-07-10 Thread Rafael Aguilar Velez
Dear all,

 

Does someone know the characteristics of the ADCs in the MICA2 board? I mean 
the number of bits of its resolution?

Another question is that I am trying to vary the digitalization band in order 
to improve the resolution of the accelerometer readings, does someone knows how 
to do this?

 

Thank you very much for your answers and for your help, 

 

Rafael 

___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] ADC based off DigOutput

2008-07-31 Thread Eric Keller
When I'm trying to build this code under tinyos-2.0.2-2 for mica2 or
micaz, I get errors because of
on the i2c_flags_t declaration in I2CPacket in the tos/interfaces/I2CPacket.nc
Can someone point out where nesc is supposed to be picking up the definition
of that data type?
Thanks,
Eric


On Wed, Jul 30, 2008 at 11:51 AM, Charles Elliott
<[EMAIL PROTECTED]> wrote:
> Hi Chris
>
> I've been trying to get a ADC driver working based on your DigOutput code.
> I've attached my code.
>
> This is the error I get when I'm trying to compile:
>
> $ make mica2
> mkdir -p build/mica2
> compiling Test2AppC to a mica2 binary
> ncc -o build/mica2/main.exe  -Os -Wall -Wshadow -Wnesc-all -target=mica2
> -fnesc-
> cfile=build/mica2/app.c -board=micasb -DDEFINED_TOS_AM_GROUP=0x22
> -finline-limit
> =10 -DIDENT_APPNAME=\"Test2AppC\" -DIDENT_USERNAME=\"ani\"
> -DIDENT_HOSTNAME=
> \"DOAD06-89CD7F8F\" -DIDENT_USERHASH=0x9a391b60L
> -DIDENT_TIMESTAMP=0x48908a44L -
> DIDENT_UIDHASH=0x02b4a7f2L -fnesc-dump=wiring
> -fnesc-dump='interfaces(!abstract(
> ))' -fnesc-dump='referenced(interfacedefs, components)'
> -fnesc-dumpfile=build/mi
> ca2/wiring-check.xml Test2AppC.nc -lm
> Exception in thread "main"
> com.sun.org.apache.xerces.internal.impl.io.MalformedB
> yteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.
> at
> com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(Unk
> nown Source)
> at
> com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(Unknown So
> urce)
> at
> com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(Unknown
>  Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipChar(Unk
> nown Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
> l$FragmentContentDriver.next(Unknown Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(U
> nknown Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next
> (Unknown Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
> l.scanDocument(Unknown Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(U
> nknown Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(U
> nknown Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown So
> urce)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Un
> known Source)
> at net.tinyos.nesc.dump.NDReader.parse(NDReader.java:97)
> at net.tinyos.nesc.wiring.WiringCheck.main(WiringCheck.java:147)
> make: *** [exe0] Error 1
>
> I get the same error if I "make iris".
>
> Any ideas?
>
> Thanks
> Charles
>
> ___
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC Readings and VREF

2010-12-02 Thread Michael Schippling
Yes I believe the IRIS has 10 bit ADCs, so your formula is correct.

I don't know about the IRIS specifically, but in general the Vref
IS the VCC battery on these boards, so noodling around with software
settings will probably not make much difference. The one advantage
here is: if your sensor runs off the same batteries and is ratio-
metric (some kind of voltage divider) the ratio of Vref to sensor
will remain constant as Vcc changes.

Interesting about the different kind of batteries.
Are the Duracells fresh? Does the node's power usage vary,
say by using the radio or something?

MS


Francesco Ficarola wrote:
> Hi everybody.
> 
> I want to read ADC values by IRIS XM2110CA. I use a break-out board to
> access to the pins. The formula to convert the ADC value to the voltage is:
> 
> Voltage = VCC * ADC_VALUE / 1024
> 
> Right?
> 
> But... if VCC decreases as the batteries run down and so it has a
> dynamic value, how can i know the right voltage in the ADC channel? In
> the Atm128AdcConfig interface I tried to configure the getRefVoltage()
> command to:
> - ATM128_ADC_VREF_OFF
> - ATM128_ADC_VREF_AVCC
> - ATM128_ADC_VREF_2_56
> 
> Unfortunately nothing has changed, the ADC voltage always depends from VCC.
> 
> Moreover, I have a problem with some batteries. For example, with the
> Duracell batteries, the ADC readings are very fluctuating. Conversely,
> with the Brondi batteries or also with the Lab Power Supply, the ADC
> readings are constant. Why?
> 
> Greetings,
> 
> 
> 
> 
> ___
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC Readings and VREF

2010-12-02 Thread Francesco Ficarola
Michael Schippling ha scritto:
> Yes I believe the IRIS has 10 bit ADCs, so your formula is correct.
> 
> I don't know about the IRIS specifically, but in general the Vref
> IS the VCC battery on these boards, so noodling around with software
> settings will probably not make much difference. The one advantage
> here is: if your sensor runs off the same batteries and is ratio-
> metric (some kind of voltage divider) the ratio of Vref to sensor
> will remain constant as Vcc changes.

Ok, thanks a lot for your help. ;)

> Interesting about the different kind of batteries.
> Are the Duracells fresh? Does the node's power usage vary,
> say by using the radio or something?
> 
> MS

Yes, the Duracells are fresh. The voltage is 1.6V for each battery.
The node periodically reads ADC value by a circuit with a strain gauge
and when the current value is higher or lower than a certain threshold
the node sends a broadcast alert to other nodes of the network and then
it returns to sleeping state. I can not understand why this difference
between types of batteries. Have you any idea?

Greetings,
-- 
Francesco Ficarola 
[GPG KeyID: 0xDBA99D92]



signature.asc
Description: OpenPGP digital signature
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] ADC Readings and VREF

2010-12-02 Thread Urs Hunkeler
Hi Francesco,

You could measure the voltage of the batteries and use this value in 
your further calculations (I think VoltageC gives you the current voltage).

It might be possible that some batteries have a higher internal 
resistance than others. If your sensors draw a lot of power, this could 
lead to fluctuations in the supply voltage (which you would not have 
with good batteries or a lab power supply). If you have an oscilloscope, 
you could measure the voltage at the battery terminals while sampling 
your sensors. I'm not an expert on electronics (MS will know more about 
this), but maybe putting a huge capacity in parallel to the batteries 
might help.

Cheers,
Urs

On 12/2/10 7:11 PM, Francesco Ficarola wrote:
> Michael Schippling ha scritto:
>> Yes I believe the IRIS has 10 bit ADCs, so your formula is correct.
>>
>> I don't know about the IRIS specifically, but in general the Vref
>> IS the VCC battery on these boards, so noodling around with software
>> settings will probably not make much difference. The one advantage
>> here is: if your sensor runs off the same batteries and is ratio-
>> metric (some kind of voltage divider) the ratio of Vref to sensor
>> will remain constant as Vcc changes.
>
> Ok, thanks a lot for your help. ;)
>
>> Interesting about the different kind of batteries.
>> Are the Duracells fresh? Does the node's power usage vary,
>> say by using the radio or something?
>>
>> MS
>
> Yes, the Duracells are fresh. The voltage is 1.6V for each battery.
> The node periodically reads ADC value by a circuit with a strain gauge
> and when the current value is higher or lower than a certain threshold
> the node sends a broadcast alert to other nodes of the network and then
> it returns to sleeping state. I can not understand why this difference
> between types of batteries. Have you any idea?
>
> Greetings,
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC Readings and VREF

2010-12-02 Thread krisa
Hi!
About the different results with different batteries - my guess would
be, that the fluctuations arise because of differences in the rate at
which the batteries are able to release current (which is a
measurement less known than Ah or Voltage). It means, that while one
battery under load is still capable of providing the same Voltage, the
duracells might be discharging slower and under load capable of giving
less than normal Voltage. That is of course if the fluctuations are at
the time of some radio or other activity whic uses battery.
(Incidentally, that means that the Duracell will serve longer than the
other kind of battery, because it conserves power more, while the
other battery just floods more power to keep up the constant Voltage
under load)
At least that is my Guess :)

On Thu, Dec 2, 2010 at 8:11 PM, Francesco Ficarola
 wrote:
> Michael Schippling ha scritto:
>> Yes I believe the IRIS has 10 bit ADCs, so your formula is correct.
>>
>> I don't know about the IRIS specifically, but in general the Vref
>> IS the VCC battery on these boards, so noodling around with software
>> settings will probably not make much difference. The one advantage
>> here is: if your sensor runs off the same batteries and is ratio-
>> metric (some kind of voltage divider) the ratio of Vref to sensor
>> will remain constant as Vcc changes.
>
> Ok, thanks a lot for your help. ;)
>
>> Interesting about the different kind of batteries.
>> Are the Duracells fresh? Does the node's power usage vary,
>> say by using the radio or something?
>>
>> MS
>
> Yes, the Duracells are fresh. The voltage is 1.6V for each battery.
> The node periodically reads ADC value by a circuit with a strain gauge
> and when the current value is higher or lower than a certain threshold
> the node sends a broadcast alert to other nodes of the network and then
> it returns to sleeping state. I can not understand why this difference
> between types of batteries. Have you any idea?
>
> Greetings,
> --
> Francesco Ficarola 
> [GPG KeyID: 0xDBA99D92]
>
>
> ___
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>



-- 
--
Krišjānis Nesenbergs

___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] ADC Readings and VREF

2010-12-02 Thread Francesco Ficarola
Urs Hunkeler ha scritto:
> Hi Francesco,
> 
> You could measure the voltage of the batteries and use this value in
> your further calculations (I think VoltageC gives you the current voltage).

Ok, thank you for your tip! :) Tomorrow I'll try it!

> It might be possible that some batteries have a higher internal
> resistance than others. If your sensors draw a lot of power, this could
> lead to fluctuations in the supply voltage (which you would not have
> with good batteries or a lab power supply).

My sensor is a strain gauge (a resistor-like) in a Weathstone bridge
with an amp op to amplify the changes of strain gauge, so I think that
the power consumption is very low. In fact, when I measured the power
consumption (Brondi battery pack) with an oscilloscope (or multimeter),
in IDLE state it is ~ 0 mV (or 0 mA).

> If you have an oscilloscope,
> you could measure the voltage at the battery terminals while sampling
> your sensors. I'm not an expert on electronics (MS will know more about
> this), but maybe putting a huge capacity in parallel to the batteries
> might help.
> 
> Cheers,
> Urs

Next week, I will go back to the computer science department and I will
measure (with oscilloscope) the power consumption of node with Duracell
battery pack. Meanwhile thank you very much for your help. About the
huge capacity, what value do I choose?

Greetings,
-- 
Francesco Ficarola 
[GPG KeyID: 0xDBA99D92]



signature.asc
Description: OpenPGP digital signature
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] ADC Readings and VREF

2010-12-02 Thread Francesco Ficarola
krisa ha scritto:
> Hi!
> About the different results with different batteries - my guess would
> be, that the fluctuations arise because of differences in the rate at
> which the batteries are able to release current (which is a
> measurement less known than Ah or Voltage). It means, that while one
> battery under load is still capable of providing the same Voltage, the
> duracells might be discharging slower and under load capable of giving
> less than normal Voltage. That is of course if the fluctuations are at
> the time of some radio or other activity whic uses battery.
> (Incidentally, that means that the Duracell will serve longer than the
> other kind of battery, because it conserves power more, while the
> other battery just floods more power to keep up the constant Voltage
> under load)
> At least that is my Guess :)

Hi, thank you very much for your guess! :) It is very interesting. In
addition to Duracell, I also tried the Panasonic batteries, but the
result was the same. So far I got stable readings only with Brondi
batteries and with lab power supply. Unfortunately I always have to get
stable readings, with any brand of batteries. Do you think I can fix it
somehow?

Thanks,
-- 
Francesco Ficarola 
[GPG KeyID: 0xDBA99D92]



signature.asc
Description: OpenPGP digital signature
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] ADC Readings and VREF

2010-12-02 Thread Urs Hunkeler
Hi Francesco and Krisa,

A battery is usually modeled as a perfect voltage source in series with 
an internal resistor. (I hope the link works)

http://books.google.ch/books?id=bkOMDgwFA28C&lpg=PA9&ots=F2hgSHc2Pt&pg=PA9#v=onepage&q&f=false

When the load (power draw by the mote and the sensors) increases, the 
current over the internal resistor increases and the voltage drop over 
this internal resistor also increases. The internal resistor and the 
load together act as a voltage divider, which results in a drop in the 
apparent supply voltage. Different battery types have different behavior 
of the internal resistor. What I said in my previous mail is, as far as 
I understand, essentially the same thing as what Krisa says, just 
explained in a different way.

When you measure your setup in idle mode, there should be hardly any 
power consumption. I don't know how you connect your sensors, but 
personally I would expect your sensor to be powered only when you 
measure it, such that in idle mode it should not consume anything.

In any case, when the microcontroller is turned on (it is automatically 
turned off by TinyOS when not used), the mote will consume about 4mA 
even without reading sensors. That might or might not be a problem for 
your measurement setup.

Using a capacity (which has a much lower internal resistance) would 
result in the capacity to bridge over a short drop in supply voltage 
from the battery. The capacity would depend on how long your measurement 
takes, how much change in supply voltage you can tolerate (the capacity 
will also discharge during this time) and how much current your setup 
draws during the measurement. If you don't want to calculate anything 
(again, I'm not really the expert here), you could try with something as 
big as possible (>100uF, if possible, try to find something in the range 
of 1F).

The battery behavior could also be more complex than the simple voltage 
source and internal resistor model from above. It is possible that the 
battery voltage breaks down when under load, and then recovers again 
after a while (but not immediately) when the load is released. If you 
don't find any other solution, assuming that the battery will settle 
after a short while, and assuming that the measurements should be stable 
over a short while, you could repeat the measurements until they are 
stable, i.e., while(max deviation over last 3 measurements > threshold) 
repeat measurement. If the power source is stable (lab power supply, 
good batteries), you will only measure a few times, if the power supply 
is bad (bad batteries) you will measure a bit longer. To make sure you 
don't get in an infinite loop, you could also have an abort criterion. 
For instance, abort with an error if after 20 measurements the results 
are still not stable.

Cheers,
Urs


On 12/2/10 10:53 PM, Francesco Ficarola wrote:
> krisa ha scritto:
>> Hi!
>> About the different results with different batteries - my guess would
>> be, that the fluctuations arise because of differences in the rate at
>> which the batteries are able to release current (which is a
>> measurement less known than Ah or Voltage). It means, that while one
>> battery under load is still capable of providing the same Voltage, the
>> duracells might be discharging slower and under load capable of giving
>> less than normal Voltage. That is of course if the fluctuations are at
>> the time of some radio or other activity whic uses battery.
>> (Incidentally, that means that the Duracell will serve longer than the
>> other kind of battery, because it conserves power more, while the
>> other battery just floods more power to keep up the constant Voltage
>> under load)
>> At least that is my Guess :)
>
> Hi, thank you very much for your guess! :) It is very interesting. In
> addition to Duracell, I also tried the Panasonic batteries, but the
> result was the same. So far I got stable readings only with Brondi
> batteries and with lab power supply. Unfortunately I always have to get
> stable readings, with any brand of batteries. Do you think I can fix it
> somehow?
>
> Thanks,
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC Readings and VREF

2010-12-03 Thread Francesco Ficarola
Hi Urs,

> Hi Francesco and Krisa,
> 
> A battery is usually modeled as a perfect voltage source in series with
> an internal resistor. (I hope the link works)
> 
> http://books.google.ch/books?id=bkOMDgwFA28C&lpg=PA9&ots=F2hgSHc2Pt&pg=PA9#v=onepage&q&f=false
> 
> 
> When the load (power draw by the mote and the sensors) increases, the
> current over the internal resistor increases and the voltage drop over
> this internal resistor also increases. The internal resistor and the
> load together act as a voltage divider, which results in a drop in the
> apparent supply voltage. Different battery types have different behavior
> of the internal resistor. What I said in my previous mail is, as far as
> I understand, essentially the same thing as what Krisa says, just
> explained in a different way.

Thank you very much for your full explanation, I really appreciate it.

> When you measure your setup in idle mode, there should be hardly any
> power consumption. I don't know how you connect your sensors, but
> personally I would expect your sensor to be powered only when you
> measure it, such that in idle mode it should not consume anything.

For the measurements I connect my sensor in this way...

*** Multimeter ***
- terminal + of my lab power supply ---> terminal + of my mote
- terminal - of my mote ---> terminal + of my multimeter
- terminal - of my multimeter ---> terminal - of my lab power supply

Here a photo: http://img7.imageshack.us/img7/8440/dsc0563u.jpg
(In the photo the current "18.3 mA" shows the power consumption of the
transmission, Radio TX)


*** Oscilloscope ***
- terminal + of my lab power supply ---> terminal "1" of 10 Ohm resistor
- terminal "2" of 10 Ohm resistor ---> terminal + of my mote
- terminal - of my lab power supply ---> terminal - of my mote
- terminal + of the oscilloscope ---> terminal "1" of 10 Ohm resistor
- terminal - of the oscilloscope ---> terminal "2" of 10 Ohm resistor

Here a photo: http://img227.imageshack.us/img227/479/dsc0681g.jpg

The measurements work fine because when I measured the power consumption
of my MAC the signals respected the protocol policies.

For example: http://img84.imageshack.us/img84/9553/dsc0704705.jpg

In "a" figure there are the preambles during the TX, while in "b" figure
there is the wake-up interval. Probably the second small signal in "b"
figure is the power consumption of the MCU for the ADC process; it is
about 25 mV, that is 2.5 mA beacause the input resistor was 10 Ohm.

> In any case, when the microcontroller is turned on (it is automatically
> turned off by TinyOS when not used), the mote will consume about 4mA
> even without reading sensors. That might or might not be a problem for
> your measurement setup.
> 
> Using a capacity (which has a much lower internal resistance) would
> result in the capacity to bridge over a short drop in supply voltage
> from the battery. The capacity would depend on how long your measurement
> takes, how much change in supply voltage you can tolerate (the capacity
> will also discharge during this time) and how much current your setup
> draws during the measurement. If you don't want to calculate anything
> (again, I'm not really the expert here), you could try with something as
> big as possible (>100uF, if possible, try to find something in the range
> of 1F).

Ok, thanks a lot Hurs. I'll try with a 1F capacity and I'll get you some
news.

> The battery behavior could also be more complex than the simple voltage
> source and internal resistor model from above. It is possible that the
> battery voltage breaks down when under load, and then recovers again
> after a while (but not immediately) when the load is released. If you
> don't find any other solution, assuming that the battery will settle
> after a short while, and assuming that the measurements should be stable
> over a short while, you could repeat the measurements until they are
> stable, i.e., while(max deviation over last 3 measurements > threshold)
> repeat measurement. If the power source is stable (lab power supply,
> good batteries), you will only measure a few times, if the power supply
> is bad (bad batteries) you will measure a bit longer. To make sure you
> don't get in an infinite loop, you could also have an abort criterion.
> For instance, abort with an error if after 20 measurements the results
> are still not stable.

Maybe the intervals between the readings are too short (500 ms).
However, I tried to wait a lot (also one minute), but the fluctuations
remain. :(
What you say I also had with the Brondi batteries in the first readings
and I resolved it with an average of the first "n" readings to calculate
a "quiete value". Instead with the Duracell batteries, the fluctuations
are persistent.

Thanks again,
-- 
Francesco Ficarola 
[GPG KeyID: 0xDBA99D92]



signature.asc
Description: OpenPGP digital signature
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.mi

Re: [Tinyos-help] ADC Readings and VREF

2010-12-03 Thread Francesco Ficarola
Hi Vino,

Please open a new topic for your problem.

Have a nice day,
-- 
Francesco Ficarola 
[GPG KeyID: 0xDBA99D92]



vino bala ha scritto:
> hi'
>   i installed windowsxp in vmware player,in that i tried to simulate
> Blink application by using the command
>  
> *make micaz sim
> * 
> i'am getting the following error
> 
> 
> *make: ***[exe0] Error 1
> * 
> help me..
>  
> I tried this also set a pathlike 
>  
> * TOSROOT/support/make*
>  
> and i typed this command
>  
> *sim.extra*  it showing like this how can i fix this
>  
> OPTFLAGS: not found
>  LIB: not found
> PFLAGS: not found
> WFLAGS: not found
> PLATFORM: not found
> .
> .
> .
> .
> .
> .
> XML: not found
> DUMPTYPES: not found
> ./sim.exta: 26:syntaxerror: word unexpected (expecting ")")
>  
> i checked in that path *sim.extra* file is present
> how can i clear the above errors
>  
> help me
>  
>  
> Regards
>   Vino
> 
> On Fri, Dec 3, 2010 at 3:23 AM, Francesco Ficarola
> mailto:francesco.ficar...@gmail.com>> wrote:
> 
> krisa ha scritto:
> > Hi!
> > About the different results with different batteries - my guess would
> > be, that the fluctuations arise because of differences in the rate at
> > which the batteries are able to release current (which is a
> > measurement less known than Ah or Voltage). It means, that while one
> > battery under load is still capable of providing the same Voltage, the
> > duracells might be discharging slower and under load capable of giving
> > less than normal Voltage. That is of course if the fluctuations are at
> > the time of some radio or other activity whic uses battery.
> > (Incidentally, that means that the Duracell will serve longer than the
> > other kind of battery, because it conserves power more, while the
> > other battery just floods more power to keep up the constant Voltage
> > under load)
> > At least that is my Guess :)
> 
> Hi, thank you very much for your guess! :) It is very interesting. In
> addition to Duracell, I also tried the Panasonic batteries, but the
> result was the same. So far I got stable readings only with Brondi
> batteries and with lab power supply. Unfortunately I always have to get
> stable readings, with any brand of batteries. Do you think I can fix it
> somehow?
> 
> Thanks,
> --
> Francesco Ficarola 
> [GPG KeyID: 0xDBA99D92]
> 
> 
> ___
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> 
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> 
> 




signature.asc
Description: OpenPGP digital signature
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] ADC Readings and VREF

2010-12-03 Thread Urs Hunkeler
Hi Francesco,

Thanks for detailing your measurement setup. From the pictures I don't 
see any additional circuit for your sensors. Do you use an internal 
sensor? If not, do you have the problems when reading ADC values without 
anything connected and you expect it to be constant (since nothing is 
connected)? Just in case, I think the input value of the ADC signal is 
not determined if nothing is connected, and as such you might very well 
see some noise (no idea why different batteries would have a different 
influence on this).

How big is the noise you see?

Cheers,
Urs


On 12/03/2010 09:14 AM, Francesco Ficarola wrote:
> Hi Urs,
>
>> Hi Francesco and Krisa,
>>
>> A battery is usually modeled as a perfect voltage source in series with
>> an internal resistor. (I hope the link works)
>>
>> http://books.google.ch/books?id=bkOMDgwFA28C&lpg=PA9&ots=F2hgSHc2Pt&pg=PA9#v=onepage&q&f=false
>>
>>
>> When the load (power draw by the mote and the sensors) increases, the
>> current over the internal resistor increases and the voltage drop over
>> this internal resistor also increases. The internal resistor and the
>> load together act as a voltage divider, which results in a drop in the
>> apparent supply voltage. Different battery types have different behavior
>> of the internal resistor. What I said in my previous mail is, as far as
>> I understand, essentially the same thing as what Krisa says, just
>> explained in a different way.
>
> Thank you very much for your full explanation, I really appreciate it.
>
>> When you measure your setup in idle mode, there should be hardly any
>> power consumption. I don't know how you connect your sensors, but
>> personally I would expect your sensor to be powered only when you
>> measure it, such that in idle mode it should not consume anything.
>
> For the measurements I connect my sensor in this way...
>
> *** Multimeter ***
> - terminal + of my lab power supply --->  terminal + of my mote
> - terminal - of my mote --->  terminal + of my multimeter
> - terminal - of my multimeter --->  terminal - of my lab power supply
>
> Here a photo: http://img7.imageshack.us/img7/8440/dsc0563u.jpg
> (In the photo the current "18.3 mA" shows the power consumption of the
> transmission, Radio TX)
>
>
> *** Oscilloscope ***
> - terminal + of my lab power supply --->  terminal "1" of 10 Ohm resistor
> - terminal "2" of 10 Ohm resistor --->  terminal + of my mote
> - terminal - of my lab power supply --->  terminal - of my mote
> - terminal + of the oscilloscope --->  terminal "1" of 10 Ohm resistor
> - terminal - of the oscilloscope --->  terminal "2" of 10 Ohm resistor
>
> Here a photo: http://img227.imageshack.us/img227/479/dsc0681g.jpg
>
> The measurements work fine because when I measured the power consumption
> of my MAC the signals respected the protocol policies.
>
> For example: http://img84.imageshack.us/img84/9553/dsc0704705.jpg
>
> In "a" figure there are the preambles during the TX, while in "b" figure
> there is the wake-up interval. Probably the second small signal in "b"
> figure is the power consumption of the MCU for the ADC process; it is
> about 25 mV, that is 2.5 mA beacause the input resistor was 10 Ohm.
>
>> In any case, when the microcontroller is turned on (it is automatically
>> turned off by TinyOS when not used), the mote will consume about 4mA
>> even without reading sensors. That might or might not be a problem for
>> your measurement setup.
>>
>> Using a capacity (which has a much lower internal resistance) would
>> result in the capacity to bridge over a short drop in supply voltage
>> from the battery. The capacity would depend on how long your measurement
>> takes, how much change in supply voltage you can tolerate (the capacity
>> will also discharge during this time) and how much current your setup
>> draws during the measurement. If you don't want to calculate anything
>> (again, I'm not really the expert here), you could try with something as
>> big as possible (>100uF, if possible, try to find something in the range
>> of 1F).
>
> Ok, thanks a lot Hurs. I'll try with a 1F capacity and I'll get you some
> news.
>
>> The battery behavior could also be more complex than the simple voltage
>> source and internal resistor model from above. It is possible that the
>> battery voltage breaks down when under load, and then recovers again
>> after a while (but not immediately) when the load is released. If you
>> don't find any other solution, assuming that the battery will settle
>> after a short while, and assuming that the measurements should be stable
>> over a short while, you could repeat the measurements until they are
>> stable, i.e., while(max deviation over last 3 measurements>  threshold)
>> repeat measurement. If the power source is stable (lab power supply,
>> good batteries), you will only measure a few times, if the power supply
>> is bad (bad batteries) you will measure a bit longer. To make sure you
>> don't get in an infinite loop, you could 

Re: [Tinyos-help] ADC Readings and VREF

2010-12-03 Thread Francesco Ficarola
Urs Hunkeler ha scritto:
> Hi Francesco,
> 
> Thanks for detailing your measurement setup. From the pictures I don't
> see any additional circuit for your sensors. Do you use an internal
> sensor? If not, do you have the problems when reading ADC values without
> anything connected and you expect it to be constant (since nothing is
> connected)? Just in case, I think the input value of the ADC signal is
> not determined if nothing is connected, and as such you might very well
> see some noise (no idea why different batteries would have a different
> influence on this).
> 
> How big is the noise you see?
> 
> Cheers,
> Urs

Hi Urs.

Those photos are only examples and there is no sensor connected to show
the connections of the oscilloscope or multimeter. They show only the
configuration with the multimeter and with the oscilloscope for the
measurements. However the mote is connected to the circuit composed by
strain gauge, Weathstone bridge and Amp Op when I measured power
consumption.

Here two photos of the sensor node connected to the circuit:
http://img89.imageshack.us/img89/9756/dsc0752w.jpg
http://img262.imageshack.us/img262/7789/breakoutboardmontatamin.jpg

Greetings,
-- 
Francesco Ficarola 
[GPG KeyID: 0xDBA99D92]



signature.asc
Description: OpenPGP digital signature
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] ADC Readings and VREF

2010-12-03 Thread Urs Hunkeler
Hi Francesco,

The potentiometer (probably used as a voltage divider?) might amount for 
up to (3V / 450 Ohm =) ~6mA, not that much but it's already on the order 
of the power consumption of the microcontroller. If the total power 
consumption for sampling the sensors is around 10mA and the batteries 
have an internal resistance of approximately 3 Ohm, that might account 
for fluctuations of the supply voltage of up to 30mV. I don't know 
whether your noise is bigger than that. In any case you'll probably have 
to ask an electronic expert. If at your university or company you have a 
technician (one with a soldering iron) you might want to ask him. They 
often have surprising insights based on practical experience rather than 
theoretical knowledge.

Cheers,
Urs

>  Hi Urs.
>
>  Those photos are only examples and there is no sensor connected to
>  show the connections of the oscilloscope or multimeter. They show
>  only the configuration with the multimeter and with the oscilloscope
>  for the measurements. However the mote is connected to the circuit
>  composed by strain gauge, Weathstone bridge and Amp Op when I
>  measured power consumption.
>
>  Here two photos of the sensor node connected to the circuit:
>  http://img89.imageshack.us/img89/9756/dsc0752w.jpg
>  http://img262.imageshack.us/img262/7789/breakoutboardmontatamin.jpg
>
>  Greetings,


___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC Readings and VREF

2010-12-03 Thread Urs Hunkeler
Hi Francesco,

You could measure the voltage of the batteries and use this value in 
your further calculations (I think VoltageC gives you the current voltage).

It might be possible that some batteries have a higher internal 
resistance than others. If your sensors draw a lot of power, this could 
lead to fluctuations in the supply voltage (which you would not have 
with good batteries or a lab power supply). If you have an oscilloscope, 
you could measure the voltage at the battery terminals while sampling 
your sensors. I'm not an expert on electronics (MS will know more about 
this), but maybe putting a huge capacity in parallel to the batteries 
might help.

Cheers,
Urs

On 12/2/10 7:11 PM, Francesco Ficarola wrote:
> Michael Schippling ha scritto:
>> Yes I believe the IRIS has 10 bit ADCs, so your formula is correct.
>>
>> I don't know about the IRIS specifically, but in general the Vref
>> IS the VCC battery on these boards, so noodling around with software
>> settings will probably not make much difference. The one advantage
>> here is: if your sensor runs off the same batteries and is ratio-
>> metric (some kind of voltage divider) the ratio of Vref to sensor
>> will remain constant as Vcc changes.
>
> Ok, thanks a lot for your help. ;)
>
>> Interesting about the different kind of batteries.
>> Are the Duracells fresh? Does the node's power usage vary,
>> say by using the radio or something?
>>
>> MS
>
> Yes, the Duracells are fresh. The voltage is 1.6V for each battery.
> The node periodically reads ADC value by a circuit with a strain gauge
> and when the current value is higher or lower than a certain threshold
> the node sends a broadcast alert to other nodes of the network and then
> it returns to sleeping state. I can not understand why this difference
> between types of batteries. Have you any idea?
>
> Greetings,
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC Readings and VREF

2010-12-04 Thread Francesco Ficarola
Urs Hunkeler ha scritto:
> Hi Francesco,
> 
> The potentiometer (probably used as a voltage divider?) might amount for
> up to (3V / 450 Ohm =) ~6mA, not that much but it's already on the order
> of the power consumption of the microcontroller. If the total power
> consumption for sampling the sensors is around 10mA and the batteries
> have an internal resistance of approximately 3 Ohm, that might account
> for fluctuations of the supply voltage of up to 30mV. I don't know
> whether your noise is bigger than that. In any case you'll probably have
> to ask an electronic expert. If at your university or company you have a
> technician (one with a soldering iron) you might want to ask him. They
> often have surprising insights based on practical experience rather than
> theoretical knowledge.
> 
> Cheers,
> Urs

Ok, thank you very much Urs. Your posts have been precious for me. :)

I'll ask a professor! :)

Thanks again,
-- 
Francesco Ficarola 
[GPG KeyID: 0xDBA99D92]



signature.asc
Description: OpenPGP digital signature
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] ADC Readings and VREF

2010-12-04 Thread Francesco Ficarola
Urs, in the meantime I thought:

Since I use a weathstone bridge
(http://en.wikipedia.org/wiki/Wheatstone_bridge) with:
- R1 and R3: 1.2 kOhm resistors
- R2: 470 Ohm potentiometer
- Rx: 354 Ohm strain gauge

the equivalent resistance of the bridge is (with potentiometer in max
resistance):
[1/Re] = [1/(1200+470)] + [1/(1200+354)] --> Re = 804.95 Ohm, right?

Now, since I = V / R, the current consumption of this bridge is:

I = 3 V / 804.95 Ohm = 3.7 mA

So, assuming that the battery resistance is 3 Ohm, the voltage
fluctuations are about 3.7 mA * 3 Ohm = 11.1 mV.

Now, if I increase the values of resistors, for example:
- R1 and R3: 10 kOhm resistors
- R2: 10 kOhm potentiometer
- Rx: 354 Ohm strain gauge

the equivalent resistance of this bridge will be (with potentiometer in
max resistance):

[1/Re] = [1/(1+1)] + [1/(1+354)] --> Re = 6822,17 Ohm

So the current consumption is:

I = 3 V / 6822,17 Ohm = 0.4 mA

In this case the voltage fluctuations are about 0.4 mA * 3 Ohm = 1.2 mV.

Thanks to this value I should solve the problem in my ADC readings
because a level of the quantization is greater then 2 mV.


Do you think the reasoning is correct?

Greetings,
-- 
Francesco Ficarola 
[GPG KeyID: 0xDBA99D92]


Urs Hunkeler ha scritto:
> Hi Francesco,
> 
> The potentiometer (probably used as a voltage divider?) might amount for
> up to (3V / 450 Ohm =) ~6mA, not that much but it's already on the order
> of the power consumption of the microcontroller. If the total power
> consumption for sampling the sensors is around 10mA and the batteries
> have an internal resistance of approximately 3 Ohm, that might account
> for fluctuations of the supply voltage of up to 30mV. I don't know
> whether your noise is bigger than that. In any case you'll probably have
> to ask an electronic expert. If at your university or company you have a
> technician (one with a soldering iron) you might want to ask him. They
> often have surprising insights based on practical experience rather than
> theoretical knowledge.
> 
> Cheers,
> Urs



signature.asc
Description: OpenPGP digital signature
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] ADC Readings and VREF

2010-12-04 Thread Urs Hunkeler
Hi Francesco,

At a quick glance your calculations appear to be correct. If the effort 
is small to change the resistors, it's worth a try.

I also have been thinking, and maybe the simple model of the battery is 
not enough to explain the phenomenon you see. I suspect that the 
microcontroller turning on and off while sampling the sensor could also 
be a problem. You can force the microcontroller to stay on during the 
sampling by overriding the default behavior of the power management. 
You'll have to wire an additional interface for this:

components McuSleepC;
McuSleepC.McuPowerOverride -> YourApplication;

In your application, you need to implement the McuPowerOverride interface:

module ... {
   // ...
   provides interface McuPowerOverride;
   // ...
}
implementation {
   uint8_t sensorSampling = 0;
   // ...
   async command mcu_power_t McuPowerOverride.lowestState() {
 // WARNING: this code is specific to the Atmel microcontrollers
 // Should run on Mica2, MicaZ, and Iris
 if(sensorSampling == 0) {
   // we can allow the MCU to sleep
   return ATM128_POWER_DOWN;
 } else {
   // MCU needs to remain active
   return ATM128_POWER_IDLE;
 }
   }
   // when starting to sample the sensor
   sensorSampling = 1;
   // sample sensor
   // when done sampling sensor
   sensorSampling = 0;
   // ...
}

Cheers,
Urs


On 12/4/10 11:14 AM, Francesco Ficarola wrote:
> Urs, in the meantime I thought:
>
> Since I use a weathstone bridge
> (http://en.wikipedia.org/wiki/Wheatstone_bridge) with:
> - R1 and R3: 1.2 kOhm resistors
> - R2: 470 Ohm potentiometer
> - Rx: 354 Ohm strain gauge
>
> the equivalent resistance of the bridge is (with potentiometer in max
> resistance):
> [1/Re] = [1/(1200+470)] + [1/(1200+354)] -->  Re = 804.95 Ohm, right?
>
> Now, since I = V / R, the current consumption of this bridge is:
>
> I = 3 V / 804.95 Ohm = 3.7 mA
>
> So, assuming that the battery resistance is 3 Ohm, the voltage
> fluctuations are about 3.7 mA * 3 Ohm = 11.1 mV.
>
> Now, if I increase the values of resistors, for example:
> - R1 and R3: 10 kOhm resistors
> - R2: 10 kOhm potentiometer
> - Rx: 354 Ohm strain gauge
>
> the equivalent resistance of this bridge will be (with potentiometer in
> max resistance):
>
> [1/Re] = [1/(1+1)] + [1/(1+354)] -->  Re = 6822,17 Ohm
>
> So the current consumption is:
>
> I = 3 V / 6822,17 Ohm = 0.4 mA
>
> In this case the voltage fluctuations are about 0.4 mA * 3 Ohm = 1.2 mV.
>
> Thanks to this value I should solve the problem in my ADC readings
> because a level of the quantization is greater then 2 mV.
>
>
> Do you think the reasoning is correct?
>
> Greetings,

___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] ADC Readings and VREF

2010-12-05 Thread Francesco Ficarola
Hi Urs,

unfortunately that is not the biggest problem and so the solution to
force the MCU to stay ON during the sampling had no effect: the
fluctuations with Duracells remain. Moreover I also found this problem
with samplings of major periods (3000 ms), where the MCU should not have
problems of state changes. I really think that the main cause depends on
the batteries. However thank you very much for your idea, you are very
helpful.

Greetings,
-- 
Francesco Ficarola 
[GPG KeyID: 0xDBA99D92]


Urs Hunkeler ha scritto:
> Hi Francesco,
> 
> At a quick glance your calculations appear to be correct. If the effort
> is small to change the resistors, it's worth a try.
> 
> I also have been thinking, and maybe the simple model of the battery is
> not enough to explain the phenomenon you see. I suspect that the
> microcontroller turning on and off while sampling the sensor could also
> be a problem. You can force the microcontroller to stay on during the
> sampling by overriding the default behavior of the power management.
> You'll have to wire an additional interface for this:
> 
> components McuSleepC;
> McuSleepC.McuPowerOverride -> YourApplication;
> 
> In your application, you need to implement the McuPowerOverride interface:
> 
> module ... {
>   // ...
>   provides interface McuPowerOverride;
>   // ...
> }
> implementation {
>   uint8_t sensorSampling = 0;
>   // ...
>   async command mcu_power_t McuPowerOverride.lowestState() {
> // WARNING: this code is specific to the Atmel microcontrollers
> // Should run on Mica2, MicaZ, and Iris
> if(sensorSampling == 0) {
>   // we can allow the MCU to sleep
>   return ATM128_POWER_DOWN;
> } else {
>   // MCU needs to remain active
>   return ATM128_POWER_IDLE;
> }
>   }
>   // when starting to sample the sensor
>   sensorSampling = 1;
>   // sample sensor
>   // when done sampling sensor
>   sensorSampling = 0;
>   // ...
> }
> 
> Cheers,
> Urs
> 
> 
> On 12/4/10 11:14 AM, Francesco Ficarola wrote:
>> Urs, in the meantime I thought:
>>
>> Since I use a weathstone bridge
>> (http://en.wikipedia.org/wiki/Wheatstone_bridge) with:
>> - R1 and R3: 1.2 kOhm resistors
>> - R2: 470 Ohm potentiometer
>> - Rx: 354 Ohm strain gauge
>>
>> the equivalent resistance of the bridge is (with potentiometer in max
>> resistance):
>> [1/Re] = [1/(1200+470)] + [1/(1200+354)] -->  Re = 804.95 Ohm, right?
>>
>> Now, since I = V / R, the current consumption of this bridge is:
>>
>> I = 3 V / 804.95 Ohm = 3.7 mA
>>
>> So, assuming that the battery resistance is 3 Ohm, the voltage
>> fluctuations are about 3.7 mA * 3 Ohm = 11.1 mV.
>>
>> Now, if I increase the values of resistors, for example:
>> - R1 and R3: 10 kOhm resistors
>> - R2: 10 kOhm potentiometer
>> - Rx: 354 Ohm strain gauge
>>
>> the equivalent resistance of this bridge will be (with potentiometer in
>> max resistance):
>>
>> [1/Re] = [1/(1+1)] + [1/(1+354)] -->  Re = 6822,17 Ohm
>>
>> So the current consumption is:
>>
>> I = 3 V / 6822,17 Ohm = 0.4 mA
>>
>> In this case the voltage fluctuations are about 0.4 mA * 3 Ohm = 1.2 mV.
>>
>> Thanks to this value I should solve the problem in my ADC readings
>> because a level of the quantization is greater then 2 mV.
>>
>>
>> Do you think the reasoning is correct?
>>
>> Greetings,
> 
> 



signature.asc
Description: OpenPGP digital signature
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

  1   2   >