Re: [Tinyos-help] Problem ADC with MSP430 in tinyos 2.1

2011-09-27 Thread Juan Verdu
Hello everybody,

Thank you very much for the help everyone, the error was not called
Control.start.

My apologies for the translation.

A greeting

El 27 de septiembre de 2011 20:46, Antonio Linan escribió:

> Jan is right, no calls to Control.start() are made, also you should do
> something like:
>
>
> event void Control.startDone(error_t err) {
>   if (error == SUCCESS){
> // continue
>   } else {
> call Control.start();
> }
>
> To ensure is running, you can also consider to use leds to ease the
> debugging process.
>
> Good luck :)
>
> Antonio.
>
> On Tue, Sep 27, 2011 at 8:06 PM, Jan Hauer  wrote:
>
>> It looks like you forget to call SplitControl.start() (provided by
>> ActiveMessageC or SerialActiveMessageC) ...
>>
>> Jan
>>
>> On Tue, Sep 27, 2011 at 7:10 PM, Juan Verdu  wrote:
>> > Hello everyone,
>> >
>> > I am working with a MSP430F2617 microcontroller  and a radio CC2420
>> under
>> > the Zolertia driver.
>> >
>> > I am making an application to read the internal temperature of the
>> > microcontroller, and later I will send the information to a base station
>> > under the Basestation application.
>> >
>> > My application performs Send () correctly but this application fails
>> > AM.sendDone (), if I change the component SerialActiveMessageC by
>> > ActiveMessageC, the same problem will happen. In this case, I do not use
>> a
>> > radio. I use the serial port and I wouldn´t use the BaseStation
>> application.
>> >
>> > The code is as follows:
>> >
>> >
>> > Makefile
>> >
>> > COMPONENT=TestAdcAppC
>> > CFLAGS += -DADC12_TIMERA_ENABLED
>> > CFLAGS += -DADC12_ONLY_WITH_DMA
>> > include $(MAKERULES)
>> > CFLAGS += -DCC2420_DEF_CHANNEL=20
>> >
>> > TestAdc.h
>> >
>> >
>> > #ifndef TEST_SERIAL_H
>> > #define TEST_SERIAL_H
>> > typedef nx_struct test_serial_msg {
>> >   nx_uint16_t counter;
>> > } test_serial_msg_t;
>> > enum {
>> >   AM_TEST_SERIAL_MSG = 0x89,
>> > };
>> > #endif
>> >
>> > TestAdcC.nc
>> >
>> > #include "Timer.h"
>> > #include "TestAdc.h"
>> >
>> > module TestAdcC
>> > {
>> >   uses interface Boot;
>> >   uses interface Leds;
>> >   uses interface Timer as Timer0;
>> > uses interface Msp430Adc12Overflow as overflow;
>> >   uses interface Msp430Adc12SingleChannel as adc;
>> >   uses interface Resource;
>> >   uses interface SplitControl as Control;
>> >   uses interface Packet;
>> >   uses interface AMSend;
>> > }
>> >
>> > implementation
>> > {
>> > #define BUF_SIZE 100
>> >   uint16_t buf[BUF_SIZE];
>> >  message_t packet;
>> >
>> > uint16_t counter = 0;
>> > uint16_t Data;
>> >
>> > void configureSingle();
>> > msp430adc12_channel_config_t adcconfig = {
>> > inch: SUPPLY_VOLTAGE_HALF_CHANNEL,
>> > sref: REFERENCE_VREFplus_AVss,
>> > ref2_5v: REFVOLT_LEVEL_1_5,
>> > adc12ssel: SHT_SOURCE_ACLK,
>> > adc12div: SHT_CLOCK_DIV_1,
>> > sht: SAMPLE_HOLD_4_CYCLES,
>> > sampcon_ssel: SAMPCON_SOURCE_SMCLK,
>> > sampcon_id: SAMPCON_CLOCK_DIV_1
>> >   };
>> >
>> >   event void Boot.booted()
>> >   {
>> > call Resource.request();
>> >}
>> > async event void overflow.conversionTimeOverflow(){
>> >}
>> >   async event void overflow.memOverflow(){
>> >   }
>> >
>> >   async event uint16_t *adc.multipleDataReady(uint16_t *buffer, uint16_t
>> > numSamples){
>> > return buffer;
>> >   }
>> >  task void send(){
>> > test_serial_msg_t* rcm = (test_serial_msg_t*)call
>> > Packet.getPayload(&packet, sizeof(test_serial_msg_t));
>> > // call Resource.release();
>> > call Leds.led0Toggle();
>> >  rcm->counter = Data;
>> > if(  call AMSend.send(AM_BROADCAST_ADDR, &packet,
>> > sizeof(test_serial_msg_t)) == SUCCESS)
>> > call Leds.led1Toggle();
>> > }
>> >   async event error_t adc.singleDataReady(uint16_t data){
>> > Data = data;
>> > post send();
>> >   return SUCCESS;
>> >   }
>> > event void Resource.granted(){
>> > configureSingle();
>> > call Timer0.startPeriodic(2048);
>> >   }
>> >   void configureSingle(){
>> > error_t e;
>> > e = call adc.configureSingle(&adcconfig);
>> >   }
>> > event void Timer0.fired()
>> >   {
>> > call adc.getData();
>> >   }
>> > event void AMSend.sendDone(message_t* bufPtr, error_t error) {
>> > call Leds.led2Toggle();
>> > }
>> > event void Control.startDone(error_t err) {
>> >   }
>> >
>> >  event void Control.stopDone(error_t err) {
>> > }
>> > }
>> >
>> > TestAdcAppC.nc
>> >
>> > #include "TestAdc.h"
>> > configuration TestAdcAppC {
>> > }
>> > implementation
>> > {
>> >   components MainC,
>> >  TestAdcC,
>> >  LedsC;
>> >  components ActiveMessageC as AM;
>> >  components new TimerMilliC() as Timer0;
>> >  components new Msp430Adc12ClientAutoDMAC() as Lectura;
>> >   TestAdcC.overflow -> Lectura;
>> >   TestAdcC.adc -> Lectura;
>> >   TestAdcC.Resource -> Lectura;
>> >TestAdcC -> MainC.Boot;
>> >   TestAdcC.Leds -> LedsC;
>> >   TestAdcC.Timer0 -> Timer0;
>> >   TestAdcC.Control -> AM;

Re: [Tinyos-help] temperature and humidity help!!!

2011-09-27 Thread Zhen Song
Hi Javier

I'm actually doing that now. :-) The Oscilloscope application in
TinyOS satisfies my need.


Regards
Zhen

2011/9/27 Javier Vázquez Villodres :
> Hello,
>
> I am new to TinyOS and need help urgently. I have to make a program that
> collects temperature and humidity with a "TMOT sky" and not how. Someone
> could help me?.
>
> My email address is jvazquez@gmail.com. Thanks!
> Quizás quisiste decir: Hola, Soy nuevo en esto de TinyOS y necesita ayuda
> urgentemente. Tengo que realizar un programa que recoja temperatura y
> humedad con una
> Escribe texto o la dirección de un sitio web, o bien, traduce un documento.
> Cancelar
>
> traducción del español al inglés
>
> ___
> 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] Problem ADC with MSP430 in tinyos 2.1

