[Tinyos-help] ADC&MDA300
Antonio Prados Vilchez
Centag71 at acciona.es
Mon Jun 23 02:16:28 PDT 2008
Thanks for your help, Christopher.
Now I'm trying to use the I2C interface, as you said, but it doesn´t work. I get a lot of compiling errors in the I2CPacket and Atm128I2CMasterC files, so I think it's because of the instantiation. Am I doing it right? Should I upgrade my TinyOS files to a newer version? The way I instantiate these interfaces and components is:
-----------
implementation
{
...
components new Atm128I2CMasterC();
...
App.I2CPacket -> Atm128I2CMasterC;
}
-----------
module SensorToRadioC
{
uses
{
...
interface I2CPacket<TI2CBasicAddr>;
}
}
-----------
Thanks in advance
-----Mensaje original-----
De: Christopher Leung [mailto:christopher.leung at mail.mcgill.ca]
Enviado el: vie 20/06/2008 15:40
Para: Antonio Prados Vilchez; tinyos-help at millennium.berkeley.edu
Asunto: RE: [Tinyos-help] ADC&MDA300
The MDA300 board uses an 8-channel ADC with I2C interface (ADS7828). To
use it, you will need the Atm128I2CMasterC component and it can be found
in tos\chips\atm128\i2c. For information on how to use the ADC, you can
look up its datasheet.
Pins A0 to A6 are connected to channel 0 to 6 on the ADC. The
differential inputs 7, 8, 9, and 10, are more complicated to use because
they are connected to a switch which is connected to channel 7.
As for using Vcc as reference voltage, I do not know which voltage line
feeds the external voltage pin on the ADC.
Chris
________________________________
From: tinyos-help-bounces at millennium.berkeley.edu
[mailto:tinyos-help-bounces at millennium.berkeley.edu] On Behalf Of
Antonio Prados Vilchez
Sent: June 19, 2008 5:40 PM
To: tinyos-help at millennium.berkeley.edu
Subject: [Tinyos-help] ADC&MDA300
Hi TinyOS users!!
I'm using a MDA300 connected to a MICAz to measure a voltage from a
sensor. I want to read from an ADC channel, so I'm using this command:
call Atm128AdcSingle.getData(ATM128_ADC_SNGL_ADC0, ATM128_ADC_VREF_AVCC,
ATM128_ADC_RIGHT_ADJUST, ATM128_ADC_PRESCALE);
I want to read from channel 0 with Vcc as the reference voltage.
However, I always get the same data from the ADC. I've checked the
sensor and it works properly, it gives variable voltages to the MDA300.
Am I using the right command to read from the ADC?
Thanks in advance
==============================================================
Este mensaje se dirige exclusivamente a su destinatario, y puede contener información confidencial sometida a secreto profesional, o cuya divulgación esté legalmente prohibida.Cualquier opinión en él contenida es exclusiva de su autor y no representa necesariamente la opinión de la empresa. Si ha recibido este mensaje por error, le rogamos nos lo comunique de forma inmediata por esta misma vía y proceda a su eliminación, así como a la de cualquier documento adjunto al mismo. El correo electrónico vía Internet no es seguro y no se puede garantizar que no haya errores ya que puede ser interceptado, modificado, perdido o destruido, o contener virus. Cualquier persona que se ponga en contacto con nosotros por correo electrónico se considerará que asume estos riesgos.
This e-mail is addressed exclusively to the recipient and may contain privileged information under a professional confidential agreement or it may be against the law to disclose its contents. Any opinion contained in it belongs exclusively to his/her author and does not necessarily reflect the company's view. If you receive this e-mail in error, please let us know immediately (by return e-mail) and proceed to its destruction, as well as any document attached to it. The sending of e-mails through the Internet is not safe and, therefore, error-free communications cannot be guaranteed, as they can be intercepted, changed, misled or destroyed or they might contain a virus. Any user contacting us through e-mails shall be understood to be assuming these risks.
==============================================================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20080623/77d61afa/attachment.htm
More information about the Tinyos-help
mailing list