[Tinyos-help] Arrays in TinyOs

2011-03-14 Thread lulu cheng

Hi,

I need to collect certain sets of data and just curious, is there array for 
tinyos?
  ___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] Arrays in TinyOs

2011-03-14 Thread 崔晓宗
yes.
For example,

uint16_t array[10];

在 2011年3月14日 下午6:03,lulu cheng 写道:

>  Hi,
>
> I need to collect certain sets of data and just curious, is there array for
> tinyos?
>
> ___
> Tinyos-help mailing list
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>



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

[Tinyos-help] Endless resynchronising with shimmer 2r

2011-03-14 Thread Erwan RENAUDO
Hi.

I have trouble using shimmer 2r and trying to follow lesson 4 about mote-PC
communication. I found Wendy problem (
http://www.mail-archive.com/tinyos-help@millennium.berkeley.edu/msg26358.html)
that is close to mine except that I'm using VMplayer to run Xubuntu
with
tinyos development environment on Fedora 10. I can easily run Blink, but I
get "Resynchronising" without end while running net.tinyos.tools.Listen
-comm serial@/dev/ttyUSB0:shimmer (TestSerial is running on the mote with
same port). Shimmer mote hasn't any on/off switch. TestSerial is sending
packet correctly ...

Does someone can help me ?
Thanks,

Erwan

-- 
Élève Ingénieur Promo 2011 - Section *Informatique et Systèmes*.
École Nationale Supérieure de l'Électronique et de ses Applications (*
E.N.S.E.A.* - Cergy)
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Re: [Tinyos-help] Endless resynchronising with shimmer 2r

2011-03-14 Thread mike healy
Hi Erwan,

There are two serial ports on the shimmer dock, one for programming the
shimmer, and the other for communicating with it:
http://www.shimmer-research.com/links/faqs#H12

You need to use the second one. I.e. in your case you probably need to run:
net.tinyos.tools.Listen -comm serial@/dev/ttyUSB1:shimmer

I don't know why you mention a power switch, but fyi the original shimmer
(shimmer1.3) did not have a power switch, but they have not been available
since mid 2009. The new versions (shimmer2 and shimmer2r) can, however, be
turned off (by holding the reset button for 7 seconds or greater). A brief
press of the reset switch will power them back on.

Mike

On Mon, Mar 14, 2011 at 4:00 PM, Erwan RENAUDO wrote:

> Hi.
>
> I have trouble using shimmer 2r and trying to follow lesson 4 about mote-PC
> communication. I found Wendy problem (
> http://www.mail-archive.com/tinyos-help@millennium.berkeley.edu/msg26358.html)
>  that is close to mine except that I'm using VMplayer to run Xubuntu with
> tinyos development environment on Fedora 10. I can easily run Blink, but I
> get "Resynchronising" without end while running net.tinyos.tools.Listen
> -comm serial@/dev/ttyUSB0:shimmer (TestSerial is running on the mote with
> same port). Shimmer mote hasn't any on/off switch. TestSerial is sending
> packet correctly ...
>
> Does someone can help me ?
> Thanks,
>
> Erwan
>
> --
> Élève Ingénieur Promo 2011 - Section *Informatique et Systèmes*.
> École Nationale Supérieure de l'Électronique et de ses Applications (*
> E.N.S.E.A.* - Cergy)
>
>
> ___
> 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] Question regarding computation cost of a function in MicroSeconds

2011-03-14 Thread Sobit Thapa
Hi,

I need a help regarding computation cost of a function which I want to read in
Micro Second...I need a sample code for Atm128 processor. Can
anybody please help me...

Its urgent and I appreciate your help.

Regards,
Sobit
Graduate Researcher
Texas State University

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


Re: [Tinyos-help] Question regarding computation cost of a function in MicroSeconds

2011-03-14 Thread Eric Decker
I assume you mean computation cost in terms of time.

I haven't messed with the atmel processors in years and currently am working
with the msp430 processors
but the concepts are equivilent.

There should be a h/w timer running on the atm128 that should be ticking at
1us.   you need to find that
timer register and figure out how to snapshot it.

Then you take a snapshot at the start of the code you are measuring and then
another when the computation
completes.You need to be aware of the width of the timer and be careful
of overflows which cause problems for
determining the final result.

eric


On Mon, Mar 14, 2011 at 3:14 PM, Sobit Thapa  wrote:

> Hi,
>
> I need a help regarding computation cost of a function which I want to read
> in
> Micro Second...I need a sample code for Atm128 processor. Can
> anybody please help me...
>
> Its urgent and I appreciate your help.
>
> Regards,
> Sobit
> Graduate Researcher
> Texas State University
>
> ___
> 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

[Tinyos-help] Serial port communication with HPLUARTC

2011-03-14 Thread izzet fatih
Hi,
I am trying to send data over serial port. Since I dont want extra header, I
am using HPLUARTC and UARTComm. Sent byte should be reflected (please see
the code below) back but it seems to be different than the sent data.
For instance..
128 is received for 0
128 or 192 is received for 128
129 or 193 is received for 129
255 is received for 255
191 or 255 is received for 191