2011-09-27 Thread Antonio Linan
Jan is right, no calls to Control.start() are made, also you should do
something like:

event void Control.startDone(error_t err) {
  if (error == SUCCESS){
// continue
  } else {
call Control.start();
}

To ensure is running, you can also consider to use leds to ease the
debugging process.

Good luck :)

Antonio.

On Tue, Sep 27, 2011 at 8:06 PM, Jan Hauer  wrote:

> It looks like you forget to call SplitControl.start() (provided by
> ActiveMessageC or SerialActiveMessageC) ...
>
> Jan
>
> On Tue, Sep 27, 2011 at 7:10 PM, Juan Verdu  wrote:
> > Hello everyone,
> >
> > I am working with a MSP430F2617 microcontroller  and a radio CC2420 under
> > the Zolertia driver.
> >
> > I am making an application to read the internal temperature of the
> > microcontroller, and later I will send the information to a base station
> > under the Basestation application.
> >
> > My application performs Send () correctly but this application fails
> > AM.sendDone (), if I change the component SerialActiveMessageC by
> > ActiveMessageC, the same problem will happen. In this case, I do not use
> a
> > radio. I use the serial port and I wouldn´t use the BaseStation
> application.
> >
> > The code is as follows:
> >
> >
> > Makefile
> >
> > COMPONENT=TestAdcAppC
> > CFLAGS += -DADC12_TIMERA_ENABLED
> > CFLAGS += -DADC12_ONLY_WITH_DMA
> > include $(MAKERULES)
> > CFLAGS += -DCC2420_DEF_CHANNEL=20
> >
> > TestAdc.h
> >
> >
> > #ifndef TEST_SERIAL_H
> > #define TEST_SERIAL_H
> > typedef nx_struct test_serial_msg {
> >   nx_uint16_t counter;
> > } test_serial_msg_t;
> > enum {
> >   AM_TEST_SERIAL_MSG = 0x89,
> > };
> > #endif
> >
> > TestAdcC.nc
> >
> > #include "Timer.h"
> > #include "TestAdc.h"
> >
> > module TestAdcC
> > {
> >   uses interface Boot;
> >   uses interface Leds;
> >   uses interface Timer as Timer0;
> > uses interface Msp430Adc12Overflow as overflow;
> >   uses interface Msp430Adc12SingleChannel as adc;
> >   uses interface Resource;
> >   uses interface SplitControl as Control;
> >   uses interface Packet;
> >   uses interface AMSend;
> > }
> >
> > implementation
> > {
> > #define BUF_SIZE 100
> >   uint16_t buf[BUF_SIZE];
> >  message_t packet;
> >
> > uint16_t counter = 0;
> > uint16_t Data;
> >
> > void configureSingle();
> > msp430adc12_channel_config_t adcconfig = {
> > inch: SUPPLY_VOLTAGE_HALF_CHANNEL,
> > sref: REFERENCE_VREFplus_AVss,
> > ref2_5v: REFVOLT_LEVEL_1_5,
> > adc12ssel: SHT_SOURCE_ACLK,
> > adc12div: SHT_CLOCK_DIV_1,
> > sht: SAMPLE_HOLD_4_CYCLES,
> > sampcon_ssel: SAMPCON_SOURCE_SMCLK,
> > sampcon_id: SAMPCON_CLOCK_DIV_1
> >   };
> >
> >   event void Boot.booted()
> >   {
> > call Resource.request();
> >}
> > async event void overflow.conversionTimeOverflow(){
> >}
> >   async event void overflow.memOverflow(){
> >   }
> >
> >   async event uint16_t *adc.multipleDataReady(uint16_t *buffer, uint16_t
> > numSamples){
> > return buffer;
> >   }
> >  task void send(){
> > test_serial_msg_t* rcm = (test_serial_msg_t*)call
> > Packet.getPayload(&packet, sizeof(test_serial_msg_t));
> > // call Resource.release();
> > call Leds.led0Toggle();
> >  rcm->counter = Data;
> > if(  call AMSend.send(AM_BROADCAST_ADDR, &packet,
> > sizeof(test_serial_msg_t)) == SUCCESS)
> > call Leds.led1Toggle();
> > }
> >   async event error_t adc.singleDataReady(uint16_t data){
> > Data = data;
> > post send();
> >   return SUCCESS;
> >   }
> > event void Resource.granted(){
> > configureSingle();
> > call Timer0.startPeriodic(2048);
> >   }
> >   void configureSingle(){
> > error_t e;
> > e = call adc.configureSingle(&adcconfig);
> >   }
> > event void Timer0.fired()
> >   {
> > call adc.getData();
> >   }
> > event void AMSend.sendDone(message_t* bufPtr, error_t error) {
> > call Leds.led2Toggle();
> > }
> > event void Control.startDone(error_t err) {
> >   }
> >
> >  event void Control.stopDone(error_t err) {
> > }
> > }
> >
> > TestAdcAppC.nc
> >
> > #include "TestAdc.h"
> > configuration TestAdcAppC {
> > }
> > implementation
> > {
> >   components MainC,
> >  TestAdcC,
> >  LedsC;
> >  components ActiveMessageC as AM;
> >  components new TimerMilliC() as Timer0;
> >  components new Msp430Adc12ClientAutoDMAC() as Lectura;
> >   TestAdcC.overflow -> Lectura;
> >   TestAdcC.adc -> Lectura;
> >   TestAdcC.Resource -> Lectura;
> >TestAdcC -> MainC.Boot;
> >   TestAdcC.Leds -> LedsC;
> >   TestAdcC.Timer0 -> Timer0;
> >   TestAdcC.Control -> AM;
> >   TestAdcC.AMSend -> AM.AMSend[AM_TEST_SERIAL_MSG];
> >   TestAdcC.Packet -> AM;
> > }
> >
> > Could someone help me?
> >
> > Escribe texto o la dirección de un sitio web, o bien, traduce un
> documento.
> > Cancelar
> >
> > traducción del español al inglés
> >
> > A greeting and thank you very much
> >
> > ___
> > Tinyos-help mailing list
> > Tinyos

