I'm cc'ing this to the help list to keep a record of everything...

By "digital signal" I assume you mean a single bit On/Off thing.
The lowlevel way is to use something like this:

// name an I/O pin -- e.g., port C bit 0
TOSH_ASSIGN_PIN(MOTOR1DIR, C, 0);       // PC0
// Set pin direction
TOSH_MAKE_MOTOR1DIR_OUTPUT(); // or
TOSH_MAKE_MOTOR1DIR_INPUT();
// set value
TOSH_CLR_MOTOR1DIR_PIN(); // 0
TOSH_SET_MOTOR1DIR_PIN(); // or 1
// get binary value
din = TOSH_READ_MOTOR1DIR_PIN();

But there are advanced software modules to do similar on various
platforms and TOS versions. The tmote has:  MSP430GeneralIOM
but I don't know about others.

MS

Abdullah Kadri wrote:
Thank you very much for this wonderful information. I've already started
reading the tutorial few weeks ago and still learning the nesC language. I
think I need to find a way to how to get an analog signal at the second end.
I believe that I will follow your advice in using PWM and see how it goes.
Something else, what if I need to send an external digital signal and
receive it at the second end? Is there an interface for this signal? My questions seem silly but your answer will help me a lot.
Best,

Abdullah Kadri, P.Eng., Ph.D. Candidate The University of Western Ontario Department of Electrical and Computer Engineering Phone: (519) 661-2111 ext. 81271
-----Original Message-----
From: Michael Schippling [mailto:[EMAIL PROTECTED] Sent: Friday, November 09, 2007 1:19 PM
To: Abdullah Kadri
Cc: [email protected]
Subject: Re: [Tinyos-help] Analog signal transfer

If you haven't already, start by reading though the doc/tutorial
to get an idea what you are up against.

Then...all mote types have an Analog to Digital Converter (ADC)
which, conveniently enough, has a range from about 0-3.3v so
that should cover how to get the data. Look for modules named ADC.
The Oscilloscope demo app program is, sometimes, a good example of
collecting and sending data from one or more ADC channels.

Other examples of sending and receiving are CntToRfm, SenseToRfm,
and RfmToLeds.

Now, if you really want an analog signal at the receiving end you
have fewer options. The telos/tmote controller has an intriguing
DAC (Digital to Analog Converter) but I've never looked into it.
The other option is to use a PWM (Pulse Width Modulation) output,
vary the pulse width relative to the digital value, and integrate
the result with an RC network. Unfortunately I doubt that either
the DAC or the PWM features are supported under TOS, so you will
be doing some low-level controller programming.
If you are using the mica motes I have some PWM code in:
     http://www.etantdonnes.com/Motes/AVR128timers.zip

MS


Abdullah Kadri wrote:

Dear all,

I need to send an analog signal from one node to another. I am using two micaz motes. Can any one send me a brief idea on how to do that? The analog signal is 0-3 V. Any help will be very much appreciated.

Cheers,

Abdullah Kadri, P.Eng., Ph.D. Candidate
The University of Western Ontario
Department of Electrical and Computer Engineering
Phone: (519) 661-2111 ext. 81271


------------------------------------------------------------------------

_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to