It is like only 7 bits are used for data instead of 7 ( and leftmost bit
always 1). I also checked HPLUARTOM to see frame format but it seems ok. (8
data bits, 1 stop bit)

What might be the problem?

Thanks,



configuration TestUartSimple {
}
implementation {
  components Main, HPLUARTC, TestUartSimpleM, TimerC, LedsC, UARTComm as
Comm;

  Main.StdControl -> TimerC.StdControl;
  Main.StdControl -> TestUartSimpleM;

  TestUartSimpleM.CommControl -> Comm;
  TestUartSimpleM.HPLUART -> HPLUARTC;
  TestUartSimpleM.Timer -> TimerC.Timer[unique("Timer")];
  TestUartSimpleM.Leds -> LedsC;
}

///

module TestUartSimpleM {
  provides {
interface StdControl;
  }
  uses {
interface Leds;
interface Timer;
interface HPLUART;
interface StdControl as CommControl;
  }
}
implementation {

  command result_t StdControl.init() {

call Leds.init();
call Leds.yellowOff(); call Leds.redOff(); call Leds.greenOff();

call CommControl.init();
call HPLUART.init();

return SUCCESS;
  }

  command result_t StdControl.start() {
call Timer.start(TIMER_REPEAT, 1000);
call CommControl.start();

return SUCCESS;
  }

  command result_t StdControl.stop() {
call Timer.stop();
call CommControl.stop();

call HPLUART.stop();
return SUCCESS;
  }

  event result_t Timer.fired() {
call Leds.redToggle();
return SUCCESS;
  }

  event async result_t HPLUART.get(uint8_t data) {
call HPLUART.put(data);
call Leds.greenToggle();
return SUCCESS;
  }

  event async result_t HPLUART.putDone() {
call Leds.yellowToggle();
return SUCCESS;
  }

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

Re: [Tinyos-help] Question regarding computation cost of a function in MicroSeconds

2011-03-14 Thread Sobit Thapa
Thank you very much Eric.
What I did is Following (Surprisingly, its not working in desired way.)
Can anyone suggest me?

#include "printf.h"

uint16_t coarseValues;
uint16_t fineValues;
uint16_t COARSECOMPARE = 0x7FFF;
uint16_t fineOffset = 0x000E;
uint16_t coarseOffset = 0x0021;
uint16_t coarseWasCalled = 0;

module ClockCount
{
   provides
   {
  interface TaskCount as TC;
   }

   uses interface HplAtm128Compare;
}

implementation
{

   async event void HplAtm128Compare.fired()
   {
  TCCR3B = 0x00;
  atomic coarseWasCalled++;
  atomic coarseValues++;
  TCNT3 = 0x; //Counter3 clear
  TCCR3B = 0x09;
   }

   async command void TC.startCounting()
   {
  atomic coarseValues = 0;
  atomic fineValues = 0;

  //Actual Timer/Counter
  TCNT3 = 0x;

  //Set counter clear on match (Couter Control Registers)
  TCCR3A = 0x80;
  TCCR3B = 0x09;
  //Interupt mask set (Extended Timer Interrupt Mask Register)
  ETIMSK = 0x10;

  //Compare values (Output Compare Register)
  OCR3A = COARSECOMPARE;

   }

   void calculateFine()
   {
  uint16_t callOffset = (coarseWasCalled * coarseOffset)/COARSECOMPARE;
  //Was Commented
  atomic coarseValues = coarseValues + callOffset;

  if (coarseWasCalled)
  {
 atomic fineValues = TCNT3 - coarseOffset;
 atomic coarseWasCalled = 0;
  }
  else
  {
 //there is a 13 overhead on running the counter
 atomic fineValues = TCNT3 - fineOffset;
  }
   }

   async command void TC.stopCounting()
   {
  TCCR3B = 0x00;
  calculateFine();
   }

   command unsigned int TC.getCoarseValue() {atomic return coarseValues;}
   command unsigned int TC.getFineValue() {atomic return fineValues; }

   command void TC.setCoarseCompare(uint16_t newCompare)
   {
 COARSECOMPARE = newCompare;
 OCR3A = newCompare;
   }

   command void TC.setFineOffset(uint16_t off)
   {
  atomic fineOffset = off;
   }

   command void TC.setCoarseOffset(uint16_t off)
   {
  atomic coarseOffset = off;
   }

   command void TC.sendValuesToScreen()
   {
  printf("Fine Value is %u:\n", fineValues);
  printf("Coarse Value is %u:\n", coarseValues);
  printfflush();
   }
}


Thank you..
Regards,
Sobit
Graduate Researcher
Texas State University



On Mon, Mar 14, 2011 at 5:30 PM, Eric Decker  wrote:

>
> I assume you mean computation cost in terms of time.
>
> I haven't messed with the atmel processors in years and currently am
> working with the msp430 processors
> but the concepts are equivilent.
>
> There should be a h/w timer running on the atm128 that should be ticking at
> 1us.   you need to find that
> timer register and figure out how to snapshot it.
>
> Then you take a snapshot at the start of the code you are measuring and
> then another when the computation
> completes.You need to be aware of the width of the timer and be careful
> of overflows which cause problems for
> determining the final result.
>
> eric
>
>
> On Mon, Mar 14, 2011 at 3:14 PM, Sobit Thapa  wrote:
>
>> Hi,
>>
>> I need a help regarding computation cost of a function which I want to
>> read in
>> Micro Second...I need a sample code for Atm128 processor. Can
>> anybody please help me...
>>
>> Its urgent and I appreciate your help.
>>
>> Regards,
>> Sobit
>> Graduate Researcher
>> Texas State University
>>
>> ___
>> 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
>
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

[Tinyos-help] Storing the RAM of MICAz

2011-03-14 Thread Yasser Zahedi
Hello All,

 Does  CC2420RAM interface help me to write the data into the RAM?

It has these two commands :

command cc2420_status_t *read*(uint8_t offset, uint8_t *data, uint8_t
length)

command cc2420_status_t *write*(uint8_t offset, uint8_t *data, uint8_t
length)

here, how can I get my packet length? and what is the value for "offset"

for packet length I found the following command in "Packet" interface:

command uint8_t
payloadLength(message_t
*msg)

However, even if this works, I want to get the length of the whole frame of
MICAz and not just the payload length.

Thanks in advance

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

[Tinyos-help] Problem ubuntu 10.04

2011-03-14 Thread Jorge Antonio Atempa Camacho
Hi my name is Jorge Atempa i'm student from Instituto tecnologico de
mexicali, i don't speak english but I have a problem with motelist which
recognizes MIB520CA crossbow device, my version of ubuntu is 10.04 and the
TinyOS is 2.1.1

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

Re: [Tinyos-help] CTP timeout-related questions

2011-03-14 Thread David
Thanks for those replies: I have a better understanding now of how the
CTP+LPL timeouts work.

Fyi: I am seeing about 5-6 hour delays in re-establishing the mesh
network when there's a problem

Here's the use case:

- 2 motes, pretty far away from the basestation, but the signal is
able to get through. Each mote is transmitting a sensor reading over
CTP+LPL once a minute (except when the mote is still busy in a sensor
read or send, from a previous cycle).

- Occasionally, something happens to interrupt the mesh network (maybe
something in the office that adds some interference), and then both
the motes drop off the network (basestation stops receiving data over
CTP+LPL), and don't want to come up again again.

- If I take both motes and put them right next to the basestation, the
data still doesn't come through

- About 5-6 hours later, the signals start coming through again on
both motes at around the same time.

I've seen this type of pattern a couple of times so far.

I think that this might be because of the CTP send code on both motes,
taking a very long time to time out, possibly combined with the mesh
network having trouble re-establishing.

If it becomes a problem, I'll see if using the send "cancel" interface
to CTP on the motes helps a bit, to get the data coming through from
the motes again sooner.

Or maybe I need to try something like making all the motes reboot
themselves after an hour of CTP inactivity, or explicitely turning the
CTP algorithm off and on on all the motes, to help restart the logic?

Thanks for your advice so far.

PS: With regards to my earlier question, CTP+LPL, with a 1 second duty
cycle, seems to be working very well for me so far in terms of low
power usage.
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


Re: [Tinyos-help] What does "xx bytes in ROM, xx bytes in RAM" and etc. mean?

2011-03-14 Thread Eric Decker
On Sun, Mar 13, 2011 at 8:09 AM, Xiaohui Liu  wrote:

>
>> yes.  If a global variable is declared const it gets put into rom.
>>
>
> What about global variables not declared as "const"? Where are they
> stored?
>

If initilized, a global variable is put into the "data" section and the
initilized value gets put
into the initilizer block that is stored in ROM.  ie. say we have a global
uint16_t xyz.   xyz will
be located in the "data" section and 2 bytes in the ROM will be allocated
and will hold the value
that xyz should be initilized to.The data initilizer is copied into RAM
by the start up code
before main gets called.

ie.

uint16_t xyz = 0x5412;

0x5412 will be stored in the ROM and gets copied down by the start up code.

If uninitilized the variable is allocated in ".bss" section.   Which gets
zero'd by the start up code.


>
>> If a parameter to a function or a local variable is declared const it
>> simply tells the compiler not
>> to allow any writes to that object.
>>
>>
>>>
>>> If a global variable is initilized it goes into ".data" and there is a
 block of ROM that contains all the initilized data values.
 On start up this block is copied into the .data section that actually
 lives in RAM.

 If a global variable isn't initilized then it goes into the ".bss"
 section.   It gets zero'd on start up.  The name is ancient and comes
 from an old old old (maybe before you were born, gosh that's fun to say)
 IBM assembler directive.   BAL (Basic Assembly Language).


> What is .bss?
>

 Google is your friend.   I did a simple google search for "what is .bss"
 and got the answer.   But that doesn't answer the question
  in the context you are asking.  I don't know what to point you at.
  This is stuff I've picked up over the years.  Probably by asking someone.
 Also I was in on this stuff when it was happening the first time.   Sorry I
 don't have a better answer.

>>>


-- 
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