[Tinyos-help] 6LoWPAN implementation

2011-09-27 Thread Jonas Hartwig
Hi everyone!

As seen in the readme file to have a closer look your supposed to read: 
Connecting Wireless Sensor Networks to the Internet – a 6lowpan 
Implementation for TinyOS 2.0. I did. Though the document is four years old.

As written on the website draft-ietf-hc-06 is supported. this means that 
context based compression is supported. as readable in the readme ND is 
not implemented. How gets the context spread?

Is sateless compression also available?

Furthermore lib6lowpan is abvailable. How can i translate it so i can 
use it in an external application written in C/C++ without the rest of 
the IP stack? is this possible?

Is the README file in the 6lowpan directory up to date? and all points 
stated still valid?

Many questions;)

im thankful for every answer i get!
regards
Jonas
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

[Tinyos-help] (no subject)

2011-09-27 Thread sai manoj
Ia it possible to chabge the inbuily header of the Zigbee using Iris
motes...

I need to add some extra fields in the header. If we can do that how to do
that
-- 
SAI MANOJ P D (M.Tech)
International Institute of Information Technology,Bangalore
Ph. : +91-9663971090
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] Problem ADC with MSP430 in tinyos 2.1

2011-09-27 Thread Jan Hauer
It looks like you forget to call SplitControl.start() (provided by
ActiveMessageC or SerialActiveMessageC) ...

Jan

On Tue, Sep 27, 2011 at 7:10 PM, Juan Verdu  wrote:
> Hello everyone,
>
> I am working with a MSP430F2617 microcontroller  and a radio CC2420 under
> the Zolertia driver.
>
> I am making an application to read the internal temperature of the
> microcontroller, and later I will send the information to a base station
> under the Basestation application.
>
> My application performs Send () correctly but this application fails
> AM.sendDone (), if I change the component SerialActiveMessageC by
> ActiveMessageC, the same problem will happen. In this case, I do not use a
> radio. I use the serial port and I wouldn´t use the BaseStation application.
>
> The code is as follows:
>
>
> Makefile
>
> COMPONENT=TestAdcAppC
> CFLAGS += -DADC12_TIMERA_ENABLED
> CFLAGS += -DADC12_ONLY_WITH_DMA
> include $(MAKERULES)
> CFLAGS += -DCC2420_DEF_CHANNEL=20
>
> TestAdc.h
>
>
> #ifndef TEST_SERIAL_H
> #define TEST_SERIAL_H
> typedef nx_struct test_serial_msg {
>   nx_uint16_t counter;
> } test_serial_msg_t;
> enum {
>   AM_TEST_SERIAL_MSG = 0x89,
> };
> #endif
>
> TestAdcC.nc
>
> #include "Timer.h"
> #include "TestAdc.h"
>
> module TestAdcC
> {
>   uses interface Boot;
>   uses interface Leds;
>   uses interface Timer as Timer0;
>     uses interface Msp430Adc12Overflow as overflow;
>   uses interface Msp430Adc12SingleChannel as adc;
>   uses interface Resource;
>   uses interface SplitControl as Control;
>   uses interface Packet;
>   uses interface AMSend;
> }
>
> implementation
> {
> #define BUF_SIZE 100
>   uint16_t buf[BUF_SIZE];
>  message_t packet;
>
> uint16_t counter = 0;
> uint16_t Data;
>
> void configureSingle();
> msp430adc12_channel_config_t adcconfig = {
>     inch: SUPPLY_VOLTAGE_HALF_CHANNEL,
>     sref: REFERENCE_VREFplus_AVss,
>     ref2_5v: REFVOLT_LEVEL_1_5,
>     adc12ssel: SHT_SOURCE_ACLK,
>     adc12div: SHT_CLOCK_DIV_1,
>     sht: SAMPLE_HOLD_4_CYCLES,
>     sampcon_ssel: SAMPCON_SOURCE_SMCLK,
>     sampcon_id: SAMPCON_CLOCK_DIV_1
>   };
>
>   event void Boot.booted()
>   {
> call Resource.request();
>    }
> async event void overflow.conversionTimeOverflow(){
>    }
>   async event void overflow.memOverflow(){
>       }
>
>   async event uint16_t *adc.multipleDataReady(uint16_t *buffer, uint16_t
> numSamples){
>             return buffer;
>   }
>  task void send(){
>     test_serial_msg_t* rcm = (test_serial_msg_t*)call
> Packet.getPayload(&packet, sizeof(test_serial_msg_t));
>     // call Resource.release();
>     call Leds.led0Toggle();
>      rcm->counter = Data;
>     if(  call AMSend.send(AM_BROADCAST_ADDR, &packet,
> sizeof(test_serial_msg_t)) == SUCCESS)
>         call Leds.led1Toggle();
>     }
>   async event error_t adc.singleDataReady(uint16_t data){
>     Data = data;
>     post send();
>   return SUCCESS;
>   }
>     event void Resource.granted(){
>     configureSingle();
>     call Timer0.startPeriodic(2048);
>   }
>   void configureSingle(){
>     error_t e;
>     e = call adc.configureSingle(&adcconfig);
>   }
> event void Timer0.fired()
>   {
>     call adc.getData();
>   }
> event void AMSend.sendDone(message_t* bufPtr, error_t error) {
>     call Leds.led2Toggle();
> }
> event void Control.startDone(error_t err) {
>       }
>
>  event void Control.stopDone(error_t err) {
>     }
> }
>
> TestAdcAppC.nc
>
> #include "TestAdc.h"
> configuration TestAdcAppC {
> }
> implementation
> {
>   components MainC,
>  TestAdcC,
>  LedsC;
>  components ActiveMessageC as AM;
>  components new TimerMilliC() as Timer0;
>  components new Msp430Adc12ClientAutoDMAC() as Lectura;
>   TestAdcC.overflow -> Lectura;
>   TestAdcC.adc -> Lectura;
>   TestAdcC.Resource -> Lectura;
>    TestAdcC -> MainC.Boot;
>   TestAdcC.Leds -> LedsC;
>   TestAdcC.Timer0 -> Timer0;
>   TestAdcC.Control -> AM;
>   TestAdcC.AMSend -> AM.AMSend[AM_TEST_SERIAL_MSG];
>   TestAdcC.Packet -> AM;
> }
>
> Could someone help me?
>
> Escribe texto o la dirección de un sitio web, o bien, traduce un documento.
> Cancelar
>
> traducción del español al inglés
>
> A greeting and thank you very much
>
> ___
> 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] temperature and humidity help!!!

2011-09-27 Thread Michael Schippling
Look through the doc/tutorial materials.
Then find a demo app that reads one of those sensors
and sends the data over the radio. There might even
be a demo that reads them all, but you should be able
to find a starting place.

MS

Javier Vázquez Villodres wrote:
> Hello,
> 
> I am new to TinyOS and need help urgently. I have to make a program that 
> collects temperature and humidity with a "TMOT sky" and not how. Someone 
> could help me?.
> 
> My email address is *jvazquez.bcn@**gmail.com *. Thanks!
> Quizás quisiste decir: Hola, Soy nuevo en esto de TinyOS y */necesita/* 
> ayuda urgentemente. Tengo que realizar un programa que recoja 
> temperatura y humedad con una
> Escribe texto o la dirección de un sitio web, o bien, traduce un 
> documento .
> Cancelar 
> 
> 
>   traducción del español al inglés
> 
> 
> 
> 
> ___
> 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] Problem ADC with MSP430 in tinyos 2.1

2011-09-27 Thread Michael Schippling
There may be an overloading of "AMSend" names going on...

In the congig file try, instead of
 TestAdcC.AMSend -> AM.AMSend[AM_TEST_SERIAL_MSG];
something like:
 TestAdcC.TestMessage -> AM.AMSend[AM_TEST_SERIAL_MSG];

And then in the program file use:
 call TestMessage.send(AM_BROADCAST_ADDR, ...
and
 event void TestMessage.sendDone(message_t* ...

That's how I would do it with the old and moldy TOS1.x code anyway.
MS

Juan Verdu wrote:
> Hello everyone,
> 
> I am working with a MSP430F2617 microcontroller  and a radio CC2420 
> under the Zolertia driver.
> 
> I am making an application to read the internal temperature of the 
> microcontroller, and later I will send the information to a base station 
> under the Basestation application.
> 
> My application performs Send () correctly but this application fails 
> AM.sendDone (), if I change the component SerialActiveMessageC by 
> ActiveMessageC, the same problem will happen. In this case, I do not use 
> a radio. I use the serial port and I wouldn´t use the BaseStation 
> application.
> 
> The code is as follows:
> 
> 
> _Makefile_
> 
> COMPONENT=TestAdcAppC
> CFLAGS += -DADC12_TIMERA_ENABLED
> CFLAGS += -DADC12_ONLY_WITH_DMA
> include $(MAKERULES)
> CFLAGS += -DCC2420_DEF_CHANNEL=20
> 
> _TestAdc.h_
> 
> 
> #ifndef TEST_SERIAL_H
> #define TEST_SERIAL_H
> typedef nx_struct test_serial_msg {
>   nx_uint16_t counter;
> } test_serial_msg_t;
> enum {
>   AM_TEST_SERIAL_MSG = 0x89,
> };
> #endif
> 
> _TestAdcC.nc _
> 
> #include "Timer.h"
> #include "TestAdc.h"
> 
> module TestAdcC
> {
>   uses interface Boot;
>   uses interface Leds;
>   uses interface Timer as Timer0;
> uses interface Msp430Adc12Overflow as overflow;
>   uses interface Msp430Adc12SingleChannel as adc;
>   uses interface Resource;
>   uses interface SplitControl as Control;
>   uses interface Packet;
>   uses interface AMSend;
> }
> 
> implementation
> {
> #define BUF_SIZE 100
>   uint16_t buf[BUF_SIZE];
>  message_t packet;
> 
> uint16_t counter = 0;
> uint16_t Data;
> 
> void configureSingle();
> msp430adc12_channel_config_t adcconfig = {
> inch: SUPPLY_VOLTAGE_HALF_CHANNEL,
> sref: REFERENCE_VREFplus_AVss,
> ref2_5v: REFVOLT_LEVEL_1_5,
> adc12ssel: SHT_SOURCE_ACLK,
> adc12div: SHT_CLOCK_DIV_1,
> sht: SAMPLE_HOLD_4_CYCLES,
> sampcon_ssel: SAMPCON_SOURCE_SMCLK,
> sampcon_id: SAMPCON_CLOCK_DIV_1
>   };
>  
>   event void Boot.booted()
>   {
> call Resource.request();
>}
> async event void overflow.conversionTimeOverflow(){
>}
>   async event void overflow.memOverflow(){
>   }
>  
>   async event uint16_t *adc.multipleDataReady(uint16_t *buffer, uint16_t 
> numSamples){
> return buffer;
>   }
>  task void send(){
> test_serial_msg_t* rcm = (test_serial_msg_t*)call 
> Packet.getPayload(&packet, sizeof(test_serial_msg_t));
> // call Resource.release();
> call Leds.led0Toggle();
>  rcm->counter = Data;
> if(  call AMSend.send(AM_BROADCAST_ADDR, &packet, 
> sizeof(test_serial_msg_t)) == SUCCESS)
> call Leds.led1Toggle();
> }
>   async event error_t adc.singleDataReady(uint16_t data){
> Data = data;
> post send();
>   return SUCCESS;
>   }  
> event void Resource.granted(){
> configureSingle();
> call Timer0.startPeriodic(2048);
>   }
>   void configureSingle(){
> error_t e;
> e = call adc.configureSingle(&adcconfig);
>   }
> event void Timer0.fired()
>   {
> call adc.getData();
>   }
> event void AMSend.sendDone(message_t* bufPtr, error_t error) {
> call Leds.led2Toggle();
> }
> event void Control.startDone(error_t err) {
>   }
> 
>  event void Control.stopDone(error_t err) {
> }
> }
> 
> _TestAdcAppC.nc_
> 
> #include "TestAdc.h"
> configuration TestAdcAppC {
> }
> implementation
> {
>   components MainC,
>  TestAdcC,
>  LedsC;
>  components ActiveMessageC as AM;
>  components new TimerMilliC() as Timer0;
>  components new Msp430Adc12ClientAutoDMAC() as Lectura;
>   TestAdcC.overflow -> Lectura;
>   TestAdcC.adc -> Lectura;
>   TestAdcC.Resource -> Lectura;
>TestAdcC -> MainC.Boot;
>   TestAdcC.Leds -> LedsC;
>   TestAdcC.Timer0 -> Timer0;
>   TestAdcC.Control -> AM;
>   TestAdcC.AMSend -> AM.AMSend[AM_TEST_SERIAL_MSG];
>   TestAdcC.Packet -> AM;
> }
> 
> Could someone help me?
> 
> Escribe texto o la dirección de un sitio web, o bien, traduce un 
> documento .
> Cancelar 
> 
> 
>   traducción del español al inglés
> 
> A greeting and thank you very much
> 
> 
> 
> 
> ___
> 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.berk

[Tinyos-help] Problem ADC with MSP430 in tinyos 2.1

2011-09-27 Thread Juan Verdu
Hello everyone,

I am working with a MSP430F2617 microcontroller  and a radio CC2420 underthe
Zolertia driver.

I am making an application to read the internal temperature of the
microcontroller, and later I will send the information to a base station under
the Basestation application.

My application performs Send () correctly but this application fails
AM.sendDone (), if I change the component SerialActiveMessageC by
ActiveMessageC, the same problem will happen. In this case, I do not use a
radio. I use the serial port and I wouldn´t use the BaseStation application.

The code is as follows:


*Makefile*

COMPONENT=TestAdcAppC
CFLAGS += -DADC12_TIMERA_ENABLED
CFLAGS += -DADC12_ONLY_WITH_DMA
include $(MAKERULES)
CFLAGS += -DCC2420_DEF_CHANNEL=20

*TestAdc.h*


#ifndef TEST_SERIAL_H
#define TEST_SERIAL_H
typedef nx_struct test_serial_msg {
  nx_uint16_t counter;
} test_serial_msg_t;
enum {
  AM_TEST_SERIAL_MSG = 0x89,
};
#endif

*TestAdcC.nc *

#include "Timer.h"
#include "TestAdc.h"

module TestAdcC
{
  uses interface Boot;
  uses interface Leds;
  uses interface Timer as Timer0;
uses interface Msp430Adc12Overflow as overflow;
  uses interface Msp430Adc12SingleChannel as adc;
  uses interface Resource;
  uses interface SplitControl as Control;
  uses interface Packet;
  uses interface AMSend;
}

implementation
{
#define BUF_SIZE 100
  uint16_t buf[BUF_SIZE];
 message_t packet;

uint16_t counter = 0;
uint16_t Data;

void configureSingle();
msp430adc12_channel_config_t adcconfig = {
inch: SUPPLY_VOLTAGE_HALF_CHANNEL,
sref: REFERENCE_VREFplus_AVss,
ref2_5v: REFVOLT_LEVEL_1_5,
adc12ssel: SHT_SOURCE_ACLK,
adc12div: SHT_CLOCK_DIV_1,
sht: SAMPLE_HOLD_4_CYCLES,
sampcon_ssel: SAMPCON_SOURCE_SMCLK,
sampcon_id: SAMPCON_CLOCK_DIV_1
  };

  event void Boot.booted()
  {
call Resource.request();
   }
async event void overflow.conversionTimeOverflow(){
   }
  async event void overflow.memOverflow(){
  }

  async event uint16_t *adc.multipleDataReady(uint16_t *buffer, uint16_t
numSamples){
return buffer;
  }
 task void send(){
test_serial_msg_t* rcm = (test_serial_msg_t*)call
Packet.getPayload(&packet, sizeof(test_serial_msg_t));
// call Resource.release();
call Leds.led0Toggle();
 rcm->counter = Data;
if(  call AMSend.send(AM_BROADCAST_ADDR, &packet,
sizeof(test_serial_msg_t)) == SUCCESS)
call Leds.led1Toggle();
}
  async event error_t adc.singleDataReady(uint16_t data){
Data = data;
post send();
  return SUCCESS;
  }
event void Resource.granted(){
configureSingle();
call Timer0.startPeriodic(2048);
  }
  void configureSingle(){
error_t e;
e = call adc.configureSingle(&adcconfig);
  }
event void Timer0.fired()
  {
call adc.getData();
  }
event void AMSend.sendDone(message_t* bufPtr, error_t error) {
call Leds.led2Toggle();
}
event void Control.startDone(error_t err) {
  }

 event void Control.stopDone(error_t err) {
}
}

*TestAdcAppC.nc*

#include "TestAdc.h"
configuration TestAdcAppC {
}
implementation
{
  components MainC,
 TestAdcC,
 LedsC;
 components ActiveMessageC as AM;
 components new TimerMilliC() as Timer0;
 components new Msp430Adc12ClientAutoDMAC() as Lectura;
  TestAdcC.overflow -> Lectura;
  TestAdcC.adc -> Lectura;
  TestAdcC.Resource -> Lectura;
   TestAdcC -> MainC.Boot;
  TestAdcC.Leds -> LedsC;
  TestAdcC.Timer0 -> Timer0;
  TestAdcC.Control -> AM;
  TestAdcC.AMSend -> AM.AMSend[AM_TEST_SERIAL_MSG];
  TestAdcC.Packet -> AM;
}

Could someone help me?

Escribe texto o la dirección de un sitio web, o bien, traduce un
documento
.
Cancelar 
traducción del español al inglés
A greeting and thank you very much
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

[Tinyos-help] CHANGE PACKET SIZE TO TINYOS 2.X

2011-09-27 Thread David Perez
 Hi,
I would like to know how to change the size of packets sent by a telosb with
TinyOS 2.x, through the radio.
Thanks in advance.
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

[Tinyos-help] temperature and humidity help!!!

2011-09-27 Thread Javier Vázquez Villodres
Hello,

I am new to TinyOS and need help urgently. I have to make a program that
collects temperature and humidity with a "TMOT sky" and not how. Someone could
help me?.

My email address is *jvazquez.bcn@**gmail.com*. Thanks!
Quizás quisiste decir: Hola, Soy nuevo en esto de TinyOS y *necesita* ayuda
urgentemente. Tengo que realizar un programa que recoja temperatura y
humedad con una
Escribe texto o la dirección de un sitio web, o bien, traduce un
documento
.
Cancelar 
traducción del español al inglés
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help