Group | 1 Feb 2009 01:39
Picon

Unable to load Debug Messages & Radio Model plugins

Hi All,

I have successfully installed TinyOS-1.x on my vista machine. I ran
the Blink application on TinyViz (using 'tinyviz -run
build/pc/main.exe 2' command in opt/tinyos-1.x/apps/Blink directory)
and it was running perfectly. When i enabled Debug Messages and Radio
Model options on TinyViz, I'm unable to view those plugins (Debug
Messages and Radio Model tabs is not getting highlighted). Could you
please let me know what could be the issue.

Thanks,
Rao
Brandon Fu | 1 Feb 2009 05:56
Picon
Favicon

Pls help on PrinfC and Rssi

Hi all,
 
 May I know if the how to download the Rssi demo mentioned in wiki, isit dl from this link? - http://mythicalcomputer.blogspot.com/2008/11/tracking-using-rssi-application-in.html. I would like to ask, if i have -15 rssi value is equal to hw many dbm?
 
 Second qn is on the printf. May i know how to patch the my printf library to my tinyos-2.x. I followed the instruction as mentioned in wiki - http://docs.tinyos.net/index.php/The_TinyOS_printf_Library_%282.0.2_Release%29. I m not using the cvs to dl the latest patch so i copied the patch into a text file and place it in my cygwin folder. After which i copied entered the command patch -p0 < tinyos-2.0-printf.patch to patch them. I seems to have patched them, but i cannot use the components PrintfC and its interface in my program. Did i patch correctly? anyone Can guide me?
 
Thks a million
 
yours sincerely,
Brandon

check out the rest of the Windows Live™. More than mail–Windows Live™ goes way beyond your inbox. More than messages
<div>
Hi all,<br>
&nbsp;<br>
&nbsp;May I know if the how to download the Rssi demo mentioned in wiki, isit dl from this link? - <a href="http://mythicalcomputer.blogspot.com/2008/11/tracking-using-rssi-application-in.html">http://mythicalcomputer.blogspot.com/2008/11/tracking-using-rssi-application-in.html</a>. I would like to ask, if i have -15 rssi value is equal to hw many dbm?<br>
&nbsp;<br>
&nbsp;Second qn is on the printf. May i know how to patch the my printf library to my tinyos-2.x. I followed the instruction as mentioned in wiki - <a href="http://docs.tinyos.net/index.php/The_TinyOS_printf_Library_%282.0.2_Release%29">http://docs.tinyos.net/index.php/The_TinyOS_printf_Library_%282.0.2_Release%29</a>. I m not using the cvs to dl the latest patch so i copied the patch into a text file and place it in my cygwin folder. After which i copied entered the command patch -p0 &lt; tinyos-2.0-printf.patch to patch them. I seems to have patched them, but i cannot use the components PrintfC and its interface in my program. Did i patch correctly? anyone Can guide me?<br>
&nbsp;<br>
Thks a million<br>
&nbsp;<br>
yours sincerely,<br>
Brandon<br><br>check out the rest of the Windows Live&trade;.
More than mail&ndash;Windows Live&trade; goes way beyond your inbox.
 <a href="http://www.microsoft.com/windows/windowslive/" target="_new">More than messages</a>
</div>
Brandon Fu | 1 Feb 2009 07:59
Picon
Favicon

Pls help me - Help on Multihop

Hi all,
 I am currently, doing a project on data collection and i doing the last part of the project. The last part of my project is to transmit a packet from child node to a parent node to the base station. To implement this i knw i would have to use the multihop protocol. But I m not really sure how do i implement it.
 
 May I know what shld i use CTP or dymo protocol? In order to create the parent nodes do i have to treat the nodes as one of the root collector besides the base station? Currently, what i have done is just forward the packets (from the 3 motes which i am given to work on for my proj) to a base station. How do i treat a node as a parent and do the forwarding to another parent and eventually forward to the base station?
 
Anyone can provide me with enlightments?
 
yours sincerely
Brandon

Chat online and in real-time with friends and family! Windows Live Messenger
<div>
Hi all,<br>
&nbsp;I am currently, doing a project on data collection and i doing the last part of the project. The last part of my project is to transmit a packet from child node to a parent node to the base station. To implement this i knw i would have to use the multihop protocol. But I m not really sure how do i implement it.<br>
&nbsp;<br>
&nbsp;May I know what shld i use CTP or dymo protocol? In order to create the parent nodes do i have to treat the nodes as one of the root collector besides the base station? Currently, what i have done is just forward the packets (from the 3 motes which i am given to work on for my proj)&nbsp;to a base station. How do i treat a node as a parent and do the forwarding to another parent and eventually forward to the base station?<br>
&nbsp;<br>
Anyone can provide me with enlightments?<br>
&nbsp;<br>
yours sincerely <br>
Brandon<br><br>Chat online and in real-time with friends and family! <a href="http://get.live.com/messenger/overview" target="_new">Windows Live Messenger</a>
</div>
Omprakash Gnawali | 1 Feb 2009 08:07
Picon

Re: Pls help me - Help on Multihop

On Sat, Jan 31, 2009 at 10:59 PM, Brandon Fu <brandon_fu <at> hotmail.com> wrote:
> Hi all,
>  I am currently, doing a project on data collection and i doing the last
> part of the project. The last part of my project is to transmit a packet
> from child node to a parent node to the base station. To implement this i
> knw i would have to use the multihop protocol. But I m not really sure how
> do i implement it.
>
>  May I know what shld i use CTP or dymo protocol? In order to create the
> parent nodes do i have to treat the nodes as one of the root collector
> besides the base station? Currently, what i have done is just forward the
> packets (from the 3 motes which i am given to work on for my proj) to a base
> station. How do i treat a node as a parent and do the forwarding to another
> parent and eventually forward to the base station?
>
> Anyone can provide me with enlightments?
>

CTP already does what you want to do. You should read the code for CTP
to understand how it determines the parent node and forwards packets
to the root. You can find the code at tos/lib/net/ctp. You can look at
apps/MultihopOscilloscope to understand how to use CTP.

- om_p
David Mehrzadi | 1 Feb 2009 09:45
Picon

Question about changing power transmission in Telosb

Hi;
I am working with Telosb sensors in my research, I have some questions:
how to change the power transmission in Telosb sensors?
how can I change it dynamically in a node. e.g. to increase/decrease the transmission power when receiving some packet?

 thanks
<div><div dir="ltr"> Hi;<br>I am working with Telosb sensors in my research, I have some questions:<br>how to change the power transmission in Telosb sensors?<br> how can I change it dynamically in a node. e.g. to increase/decrease the transmission power when receiving&nbsp;some packet?<br><br>&nbsp;thanks<br>
</div></div>
Razvan Musaloiu-E. | 1 Feb 2009 09:55

Re: Question about changing power transmission in Telosb

Hi!

On Sun, 1 Feb 2009, David Mehrzadi wrote:

> Hi;
> I am working with Telosb sensors in my research, I have some questions:
> how to change the power transmission in Telosb sensors?
> how can I change it dynamically in a node. e.g. to increase/decrease the
> transmission power when receiving some packet?
>

The interface you are interested in is called CC2420Packet.nc and is 
located in tos/chips/cc2420/interfaces. The top-level component that 
provides it is CC2420ActiveMessageC.

All the best!
Razvan ME
Vlado Handziski | 2 Feb 2009 05:15
Picon
Favicon

Re: Fw: Re: for Tinyos 2.x bugs...

Hi,

please post here more details about the problem and your patch.

Vlado

2009/1/31 이기섭 <gslee <at> hallym.ac.kr>
Dear tinyos-help

Could you receive the fixed file for the problem which is described below 
and update it into the tinyos project?

K.S.Lee


----- Original Message -----
From: Philip Levis <pal <at> cs.stanford.edu>
To: 이기섭 <gslee <at> hallym.ac.kr>
Cc: cssharp <at> eecs.berkeley.edu, Vlado Handziski <handzisk <at> tkn.tu-berlin.de>, Joe Polastre <polastre <at> cs.berkeley.edu>
Sent: 2009/01/31 13:49
Subject: Re: for Tinyos 2.x bugs...


On Jan 30, 2009, at 8:05 PM, Joe Polastre wrote:

> please contact Phil Levis, pal <at> cs.stanford.edu
>
> Best,
> -Joe
>
> On Fri, Jan 30, 2009 at 7:39 PM, 이기섭 <gslee <at> hallym.ac.kr> wrote:
>>
>> Dear Joe Polastre , Cory Sharp and Vlado Handziski,
>>
>> I had developed our system with tinyos-2.x on last year.
>> I found the bug in tinyos-2.0 source code for MSP430 PLL problem
>> at power
>> up.
>>
>> I think the recent version does not fix this problem. If sink mote
>> will be
>> used
>> with unstable DC power supply, it can be operated incorrectly on
>> RS232 bit
>> rate.
>> Thus the gateway which is located upper layer of sink mote can not
>> receive
>> uploading packet.
>> Now, "the unstable DC power supply" is only meaning which rising
>> slop on
>> power-on
>> is low.
>>
>> Could I send a file which was fixed for this problem?
>> in the Tinyos.net site, the bug report menu is not operating now.
>> And the e-mail accounts which is cssharp and handzisk are not
>> response .
>>
>> Yours sincerely,
>> K.S.Lee


K.S.,

Better yet, please email tinyos-help!

Phil

_______________________________________________
Tinyos-help mailing list
Tinyos-help <at> millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

<div>
<p>Hi,<br><br>please post here more details about the problem and your patch.<br><br>Vlado<br><br></p>
<div class="gmail_quote">2009/1/31 &#51060;&#44592;&#49453; <span dir="ltr">&lt;<a href="mailto:gslee <at> hallym.ac.kr">gslee <at> hallym.ac.kr</a>&gt;</span><br><blockquote class="gmail_quote">                                              Dear tinyos-help<br><br>Could you receive the fixed file for the problem which is described below&nbsp;<br>and update it into the tinyos project?<br><br>K.S.Lee<div>
<div></div>
<div class="Wj3C7c">
<br><br><blockquote>----- Original Message -----<br>From: Philip Levis &lt;<a href="mailto:pal <at> cs.stanford.edu" target="_blank">pal <at> cs.stanford.edu</a>&gt;<br>To: &#51060;&#44592;&#49453; &lt;<a href="mailto:gslee <at> hallym.ac.kr" target="_blank">gslee <at> hallym.ac.kr</a>&gt;<br>Cc: <a href="mailto:cssharp <at> eecs.berkeley.edu" target="_blank">cssharp <at> eecs.berkeley.edu</a>, Vlado Handziski &lt;<a href="mailto:handzisk <at> tkn.tu-berlin.de" target="_blank">handzisk <at> tkn.tu-berlin.de</a>&gt;, Joe Polastre &lt;<a href="mailto:polastre <at> cs.berkeley.edu" target="_blank">polastre <at> cs.berkeley.edu</a>&gt;<br>Sent: 2009/01/31 13:49<br>Subject: Re: for Tinyos 2.x bugs...<br><br><br>On Jan 30, 2009, at 8:05 PM, Joe Polastre wrote:<br><br>&gt; please contact Phil Levis, <a href="mailto:pal <at> cs.stanford.edu" target="_blank">pal <at> cs.stanford.edu</a><br>
&gt;<br>&gt; Best,<br>&gt; -Joe<br>&gt;<br>&gt; On Fri, Jan 30, 2009 at 7:39 PM, &#51060;&#44592;&#49453; &lt;<a href="mailto:gslee <at> hallym.ac.kr" target="_blank">gslee <at> hallym.ac.kr</a>&gt; wrote:<br>&gt;&gt;<br>&gt;&gt; Dear Joe Polastre , Cory Sharp and Vlado Handziski,<br>
&gt;&gt;<br>&gt;&gt; I had developed our system with tinyos-2.x on last year.<br>&gt;&gt; I found the bug in tinyos-2.0 source code for MSP430 PLL problem <br>&gt;&gt; at power<br>&gt;&gt; up.<br>&gt;&gt;<br>&gt;&gt; I think the recent version does not fix this problem. If sink mote <br>
&gt;&gt; will be<br>&gt;&gt; used<br>&gt;&gt; with unstable DC power supply, it can be operated incorrectly on <br>&gt;&gt; RS232 bit<br>&gt;&gt; rate.<br>&gt;&gt; Thus the gateway which is located upper layer of sink mote can not <br>
&gt;&gt; receive<br>&gt;&gt; uploading packet.<br>&gt;&gt; Now, "the unstable DC power supply" is only meaning which rising <br>&gt;&gt; slop on<br>&gt;&gt; power-on<br>&gt;&gt; is low.<br>&gt;&gt;<br>&gt;&gt; Could I send a file which was fixed for this problem?<br>
&gt;&gt; in the Tinyos.net site, the bug report menu is not operating now.<br>&gt;&gt; And the e-mail accounts which is cssharp and handzisk are not <br>&gt;&gt; response .<br>&gt;&gt;<br>&gt;&gt; Yours sincerely,<br>&gt;&gt; K.S.Lee<br><br><br>K.S.,<br><br>Better yet, please email tinyos-help!<br><br>Phil</blockquote>
</div>
</div>
<br>_______________________________________________<br>
Tinyos-help mailing list<br><a href="mailto:Tinyos-help <at> millennium.berkeley.edu">Tinyos-help <at> millennium.berkeley.edu</a><br><a href="https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help" target="_blank">https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help</a><br>
</blockquote>
</div>
<br>
</div>
mahendra nimishakavi | 2 Feb 2009 05:58
Picon

help needed

I have installed tinyos-1.x and trying to build a simulation for an example using make micaz sim.
 But nothing seems to work. The following error occurs:

Blink.nc:42: component Main not found
In file included from Blink.nc:42:
In component `BlinkM':
BlinkM.nc:41: too few arguments to interface `Timer'
In file included from Blink.nc:42:
BlinkM.nc:52: syntax error before `StdControl'
In file included from Blink.nc:42:
In component `SingleTimer':
SingleTimer.nc:47: too few arguments to interface `Timer'
SingleTimer.nc:52: component TimerC not found
SingleTimer.nc:54: cannot find `Timer'
SingleTimer.nc:55: no match
In component `Blink':
Blink.nc:43: cannot find `StdControl'
Blink.nc:44: cannot find `StdControl'
Blink.nc:45: cannot find `Timer'
Blink.nc:46: cannot find `Leds'
make: *** [sim-exe] Error 1

Please help me with this. Thanks in advance.

N.Mahendra.

<div><p>I have installed tinyos-1.x and trying to build a simulation for an example using make micaz sim.<br>&nbsp;But nothing seems to work. The following error occurs:<br><br>Blink.nc:42: component Main not found<br>In file included from Blink.nc:42:<br>
In component `BlinkM':<br>BlinkM.nc:41: too few arguments to interface `Timer'<br>In file included from Blink.nc:42:<br>BlinkM.nc:52: syntax error before `StdControl'<br>In file included from Blink.nc:42:<br>In component `SingleTimer':<br>
SingleTimer.nc:47: too few arguments to interface `Timer'<br>SingleTimer.nc:52: component TimerC not found<br>SingleTimer.nc:54: cannot find `Timer'<br>SingleTimer.nc:55: no match<br>In component `Blink':<br>Blink.nc:43: cannot find `StdControl'<br>
Blink.nc:44: cannot find `StdControl'<br>Blink.nc:45: cannot find `Timer'<br>Blink.nc:46: cannot find `Leds'<br>make: *** [sim-exe] Error 1<br><br>Please help me with this. Thanks in advance.<br><br>N.Mahendra.<br></p></div>
이기섭 | 2 Feb 2009 08:22
Picon

Re: Fw: Re: for Tinyos 2.x bugs...

Hi,
In the last of this mail , temporary fixed code exist. It should be located 
in c:\cygwin\opt\tinyos-2.x\tos\chips\msp430\timer\Msp430ClockP.nc
But if you understand problem exactly , you can apply it to any file which is proper location.

If you want to reproduce it, 
1. provide a BaseStation mote and Laboratary Power supply.
   connect power supply and the basestation. increase voltage level from zero to 3.3V very slowly.
2. Then , probe RS-232 bit rate of the Basestation by Oscillosope. you can see the bit rate is 
   incorrect. thus gateway can not read these datas. 

 in the msp430 user guide(SLAU049xxx.pdf), the ch4 Basic clock module has 
fault oscillator problem. but I think oscillator fault problem is different with this.
this is wrong oscillation of PLL which has problem in slow transition power supply.

if there is reset-IC, it can help this problem. But in the telosb clone board does not have
reset-IC. thus I use internal voltage detector function of msp430.

//tinyos latest version. FEB 2, 2009.
//======c:\cygwin\opt\tinyos-2.x\tos\chips\msp430\timer\Msp430ClockP.nc====

module Msp430ClockP <at> safe()
{
  provides interface Init;
  provides interface Msp430ClockInit;
}
implementation
{
 uint8_t gSVSvalue;
 
 
  MSP430REG_NORACE(IE1);
  MSP430REG_NORACE(TACTL);
  MSP430REG_NORACE(TAIV);
  MSP430REG_NORACE(TBCTL);
  MSP430REG_NORACE(TBIV);

  enum
  {
    ACLK_CALIB_PERIOD = 8,
    TARGET_DCO_DELTA = (TARGET_DCO_KHZ / ACLK_KHZ) * ACLK_CALIB_PERIOD,
  };

void MeasureAVCC();
 void MyWait(uint16_t arg1);
 

  command void Msp430ClockInit.defaultSetupDcoCalibrate()
  {
 
    // --- setup ---

    TACTL = TASSEL1 | MC1; // source SMCLK, continuous mode, everything else 0
    TBCTL = TBSSEL0 | MC1;
    BCSCTL1 = XT2OFF | RSEL2;
    BCSCTL2 = 0;
    TBCCTL0 = CM0;
   }
   
  command void Msp430ClockInit.defaultInitClocks()
  {
    // BCSCTL1
    // .XT2OFF = 1; disable the external oscillator for SCLK and MCLK
    // .XTS = 0; set low frequency mode for LXFT1
    // .DIVA = 0; set the divisor on ACLK to 1
    // .RSEL, do not modify
    BCSCTL1 = XT2OFF | (BCSCTL1 & (RSEL2|RSEL1|RSEL0));

    // BCSCTL2
    // .SELM = 0; select DCOCLK as source for MCLK
    // .DIVM = 0; set the divisor of MCLK to 1
    // .SELS = 0; select DCOCLK as source for SCLK
    // .DIVS = 2; set the divisor of SCLK to 4
    // .DCOR = 0; select internal resistor for DCO
    BCSCTL2 = DIVS1;

    // IE1.OFIE = 0; no interrupt for oscillator fault
    CLR_FLAG( IE1, OFIE );
  }

  command void Msp430ClockInit.defaultInitTimerA()
  {
    TAR = 0;

    // TACTL
    // .TACLGRP = 0; each TACL group latched independently
    // .CNTL = 0; 16-bit counter
    // .TASSEL = 2; source SMCLK = DCO/4
    // .ID = 0; input divisor of 1
    // .MC = 0; initially disabled
    // .TACLR = 0; reset timer A
    // .TAIE = 1; enable timer A interrupts
    TACTL = TASSEL1 | TAIE;
  }

  command void Msp430ClockInit.defaultInitTimerB()
  {
    TBR = 0;

    // TBCTL
    // .TBCLGRP = 0; each TBCL group latched independently
    // .CNTL = 0; 16-bit counter
    // .TBSSEL = 1; source ACLK
    // .ID = 0; input divisor of 1
    // .MC = 0; initially disabled
    // .TBCLR = 0; reset timer B
    // .TBIE = 1; enable timer B interrupts
    TBCTL = TBSSEL0 | TBIE;
  }

  default event void Msp430ClockInit.setupDcoCalibrate()
  {
    call Msp430ClockInit.defaultSetupDcoCalibrate();
  }
 
  default event void Msp430ClockInit.initClocks()
  {
    call Msp430ClockInit.defaultInitClocks();
  }

  default event void Msp430ClockInit.initTimerA()
  {
    call Msp430ClockInit.defaultInitTimerA();
  }

  default event void Msp430ClockInit.initTimerB()
  {
    call Msp430ClockInit.defaultInitTimerB();
  }


  void startTimerA()
  {
    // TACTL.MC = 2; continuous mode
    TACTL = MC1 | (TACTL & ~(MC1|MC0));
  }

  void stopTimerA()
  {
    //TACTL.MC = 0; stop timer B
    TACTL = TACTL & ~(MC1|MC0);
  }

  void startTimerB()
  {
    // TBCTL.MC = 2; continuous mode
    TBCTL = MC1 | (TBCTL & ~(MC1|MC0));
  }

  void stopTimerB()
  {
    //TBCTL.MC = 0; stop timer B
    TBCTL = TBCTL & ~(MC1|MC0);
  }

  void set_dco_calib( int calib )
  {
    BCSCTL1 = (BCSCTL1 & ~0x07) | ((calib >> 8) & 0x07);
    DCOCTL = calib & 0xff;
  }

  uint16_t test_calib_busywait_delta( int calib )
  {
    int8_t aclk_count = 2;
    uint16_t dco_prev = 0;
    uint16_t dco_curr = 0;

    set_dco_calib( calib );

    while( aclk_count-- > 0 )
    {
      TBCCR0 = TBR + ACLK_CALIB_PERIOD; // set next interrupt
      TBCCTL0 &= ~CCIFG; // clear pending interrupt
      while( (TBCCTL0 & CCIFG) == 0 ); // busy wait
      dco_prev = dco_curr;
      dco_curr = TAR;
    }

    return dco_curr - dco_prev;
  }

  // busyCalibrateDCO
  // Should take about 9ms if ACLK_CALIB_PERIOD=8.
  // DCOCTL and BCSCTL1 are calibrated when done.
  void busyCalibrateDco()
  {
    // --- variables ---
    int calib;
    int step;

    // --- calibrate ---

    // Binary search for RSEL,DCO,DCOMOD.
    // It's okay that RSEL isn't monotonic.

    for( calib=0,step=0x800; step!=0; step>>=1 )
    {
      // if the step is not past the target, commit it
      if( test_calib_busywait_delta(calib|step) <= TARGET_DCO_DELTA )
        calib |= step;
    }

    // if DCOx is 7 (0x0e0 in calib), then the 5-bit MODx is not useable, set it to 0
    if( (calib & 0x0e0) == 0x0e0 )
      calib &= ~0x01f;

    set_dco_calib( calib );
  }

  command error_t Init.init()
  {
    // Reset timers and clear interrupt vectors
    TACTL = TACLR;
    TAIV = 0;
    TBCTL = TBCLR;
    TBIV = 0;

    
    //Wait until which the VACC will 3.0V and then DCO should oscillation correctly.
    //If the power supply for the sink mote is unstable,
    //the DCO will be setted wrong and UART asynchronous data timing will be corrupted.
    //from MSP430 datasheet.
 #if 1  
    do{
     MeasureAVCC();
     if((gSVSvalue >= 0xB)&&(gSVSvalue <0xF)){//if it larger then 3.05V and smaller then 3.7V
      break;//OK....
     }
    
     if(gSVSvalue==0xF)break;  //it has error , but it must run the others job....!!!!
    
 }while(1);
#endif
 
    atomic
    {
      signal Msp430ClockInit.setupDcoCalibrate();
      busyCalibrateDco();
      signal Msp430ClockInit.initClocks();
      signal Msp430ClockInit.initTimerA();
      signal Msp430ClockInit.initTimerB();
      startTimerA();
      startTimerB();
    }

    return SUCCESS;
  }
 
//=========================
//These are temporary functions.
#define SVSCTL_REG ((unsigned char *)(0x55))
#define SVSOP               0x02
void MyWait(uint16_t arg1)
{
 uint16_t i,k;
 
 for(i=0; i<arg1; i++){

  nop(); //nop in telosb.
 
 }
 
}

void MeasureAVCC(){
 uint8_t i;
 
 *SVSCTL_REG =( 1<<4); //init with 1.9V comparation.
 MyWait(1200);   //off to on delay is 150 us.
 
 for(i=1;i<14;i++){
  *SVSCTL_REG=(i<<4);
  MyWait(96);  //each steps delay is 12us.
  
  if((*SVSCTL_REG) & SVSOP){
   gSVSvalue=i;
   *SVSCTL_REG =0; //off SVS to conserve power
   return;
  }
  
  
 }
 
 *SVSCTL_REG =0; //off SVS to conserve power

 gSVSvalue=15;  //indicate error.
 
}
 
}
 

----- Original Message -----
From: Vlado Handziski <handzisk <at> tkn.tu-berlin.de>
To: 이기섭 <gslee <at> hallym.ac.kr>
Cc: tinyos-help <at> millennium.berkeley.edu
Sent: 2009/02/02 13:15
Subject: Re: [Tinyos-help] Fw: Re: for Tinyos 2.x bugs...

Hi,

please post here more details about the problem and your patch.

Vlado

2009/1/31 이기섭 <gslee <at> hallym.ac.kr>
Dear tinyos-help

Could you receive the fixed file for the problem which is described below 
and update it into the tinyos project?

K.S.Lee


----- Original Message -----
From: Philip Levis <pal <at> cs.stanford.edu>
To: 이기섭 <gslee <at> hallym.ac.kr>
Cc: cssharp <at> eecs.berkeley.edu, Vlado Handziski <handzisk <at> tkn.tu-berlin.de>, Joe Polastre <polastre <at> cs.berkeley.edu>
Sent: 2009/01/31 13:49
Subject: Re: for Tinyos 2.x bugs...


On Jan 30, 2009, at 8:05 PM, Joe Polastre wrote:

> please contact Phil Levis, pal <at> cs.stanford.edu
>
> Best,
> -Joe
>
> On Fri, Jan 30, 2009 at 7:39 PM, 이기섭 <gslee <at> hallym.ac.kr> wrote:
>>
>> Dear Joe Polastre , Cory Sharp and Vlado Handziski,
>>
>> I had developed our system with tinyos-2.x on last year.
>> I found the bug in tinyos-2.0 source code for MSP430 PLL problem
>> at power
>> up.
>>
>> I think the recent version does not fix this problem. If sink mote
>> will be
>> used
>> with unstable DC power supply, it can be operated incorrectly on
>> RS232 bit
>> rate...
>> Thus the gateway which is located upper layer of sink mote can not
>> receive
>> uploading packet.
>> Now, "the unstable DC power supply" is only meaning which rising
>> slop on
>> power-on
>> is low.
>>
>> Could I send a file which was fixed for this problem?
>> in the Tinyos.net site, the bug report menu is not operating now.
>> And the e-mail accounts which is cssharp and handzisk are not
>> response .
>>
>> Yours sincerely,
>> K.S.Lee


K.S.,

Better yet, please email tinyos-help!

Phil

_______________________________________________
Tinyos-help mailing list
Tinyos-help <at> millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

<div>
<p>Hi,<br>In the last of this mail , temporary fixed code exist. It should be located&nbsp;<br>in c:\cygwin\opt\tinyos-2.x\tos\chips\msp430\timer\Msp430ClockP.nc<br>But if you understand problem exactly , you can apply it to any file which is proper location.<br><br>If you want to reproduce it,&nbsp;<br>1. provide a BaseStation mote and Laboratary Power supply.<br>&nbsp;&nbsp; connect power supply and&nbsp;the basestation. increase&nbsp;voltage level&nbsp;from zero to 3.3V very slowly.<br>2. Then ,&nbsp;probe RS-232 bit rate of the Basestation by Oscillosope. you can see the bit rate is&nbsp;<br>&nbsp;&nbsp; incorrect. thus gateway can not read these datas.&nbsp;<br><br>&nbsp;in the msp430 user guide(SLAU049xxx.pdf), the ch4 Basic clock module has&nbsp;<br>fault oscillator problem. but&nbsp;I think oscillator fault problem is different with this.<br>this is wrong oscillation of PLL which has problem in slow transition power supply.<br><br>if there is reset-IC, it can help this problem. But in the telosb clone board does not have<br>reset-IC. thus I use internal voltage detector function of msp430.<br><br>//tinyos latest version. FEB 2, 2009.<br>//======c:\cygwin\opt\tinyos-2.x\tos\chips\msp430\timer\Msp430ClockP.nc====<br><br>module Msp430ClockP  <at> safe()<br>{<br>&nbsp; provides interface Init;<br>&nbsp; provides interface Msp430ClockInit;<br>}<br>implementation<br>{<br>&nbsp;uint8_t gSVSvalue;<br>&nbsp;<br>&nbsp;<br>&nbsp; MSP430REG_NORACE(IE1);<br>&nbsp; MSP430REG_NORACE(TACTL);<br>&nbsp; MSP430REG_NORACE(TAIV);<br>&nbsp; MSP430REG_NORACE(TBCTL);<br>&nbsp; MSP430REG_NORACE(TBIV);</p>
<p>&nbsp; enum<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; ACLK_CALIB_PERIOD = 8,<br>&nbsp;&nbsp;&nbsp; TARGET_DCO_DELTA = (TARGET_DCO_KHZ / ACLK_KHZ) * ACLK_CALIB_PERIOD,<br>&nbsp; };</p>
<p>void MeasureAVCC();<br>&nbsp;void MyWait(uint16_t arg1);<br>&nbsp;</p>
<p>&nbsp; command void Msp430ClockInit.defaultSetupDcoCalibrate()<br>&nbsp; {<br>&nbsp; <br>&nbsp;&nbsp;&nbsp; // --- setup ---</p>
<p>&nbsp;&nbsp;&nbsp; TACTL = TASSEL1 | MC1; // source SMCLK, continuous mode, everything else 0<br>&nbsp;&nbsp;&nbsp; TBCTL = TBSSEL0 | MC1;<br>&nbsp;&nbsp;&nbsp; BCSCTL1 = XT2OFF | RSEL2;<br>&nbsp;&nbsp;&nbsp; BCSCTL2 = 0;<br>&nbsp;&nbsp;&nbsp; TBCCTL0 = CM0;<br>&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp; command void Msp430ClockInit.defaultInitClocks()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; // BCSCTL1<br>&nbsp;&nbsp;&nbsp; // .XT2OFF = 1; disable the external oscillator for SCLK and MCLK<br>&nbsp;&nbsp;&nbsp; // .XTS = 0; set low frequency mode for LXFT1<br>&nbsp;&nbsp;&nbsp; // .DIVA = 0; set the divisor on ACLK to 1<br>&nbsp;&nbsp;&nbsp; // .RSEL, do not modify<br>&nbsp;&nbsp;&nbsp; BCSCTL1 = XT2OFF | (BCSCTL1 &amp; (RSEL2|RSEL1|RSEL0));</p>
<p>&nbsp;&nbsp;&nbsp; // BCSCTL2<br>&nbsp;&nbsp;&nbsp; // .SELM = 0; select DCOCLK as source for MCLK<br>&nbsp;&nbsp;&nbsp; // .DIVM = 0; set the divisor of MCLK to 1<br>&nbsp;&nbsp;&nbsp; // .SELS = 0; select DCOCLK as source for SCLK<br>&nbsp;&nbsp;&nbsp; // .DIVS = 2; set the divisor of SCLK to 4<br>&nbsp;&nbsp;&nbsp; // .DCOR = 0; select internal resistor for DCO<br>&nbsp;&nbsp;&nbsp; BCSCTL2 = DIVS1;</p>
<p>&nbsp;&nbsp;&nbsp; // IE1.OFIE = 0; no interrupt for oscillator fault<br>&nbsp;&nbsp;&nbsp; CLR_FLAG( IE1, OFIE );<br>&nbsp; }</p>
<p>&nbsp; command void Msp430ClockInit.defaultInitTimerA()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; TAR = 0;</p>
<p>&nbsp;&nbsp;&nbsp; // TACTL<br>&nbsp;&nbsp;&nbsp; // .TACLGRP = 0; each TACL group latched independently<br>&nbsp;&nbsp;&nbsp; // .CNTL = 0; 16-bit counter<br>&nbsp;&nbsp;&nbsp; // .TASSEL = 2; source SMCLK = DCO/4<br>&nbsp;&nbsp;&nbsp; // .ID = 0; input divisor of 1<br>&nbsp;&nbsp;&nbsp; // .MC = 0; initially disabled<br>&nbsp;&nbsp;&nbsp; // .TACLR = 0; reset timer A<br>&nbsp;&nbsp;&nbsp; // .TAIE = 1; enable timer A interrupts<br>&nbsp;&nbsp;&nbsp; TACTL = TASSEL1 | TAIE;<br>&nbsp; }</p>
<p>&nbsp; command void Msp430ClockInit.defaultInitTimerB()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; TBR = 0;</p>
<p>&nbsp;&nbsp;&nbsp; // TBCTL<br>&nbsp;&nbsp;&nbsp; // .TBCLGRP = 0; each TBCL group latched independently<br>&nbsp;&nbsp;&nbsp; // .CNTL = 0; 16-bit counter<br>&nbsp;&nbsp;&nbsp; // .TBSSEL = 1; source ACLK<br>&nbsp;&nbsp;&nbsp; // .ID = 0; input divisor of 1<br>&nbsp;&nbsp;&nbsp; // .MC = 0; initially disabled<br>&nbsp;&nbsp;&nbsp; // .TBCLR = 0; reset timer B<br>&nbsp;&nbsp;&nbsp; // .TBIE = 1; enable timer B interrupts<br>&nbsp;&nbsp;&nbsp; TBCTL = TBSSEL0 | TBIE;<br>&nbsp; }</p>
<p>&nbsp; default event void Msp430ClockInit.setupDcoCalibrate()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; call Msp430ClockInit.defaultSetupDcoCalibrate();<br>&nbsp; }<br>&nbsp; <br>&nbsp; default event void Msp430ClockInit.initClocks()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; call Msp430ClockInit.defaultInitClocks();<br>&nbsp; }</p>
<p>&nbsp; default event void Msp430ClockInit.initTimerA()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; call Msp430ClockInit.defaultInitTimerA();<br>&nbsp; }</p>
<p>&nbsp; default event void Msp430ClockInit.initTimerB()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; call Msp430ClockInit.defaultInitTimerB();<br>&nbsp; }</p>
<p><br>&nbsp; void startTimerA()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; // TACTL.MC = 2; continuous mode<br>&nbsp;&nbsp;&nbsp; TACTL = MC1 | (TACTL &amp; ~(MC1|MC0));<br>&nbsp; }</p>
<p>&nbsp; void stopTimerA()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; //TACTL.MC = 0; stop timer B<br>&nbsp;&nbsp;&nbsp; TACTL = TACTL &amp; ~(MC1|MC0);<br>&nbsp; }</p>
<p>&nbsp; void startTimerB()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; // TBCTL.MC = 2; continuous mode<br>&nbsp;&nbsp;&nbsp; TBCTL = MC1 | (TBCTL &amp; ~(MC1|MC0));<br>&nbsp; }</p>
<p>&nbsp; void stopTimerB()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; //TBCTL.MC = 0; stop timer B<br>&nbsp;&nbsp;&nbsp; TBCTL = TBCTL &amp; ~(MC1|MC0);<br>&nbsp; }</p>
<p>&nbsp; void set_dco_calib( int calib )<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; BCSCTL1 = (BCSCTL1 &amp; ~0x07) | ((calib &gt;&gt; 8) &amp; 0x07);<br>&nbsp;&nbsp;&nbsp; DCOCTL = calib &amp; 0xff;<br>&nbsp; }</p>
<p>&nbsp; uint16_t test_calib_busywait_delta( int calib )<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; int8_t aclk_count = 2;<br>&nbsp;&nbsp;&nbsp; uint16_t dco_prev = 0;<br>&nbsp;&nbsp;&nbsp; uint16_t dco_curr = 0;</p>
<p>&nbsp;&nbsp;&nbsp; set_dco_calib( calib );</p>
<p>&nbsp;&nbsp;&nbsp; while( aclk_count-- &gt; 0 )<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TBCCR0 = TBR + ACLK_CALIB_PERIOD; // set next interrupt<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TBCCTL0 &amp;= ~CCIFG; // clear pending interrupt<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while( (TBCCTL0 &amp; CCIFG) == 0 ); // busy wait<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dco_prev = dco_curr;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dco_curr = TAR;<br>&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; return dco_curr - dco_prev;<br>&nbsp; }</p>
<p>&nbsp; // busyCalibrateDCO<br>&nbsp; // Should take about 9ms if ACLK_CALIB_PERIOD=8.<br>&nbsp; // DCOCTL and BCSCTL1 are calibrated when done.<br>&nbsp; void busyCalibrateDco()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; // --- variables ---<br>&nbsp;&nbsp;&nbsp; int calib;<br>&nbsp;&nbsp;&nbsp; int step;</p>
<p>&nbsp;&nbsp;&nbsp; // --- calibrate ---</p>
<p>&nbsp;&nbsp;&nbsp; // Binary search for RSEL,DCO,DCOMOD.<br>&nbsp;&nbsp;&nbsp; // It's okay that RSEL isn't monotonic.</p>
<p>&nbsp;&nbsp;&nbsp; for( calib=0,step=0x800; step!=0; step&gt;&gt;=1 )<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // if the step is not past the target, commit it<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( test_calib_busywait_delta(calib|step) &lt;= TARGET_DCO_DELTA )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; calib |= step;<br>&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; // if DCOx is 7 (0x0e0 in calib), then the 5-bit MODx is not useable, set it to 0<br>&nbsp;&nbsp;&nbsp; if( (calib &amp; 0x0e0) == 0x0e0 )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; calib &amp;= ~0x01f;</p>
<p>&nbsp;&nbsp;&nbsp; set_dco_calib( calib );<br>&nbsp; }</p>
<p>&nbsp; command error_t Init.init()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; // Reset timers and clear interrupt vectors<br>&nbsp;&nbsp;&nbsp; TACTL = TACLR;<br>&nbsp;&nbsp;&nbsp; TAIV = 0;<br>&nbsp;&nbsp;&nbsp; TBCTL = TBCLR;<br>&nbsp;&nbsp;&nbsp; TBIV = 0;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp; //Wait until which the VACC will 3.0V and then DCO should oscillation correctly.<br>&nbsp;&nbsp;&nbsp; //If the power supply for the sink mote is unstable, <br>&nbsp;&nbsp;&nbsp; //the DCO will be setted wrong and UART asynchronous data timing will be corrupted. <br>&nbsp;&nbsp;&nbsp; //from MSP430 datasheet.<br>&nbsp;#if 1&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; do{<br>&nbsp;&nbsp;&nbsp;&nbsp; MeasureAVCC();<br>&nbsp;&nbsp;&nbsp;&nbsp; if((gSVSvalue &gt;= 0xB)&amp;&amp;(gSVSvalue &lt;0xF)){//if it larger then 3.05V and smaller then 3.7V<br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;break;//OK....<br>&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; if(gSVSvalue==0xF)break;&nbsp;&nbsp;//it has error , but it must run the others job....!!!!<br>&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;}while(1);<br>#endif<br>&nbsp;<br>&nbsp;&nbsp;&nbsp; atomic<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; signal Msp430ClockInit.setupDcoCalibrate();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; busyCalibrateDco();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; signal Msp430ClockInit.initClocks();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; signal Msp430ClockInit.initTimerA();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; signal Msp430ClockInit.initTimerB();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; startTimerA();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; startTimerB();<br>&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; return SUCCESS;<br>&nbsp; }<br>&nbsp; <br>//=========================<br>//These are temporary functions.<br>#define SVSCTL_REG ((unsigned char *)(0x55))<br>#define SVSOP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x02<br>void MyWait(uint16_t arg1)<br>{<br>&nbsp;uint16_t i,k;<br>&nbsp;<br>&nbsp;for(i=0; i&lt;arg1;&nbsp;i++){</p>
<p>&nbsp;&nbsp;nop();&nbsp;//nop in telosb.<br>&nbsp;<br>&nbsp;}<br>&nbsp;<br>}<br><br>void MeasureAVCC(){<br>&nbsp;uint8_t i;<br>&nbsp;<br>&nbsp;*SVSCTL_REG&nbsp;=( 1&lt;&lt;4);&nbsp;//init with 1.9V comparation.<br>&nbsp;MyWait(1200);&nbsp;&nbsp;&nbsp;//off to on delay is 150 us.<br>&nbsp;<br>&nbsp;for(i=1;i&lt;14;i++){<br>&nbsp;&nbsp;*SVSCTL_REG=(i&lt;&lt;4);<br>&nbsp;&nbsp;MyWait(96);&nbsp;&nbsp;//each steps delay is 12us.<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;if((*SVSCTL_REG) &amp; SVSOP){<br>&nbsp;&nbsp;&nbsp;gSVSvalue=i;<br>&nbsp;&nbsp;&nbsp;*SVSCTL_REG&nbsp;=0;&nbsp;//off SVS to conserve power<br>&nbsp;&nbsp;&nbsp;return;<br>&nbsp;&nbsp;}<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;<br>&nbsp;}<br>&nbsp;<br>&nbsp;*SVSCTL_REG&nbsp;=0;&nbsp;//off SVS to conserve power</p>
<p>&nbsp;gSVSvalue=15;&nbsp;&nbsp;//indicate error.<br>&nbsp;<br>}<br>&nbsp; <br>}<br>&nbsp;<br><br></p>
<blockquote>----- Original Message -----<br>From: Vlado Handziski &lt;handzisk <at> tkn.tu-berlin.de&gt;<br>To: &#51060;&#44592;&#49453; &lt;gslee <at> hallym.ac.kr&gt;<br>Cc: tinyos-help <at> millennium.berkeley.edu<br>Sent: 2009/02/02 13:15<br>Subject: Re: [Tinyos-help] Fw: Re: for Tinyos 2.x bugs...<br><br>Hi,<br><br>please post here more details about the problem and your patch.<br><br>Vlado<br><br><div class="gmail_quote">2009/1/31 &#51060;&#44592;&#49453; <span dir="ltr">&lt;<a href="mailto:gslee <at> hallym.ac.kr">gslee <at> hallym.ac.kr</a>&gt;</span><br><blockquote class="gmail_quote"> Dear tinyos-help<br><br>Could you receive the fixed file for the problem which is described below&nbsp;<br>and update it into the tinyos project?<br><br>K.S.Lee
<div>
<div></div>
<div class="Wj3C7c">
<br><br><blockquote>----- Original Message -----<br>From: Philip Levis &lt;<a href="mailto:pal <at> cs.stanford.edu" target="_blank">pal <at> cs.stanford.edu</a>&gt;<br>To: &#51060;&#44592;&#49453; &lt;<a href="mailto:gslee <at> hallym.ac.kr" target="_blank">gslee <at> hallym.ac.kr</a>&gt;<br>Cc: <a href="mailto:cssharp <at> eecs.berkeley.edu" target="_blank">cssharp <at> eecs.berkeley.edu</a>, Vlado Handziski &lt;<a href="mailto:handzisk <at> tkn.tu-berlin.de" target="_blank">handzisk <at> tkn.tu-berlin.de</a>&gt;, Joe Polastre &lt;<a href="mailto:polastre <at> cs.berkeley.edu" target="_blank">polastre <at> cs.berkeley.edu</a>&gt;<br>Sent: 2009/01/31 13:49<br>Subject: Re: for Tinyos 2.x bugs...<br><br><br>On Jan 30, 2009, at 8:05 PM, Joe Polastre wrote:<br><br>&gt; please contact Phil Levis, <a href="mailto:pal <at> cs.stanford.edu" target="_blank">pal <at> cs.stanford.edu</a><br>&gt;<br>&gt; Best,<br>&gt; -Joe<br>&gt;<br>&gt; On Fri, Jan 30, 2009 at 7:39 PM, &#51060;&#44592;&#49453; &lt;<a href="mailto:gslee <at> hallym.ac.kr" target="_blank">gslee <at> hallym.ac.kr</a>&gt; wrote:<br>&gt;&gt;<br>&gt;&gt; Dear Joe Polastre , Cory Sharp and Vlado Handziski,<br>&gt;&gt;<br>&gt;&gt; I had developed our system with tinyos-2.x on last year.<br>&gt;&gt; I found the bug in tinyos-2.0 source code for MSP430 PLL problem <br>&gt;&gt; at power<br>&gt;&gt; up.<br>&gt;&gt;<br>&gt;&gt; I think the recent version does not fix this problem. If sink mote <br>&gt;&gt; will be<br>&gt;&gt; used<br>&gt;&gt; with unstable DC power supply, it can be operated incorrectly on <br>&gt;&gt; RS232 bit<br>&gt;&gt; rate...<br>&gt;&gt; Thus the gateway which is located upper layer of sink mote can not <br>&gt;&gt; receive<br>&gt;&gt; uploading packet.<br>&gt;&gt; Now, "the unstable DC power supply" is only meaning which rising <br>&gt;&gt; slop on<br>&gt;&gt; power-on<br>&gt;&gt; is low.<br>&gt;&gt;<br>&gt;&gt; Could I send a file which was fixed for this problem?<br>&gt;&gt; in the Tinyos.net site, the bug report menu is not operating now.<br>&gt;&gt; And the e-mail accounts which is cssharp and handzisk are not <br>&gt;&gt; response .<br>&gt;&gt;<br>&gt;&gt; Yours sincerely,<br>&gt;&gt; K.S.Lee<br><br><br>K.S.,<br><br>Better yet, please email tinyos-help!<br><br>Phil</blockquote>
</div>
</div>
<br>_______________________________________________<br>Tinyos-help mailing list<br><a href="mailto:Tinyos-help <at> millennium.berkeley.edu">Tinyos-help <at> millennium.berkeley.edu</a><br><a href="https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help" target="_blank">https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help</a><br>
</blockquote>
</div>
<br>
</blockquote>
</div>
kiseop Lee | 2 Feb 2009 08:34
Picon

Re: Fw: Re: for Tinyos 2.x bugs...

I'm sorry, our school email server has some problem. this is using gmail.....


Hi,
In the last of this mail , temporary fixed code exist. It should be located 
in c:\cygwin\opt\tinyos-2.x\tos\chips\msp430\timer\Msp430ClockP.nc
But if you understand problem exactly , you can apply it to any file which is proper location.

If you want to reproduce it, 
1. provide a BaseStation mote and Laboratary Power supply.
   connect power supply and the basestation. increase voltage level from zero to 3.3V very slowly.
2. Then , probe RS-232 bit rate of the Basestation by Oscillosope. you can see the bit rate is 
   incorrect. thus gateway can not read these datas. 

 in the msp430 user guide(SLAU049xxx.pdf), the ch4 Basic clock module has 
fault oscillator problem. but I think oscillator fault problem is different with this.
this is wrong oscillation of PLL which has problem in slow transition power supply.

if there is reset-IC, it can help this problem. But in the telosb clone board does not have
reset-IC. thus I use internal voltage detector function of msp430.

//tinyos latest version. FEB 2, 2009.
//======c:\cygwin\opt\tinyos-2.x\tos\chips\msp430\timer\Msp430ClockP.nc====

module Msp430ClockP <at> safe()
{
  provides interface Init;
  provides interface Msp430ClockInit;
}
implementation
{
 uint8_t gSVSvalue;
 
 
  MSP430REG_NORACE(IE1);
  MSP430REG_NORACE(TACTL);
  MSP430REG_NORACE(TAIV);
  MSP430REG_NORACE(TBCTL);
  MSP430REG_NORACE(TBIV);

  enum
  {
    ACLK_CALIB_PERIOD = 8,
    TARGET_DCO_DELTA = (TARGET_DCO_KHZ / ACLK_KHZ) * ACLK_CALIB_PERIOD,
  };

void MeasureAVCC();
 void MyWait(uint16_t arg1);
 

  command void Msp430ClockInit.defaultSetupDcoCalibrate()
  {
 
    // --- setup ---

    TACTL = TASSEL1 | MC1; // source SMCLK, continuous mode, everything else 0
    TBCTL = TBSSEL0 | MC1;
    BCSCTL1 = XT2OFF | RSEL2;
    BCSCTL2 = 0;
    TBCCTL0 = CM0;
   }
   
  command void Msp430ClockInit.defaultInitClocks()
  {
    // BCSCTL1
    // .XT2OFF = 1; disable the external oscillator for SCLK and MCLK
    // .XTS = 0; set low frequency mode for LXFT1
    // .DIVA = 0; set the divisor on ACLK to 1
    // .RSEL, do not modify
    BCSCTL1 = XT2OFF | (BCSCTL1 & (RSEL2|RSEL1|RSEL0));

    // BCSCTL2
    // .SELM = 0; select DCOCLK as source for MCLK
    // .DIVM = 0; set the divisor of MCLK to 1
    // .SELS = 0; select DCOCLK as source for SCLK
    // .DIVS = 2; set the divisor of SCLK to 4
    // .DCOR = 0; select internal resistor for DCO
    BCSCTL2 = DIVS1;

    // IE1.OFIE = 0; no interrupt for oscillator fault
    CLR_FLAG( IE1, OFIE );
  }

  command void Msp430ClockInit.defaultInitTimerA()
  {
    TAR = 0;

    // TACTL
    // .TACLGRP = 0; each TACL group latched independently
    // .CNTL = 0; 16-bit counter
    // .TASSEL = 2; source SMCLK = DCO/4
    // .ID = 0; input divisor of 1
    // .MC = 0; initially disabled
    // .TACLR = 0; reset timer A
    // .TAIE = 1; enable timer A interrupts
    TACTL = TASSEL1 | TAIE;
  }

  command void Msp430ClockInit.defaultInitTimerB()
  {
    TBR = 0;

    // TBCTL
    // .TBCLGRP = 0; each TBCL group latched independently
    // .CNTL = 0; 16-bit counter
    // .TBSSEL = 1; source ACLK
    // .ID = 0; input divisor of 1
    // .MC = 0; initially disabled
    // .TBCLR = 0; reset timer B
    // .TBIE = 1; enable timer B interrupts
    TBCTL = TBSSEL0 | TBIE;
  }

  default event void Msp430ClockInit.setupDcoCalibrate()
  {
    call Msp430ClockInit.defaultSetupDcoCalibrate();
  }
 
  default event void Msp430ClockInit.initClocks()
  {
    call Msp430ClockInit.defaultInitClocks();
  }

  default event void Msp430ClockInit.initTimerA()
  {
    call Msp430ClockInit.defaultInitTimerA();
  }

  default event void Msp430ClockInit.initTimerB()
  {
    call Msp430ClockInit.defaultInitTimerB();
  }


  void startTimerA()
  {
    // TACTL.MC = 2; continuous mode
    TACTL = MC1 | (TACTL & ~(MC1|MC0));
  }

  void stopTimerA()
  {
    //TACTL.MC = 0; stop timer B
    TACTL = TACTL & ~(MC1|MC0);
  }

  void startTimerB()
  {
    // TBCTL.MC = 2; continuous mode
    TBCTL = MC1 | (TBCTL & ~(MC1|MC0));
  }

  void stopTimerB()
  {
    //TBCTL.MC = 0; stop timer B
    TBCTL = TBCTL & ~(MC1|MC0);
  }

  void set_dco_calib( int calib )
  {
    BCSCTL1 = (BCSCTL1 & ~0x07) | ((calib >> 8) & 0x07);
    DCOCTL = calib & 0xff;
  }

  uint16_t test_calib_busywait_delta( int calib )
  {
    int8_t aclk_count = 2;
    uint16_t dco_prev = 0;
    uint16_t dco_curr = 0;

    set_dco_calib( calib );

    while( aclk_count-- > 0 )
    {
      TBCCR0 = TBR + ACLK_CALIB_PERIOD; // set next interrupt
      TBCCTL0 &= ~CCIFG; // clear pending interrupt
      while( (TBCCTL0 & CCIFG) == 0 ); // busy wait
      dco_prev = dco_curr;
      dco_curr = TAR;
    }

    return dco_curr - dco_prev;
  }

  // busyCalibrateDCO
  // Should take about 9ms if ACLK_CALIB_PERIOD=8.
  // DCOCTL and BCSCTL1 are calibrated when done.
  void busyCalibrateDco()
  {
    // --- variables ---
    int calib;
    int step;

    // --- calibrate ---

    // Binary search for RSEL,DCO,DCOMOD.
    // It's okay that RSEL isn't monotonic.

    for( calib=0,step=0x800; step!=0; step>>=1 )
    {
      // if the step is not past the target, commit it
      if( test_calib_busywait_delta(calib|step) <= TARGET_DCO_DELTA )
        calib |= step;
    }

    // if DCOx is 7 (0x0e0 in calib), then the 5-bit MODx is not useable, set it to 0
    if( (calib & 0x0e0) == 0x0e0 )
      calib &= ~0x01f;

    set_dco_calib( calib );
  }

  command error_t Init.init()
  {
    // Reset timers and clear interrupt vectors
    TACTL = TACLR;
    TAIV = 0;
    TBCTL = TBCLR;
    TBIV = 0;

    
    //Wait until which the VACC will 3.0V and then DCO should oscillation correctly.
    //If the power supply for the sink mote is unstable,
    //the DCO will be setted wrong and UART asynchronous data timing will be corrupted.
    //from MSP430 datasheet.
 #if 1  
    do{
     MeasureAVCC();
     if((gSVSvalue >= 0xB)&&(gSVSvalue <0xF)){//if it larger then 3.05V and smaller then 3.7V
      break;//OK....
     }
    
     if(gSVSvalue==0xF)break;  //it has error , but it must run the others job....!!!!
    
 }while(1);
#endif
 
    atomic
    {
      signal Msp430ClockInit.setupDcoCalibrate();
      busyCalibrateDco();
      signal Msp430ClockInit.initClocks();
      signal Msp430ClockInit.initTimerA();
      signal Msp430ClockInit.initTimerB();
      startTimerA();
      startTimerB();
    }

    return SUCCESS;
  }
 
//=========================
//These are temporary functions.
#define SVSCTL_REG ((unsigned char *)(0x55))
#define SVSOP               0x02
void MyWait(uint16_t arg1)
{
 uint16_t i,k;
 
 for(i=0; i<arg1; i++){

  nop(); //nop in telosb.
 
 }
 
}

void MeasureAVCC(){
 uint8_t i;
 
 *SVSCTL_REG =( 1<<4); //init with 1.9V comparation.
 MyWait(1200);   //off to on delay is 150 us.
 
 for(i=1;i<14;i++){
  *SVSCTL_REG=(i<<4);
  MyWait(96);  //each steps delay is 12us.
  
  if((*SVSCTL_REG) & SVSOP){
   gSVSvalue=i;
   *SVSCTL_REG =0; //off SVS to conserve power
   return;
  }
  
  
 }
 
 *SVSCTL_REG =0; //off SVS to conserve power

 gSVSvalue=15;  //indicate error.
 
}
 
}
 

----- Original Message -----
From: Vlado Handziski <handzisk <at> tkn.tu-berlin.de>
To: 이기섭 <gslee <at> hallym.ac.kr>
Cc: tinyos-help <at> millennium.berkeley.edu
Sent: 2009/02/02 13:15
Subject: Re: [Tinyos-help] Fw: Re: for Tinyos 2.x bugs...

Hi,

please post here more details about the problem and your patch.

Vlado

2009/1/31 이기섭 <gslee <at> hallym.ac.kr>
Dear tinyos-help

Could you receive the fixed file for the problem which is described below 
and update it into the tinyos project?

K.S.Lee


----- Original Message -----
From: Philip Levis <pal <at> cs.stanford.edu>
To: 이기섭 <gslee <at> hallym.ac.kr>
Cc: cssharp <at> eecs.berkeley.edu, Vlado Handziski <handzisk <at> tkn.tu-berlin.de>, Joe Polastre <polastre <at> cs.berkeley.edu>
Sent: 2009/01/31 13:49
Subject: Re: for Tinyos 2.x bugs...


On Jan 30, 2009, at 8:05 PM, Joe Polastre wrote:

> please contact Phil Levis, pal <at> cs.stanford.edu
>
> Best,
> -Joe
>
> On Fri, Jan 30, 2009 at 7:39 PM, 이기섭 <gslee <at> hallym.ac.kr> wrote:
>>
>> Dear Joe Polastre , Cory Sharp and Vlado Handziski,
>>
>> I had developed our system with tinyos-2.x on last year.
>> I found the bug in tinyos-2.0 source code for MSP430 PLL problem
>> at power
>> up.
>>
>> I think the recent version does not fix this problem. If sink mote
>> will be
>> used
>> with unstable DC power supply, it can be operated incorrectly on
>> RS232 bit
>> rate...
>> Thus the gateway which is located upper layer of sink mote can not
>> receive
>> uploading packet.
>> Now, "the unstable DC power supply" is only meaning which rising
>> slop on
>> power-on
>> is low.
>>
>> Could I send a file which was fixed for this problem?
>> in the Tinyos.net site, the bug report menu is not operating now.
>> And the e-mail accounts which is cssharp and handzisk are not
>> response .
>>
>> Yours sincerely,
>> K.S.Lee


K.S.,

Better yet, please email tinyos-help!

Phil

_______________________________________________
Tinyos-help mailing list
Tinyos-help <at> millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
<div>
<p>I'm sorry, our school email server has some problem. this is using gmail.....</p>
<p><br></p>
<p>Hi,<br>In the last of this mail , temporary fixed code exist. It should be 
located&nbsp;<br>in 
c:\cygwin\opt\tinyos-2.x\tos\chips\msp430\timer\Msp430ClockP.nc<br>But if you 
understand problem exactly , you can apply it to any file which is proper 
location.<br><br>If you want to reproduce it,&nbsp;<br>1. provide a BaseStation mote 
and Laboratary Power supply.<br>&nbsp;&nbsp; connect power supply and&nbsp;the basestation. 
increase&nbsp;voltage level&nbsp;from zero to 3.3V very slowly.<br>2. Then ,&nbsp;probe RS-232 
bit rate of the Basestation by Oscillosope. you can see the bit rate is&nbsp;<br>&nbsp;&nbsp; 
incorrect. thus gateway can not read these datas.&nbsp;<br><br>&nbsp;in the msp430 user 
guide(SLAU049xxx.pdf), the ch4 Basic clock module has&nbsp;<br>fault oscillator 
problem. but&nbsp;I think oscillator fault problem is different with this.<br>this is 
wrong oscillation of PLL which has problem in slow transition power 
supply.<br><br>if there is reset-IC, it can help this problem. But in the telosb 
clone board does not have<br>reset-IC. thus I use internal voltage detector 
function of msp430.<br><br>//tinyos latest version. FEB 2, 
2009.<br>//======c:\cygwin\opt\tinyos-2.x\tos\chips\msp430\timer\Msp430ClockP.nc====<br><br>module 
Msp430ClockP  <at> safe()<br>{<br>&nbsp; provides interface Init;<br>&nbsp; provides interface 
Msp430ClockInit;<br>}<br>implementation<br>{<br>&nbsp;uint8_t 
gSVSvalue;<br>&nbsp;<br>&nbsp;<br>&nbsp; MSP430REG_NORACE(IE1);<br>&nbsp; 
MSP430REG_NORACE(TACTL);<br>&nbsp; MSP430REG_NORACE(TAIV);<br>&nbsp; 
MSP430REG_NORACE(TBCTL);<br>&nbsp; MSP430REG_NORACE(TBIV);</p>
<p>&nbsp; enum<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; ACLK_CALIB_PERIOD = 8,<br>&nbsp;&nbsp;&nbsp; TARGET_DCO_DELTA = 
(TARGET_DCO_KHZ / ACLK_KHZ) * ACLK_CALIB_PERIOD,<br>&nbsp; };</p>
<p>void MeasureAVCC();<br>&nbsp;void MyWait(uint16_t arg1);<br>&nbsp;</p>
<p>&nbsp; command void Msp430ClockInit.defaultSetupDcoCalibrate()<br>&nbsp; {<br>&nbsp; <br>&nbsp;&nbsp;&nbsp; 
// --- setup ---</p>
<p>&nbsp;&nbsp;&nbsp; TACTL = TASSEL1 | MC1; // source SMCLK, continuous mode, everything else 
0<br>&nbsp;&nbsp;&nbsp; TBCTL = TBSSEL0 | MC1;<br>&nbsp;&nbsp;&nbsp; BCSCTL1 = XT2OFF | RSEL2;<br>&nbsp;&nbsp;&nbsp; BCSCTL2 
= 0;<br>&nbsp;&nbsp;&nbsp; TBCCTL0 = CM0;<br>&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp; command void 
Msp430ClockInit.defaultInitClocks()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; // BCSCTL1<br>&nbsp;&nbsp;&nbsp; // .XT2OFF = 
1; disable the external oscillator for SCLK and MCLK<br>&nbsp;&nbsp;&nbsp; // .XTS = 0; set low 
frequency mode for LXFT1<br>&nbsp;&nbsp;&nbsp; // .DIVA = 0; set the divisor on ACLK to 
1<br>&nbsp;&nbsp;&nbsp; // .RSEL, do not modify<br>&nbsp;&nbsp;&nbsp; BCSCTL1 = XT2OFF | (BCSCTL1 &amp; 
(RSEL2|RSEL1|RSEL0));</p>
<p>&nbsp;&nbsp;&nbsp; // BCSCTL2<br>&nbsp;&nbsp;&nbsp; // .SELM = 0; select DCOCLK as source for MCLK<br>&nbsp;&nbsp;&nbsp; 
// .DIVM = 0; set the divisor of MCLK to 1<br>&nbsp;&nbsp;&nbsp; // .SELS = 0; select DCOCLK as 
source for SCLK<br>&nbsp;&nbsp;&nbsp; // .DIVS = 2; set the divisor of SCLK to 4<br>&nbsp;&nbsp;&nbsp; // 
.DCOR = 0; select internal resistor for DCO<br>&nbsp;&nbsp;&nbsp; BCSCTL2 = DIVS1;</p>
<p>&nbsp;&nbsp;&nbsp; // IE1.OFIE = 0; no interrupt for oscillator fault<br>&nbsp;&nbsp;&nbsp; CLR_FLAG( IE1, 
OFIE );<br>&nbsp; }</p>
<p>&nbsp; command void Msp430ClockInit.defaultInitTimerA()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; TAR = 0;</p>
<p>&nbsp;&nbsp;&nbsp; // TACTL<br>&nbsp;&nbsp;&nbsp; // .TACLGRP = 0; each TACL group latched 
independently<br>&nbsp;&nbsp;&nbsp; // .CNTL = 0; 16-bit counter<br>&nbsp;&nbsp;&nbsp; // .TASSEL = 2; source 
SMCLK = DCO/4<br>&nbsp;&nbsp;&nbsp; // .ID = 0; input divisor of 1<br>&nbsp;&nbsp;&nbsp; // .MC = 0; initially 
disabled<br>&nbsp;&nbsp;&nbsp; // .TACLR = 0; reset timer A<br>&nbsp;&nbsp;&nbsp; // .TAIE = 1; enable timer A 
interrupts<br>&nbsp;&nbsp;&nbsp; TACTL = TASSEL1 | TAIE;<br>&nbsp; }</p>
<p>&nbsp; command void Msp430ClockInit.defaultInitTimerB()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; TBR = 0;</p>
<p>&nbsp;&nbsp;&nbsp; // TBCTL<br>&nbsp;&nbsp;&nbsp; // .TBCLGRP = 0; each TBCL group latched 
independently<br>&nbsp;&nbsp;&nbsp; // .CNTL = 0; 16-bit counter<br>&nbsp;&nbsp;&nbsp; // .TBSSEL = 1; source 
ACLK<br>&nbsp;&nbsp;&nbsp; // .ID = 0; input divisor of 1<br>&nbsp;&nbsp;&nbsp; // .MC = 0; initially 
disabled<br>&nbsp;&nbsp;&nbsp; // .TBCLR = 0; reset timer B<br>&nbsp;&nbsp;&nbsp; // .TBIE = 1; enable timer B 
interrupts<br>&nbsp;&nbsp;&nbsp; TBCTL = TBSSEL0 | TBIE;<br>&nbsp; }</p>
<p>&nbsp; default event void Msp430ClockInit.setupDcoCalibrate()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; call 
Msp430ClockInit.defaultSetupDcoCalibrate();<br>&nbsp; }<br>&nbsp; <br>&nbsp; default event void 
Msp430ClockInit.initClocks()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; call 
Msp430ClockInit.defaultInitClocks();<br>&nbsp; }</p>
<p>&nbsp; default event void Msp430ClockInit.initTimerA()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; call 
Msp430ClockInit.defaultInitTimerA();<br>&nbsp; }</p>
<p>&nbsp; default event void Msp430ClockInit.initTimerB()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; call 
Msp430ClockInit.defaultInitTimerB();<br>&nbsp; }</p>
<p><br>&nbsp; void startTimerA()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; // <a href="http://TACTL.MC">TACTL.MC</a> = 2; continuous 
mode<br>&nbsp;&nbsp;&nbsp; TACTL = MC1 | (TACTL &amp; ~(MC1|MC0));<br>&nbsp; }</p>
<p>&nbsp; void stopTimerA()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; //<a href="http://TACTL.MC">TACTL.MC</a> = 0; stop timer B<br>&nbsp;&nbsp;&nbsp; TACTL = 
TACTL &amp; ~(MC1|MC0);<br>&nbsp; }</p>
<p>&nbsp; void startTimerB()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; // <a href="http://TBCTL.MC">TBCTL.MC</a> = 2; continuous mode<br>&nbsp;&nbsp;&nbsp; 
TBCTL = MC1 | (TBCTL &amp; ~(MC1|MC0));<br>&nbsp; }</p>
<p>&nbsp; void stopTimerB()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; //<a href="http://TBCTL.MC">TBCTL.MC</a> = 0; stop timer B<br>&nbsp;&nbsp;&nbsp; TBCTL = 
TBCTL &amp; ~(MC1|MC0);<br>&nbsp; }</p>
<p>&nbsp; void set_dco_calib( int calib )<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; BCSCTL1 = (BCSCTL1 &amp; 
~0x07) | ((calib &gt;&gt; 8) &amp; 0x07);<br>&nbsp;&nbsp;&nbsp; DCOCTL = calib &amp; 0xff;<br>&nbsp; 
}</p>
<p>&nbsp; uint16_t test_calib_busywait_delta( int calib )<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; int8_t 
aclk_count = 2;<br>&nbsp;&nbsp;&nbsp; uint16_t dco_prev = 0;<br>&nbsp;&nbsp;&nbsp; uint16_t dco_curr = 0;</p>
<p>&nbsp;&nbsp;&nbsp; set_dco_calib( calib );</p>
<p>&nbsp;&nbsp;&nbsp; while( aclk_count-- &gt; 0 )<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TBCCR0 = TBR + 
ACLK_CALIB_PERIOD; // set next interrupt<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TBCCTL0 &amp;= ~CCIFG; // 
clear pending interrupt<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while( (TBCCTL0 &amp; CCIFG) == 0 ); // busy 
wait<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dco_prev = dco_curr;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dco_curr = TAR;<br>&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; return dco_curr - dco_prev;<br>&nbsp; }</p>
<p>&nbsp; // busyCalibrateDCO<br>&nbsp; // Should take about 9ms if 
ACLK_CALIB_PERIOD=8.<br>&nbsp; // DCOCTL and BCSCTL1 are calibrated when done.<br>&nbsp; 
void busyCalibrateDco()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; // --- variables ---<br>&nbsp;&nbsp;&nbsp; int 
calib;<br>&nbsp;&nbsp;&nbsp; int step;</p>
<p>&nbsp;&nbsp;&nbsp; // --- calibrate ---</p>
<p>&nbsp;&nbsp;&nbsp; // Binary search for RSEL,DCO,DCOMOD.<br>&nbsp;&nbsp;&nbsp; // It's okay that RSEL isn't 
monotonic.</p>
<p>&nbsp;&nbsp;&nbsp; for( calib=0,step=0x800; step!=0; step&gt;&gt;=1 )<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // 
if the step is not past the target, commit it<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if( 
test_calib_busywait_delta(calib|step) &lt;= TARGET_DCO_DELTA )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; calib 
|= step;<br>&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; // if DCOx is 7 (0x0e0 in calib), then the 5-bit MODx is not useable, set 
it to 0<br>&nbsp;&nbsp;&nbsp; if( (calib &amp; 0x0e0) == 0x0e0 )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; calib &amp;= 
~0x01f;</p>
<p>&nbsp;&nbsp;&nbsp; set_dco_calib( calib );<br>&nbsp; }</p>
<p>&nbsp; command error_t Init.init()<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; // Reset timers and clear 
interrupt vectors<br>&nbsp;&nbsp;&nbsp; TACTL = TACLR;<br>&nbsp;&nbsp;&nbsp; TAIV = 0;<br>&nbsp;&nbsp;&nbsp; TBCTL = 
TBCLR;<br>&nbsp;&nbsp;&nbsp; TBIV = 0;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp; //Wait until which the VACC will 3.0V and then DCO should 
oscillation correctly.<br>&nbsp;&nbsp;&nbsp; //If the power supply for the sink mote is 
unstable, <br>&nbsp;&nbsp;&nbsp; //the DCO will be setted wrong and UART asynchronous data 
timing will be corrupted. <br>&nbsp;&nbsp;&nbsp; //from MSP430 datasheet.<br>&nbsp;#if 1&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; 
do{<br>&nbsp;&nbsp;&nbsp;&nbsp; MeasureAVCC();<br>&nbsp;&nbsp;&nbsp;&nbsp; if((gSVSvalue &gt;= 0xB)&amp;&amp;(gSVSvalue 
&lt;0xF)){//if it larger then 3.05V and smaller then 3.7V<br>&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;break;//OK....<br>&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp; if(gSVSvalue==0xF)break;&nbsp;&nbsp;//it has 
error , but it must run the others job....!!!!<br>&nbsp;&nbsp;&nbsp;&nbsp; 
<br>&nbsp;}while(1);<br>#endif<br>&nbsp;<br>&nbsp;&nbsp;&nbsp; atomic<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; signal 
Msp430ClockInit.setupDcoCalibrate();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; busyCalibrateDco();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
signal Msp430ClockInit.initClocks();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; signal 
Msp430ClockInit.initTimerA();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; signal 
Msp430ClockInit.initTimerB();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; startTimerA();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
startTimerB();<br>&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; return SUCCESS;<br>&nbsp; }<br>&nbsp; <br>//=========================<br>//These 
are temporary functions.<br>#define SVSCTL_REG ((unsigned char 
*)(0x55))<br>#define SVSOP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0x02<br>void MyWait(uint16_t 
arg1)<br>{<br>&nbsp;uint16_t i,k;<br>&nbsp;<br>&nbsp;for(i=0; i&lt;arg1;&nbsp;i++){</p>
<p>&nbsp;&nbsp;nop();&nbsp;//nop in telosb.<br>&nbsp;<br>&nbsp;}<br>&nbsp;<br>}<br><br>void 
MeasureAVCC(){<br>&nbsp;uint8_t i;<br>&nbsp;<br>&nbsp;*SVSCTL_REG&nbsp;=( 1&lt;&lt;4);&nbsp;//init with 
1.9V comparation.<br>&nbsp;MyWait(1200);&nbsp;&nbsp;&nbsp;//off to on delay is 150 
us.<br>&nbsp;<br>&nbsp;for(i=1;i&lt;14;i++){<br>&nbsp;&nbsp;*SVSCTL_REG=(i&lt;&lt;4);<br>&nbsp;&nbsp;MyWait(96);&nbsp;&nbsp;//each 
steps delay is 12us.<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;if((*SVSCTL_REG) &amp; 
SVSOP){<br>&nbsp;&nbsp;&nbsp;gSVSvalue=i;<br>&nbsp;&nbsp;&nbsp;*SVSCTL_REG&nbsp;=0;&nbsp;//off SVS to conserve 
power<br>&nbsp;&nbsp;&nbsp;return;<br>&nbsp;&nbsp;}<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;<br>&nbsp;}<br>&nbsp;<br>&nbsp;*SVSCTL_REG&nbsp;=0;&nbsp;//off SVS 
to conserve power</p>
<p>&nbsp;gSVSvalue=15;&nbsp;&nbsp;//indicate error.<br>&nbsp;<br>}<br>&nbsp; <br>}<br>&nbsp;<br><br></p>
<blockquote>----- 
Original Message -----<br>From: Vlado Handziski 
&lt;<a href="mailto:handzisk <at> tkn.tu-berlin.de">handzisk <at> tkn.tu-berlin.de</a>&gt;<br>To: &#51060;&#44592;&#49453; 
&lt;<a href="mailto:gslee <at> hallym.ac.kr">gslee <at> hallym.ac.kr</a>&gt;<br>Cc: 
<a href="mailto:tinyos-help <at> millennium.berkeley.edu">tinyos-help <at> millennium.berkeley.edu</a><br>Sent: 2009/02/02 
13:15<br>Subject: Re: [Tinyos-help] Fw: Re: for Tinyos 2.x 
bugs...<br><br>Hi,<br><br>please post here more details about the problem and 
your patch.<br><br>Vlado<br><br><div class="gmail_quote">2009/1/31 &#51060;&#44592;&#49453; <span dir="ltr">&lt;<a href="mailto:gslee <at> hallym.ac.kr">gslee <at> hallym.ac.kr</a>&gt;</span><br><blockquote class="gmail_quote"> Dear tinyos-help<br><br>Could you receive the fixed 
file for the problem which is described below&nbsp;<br>and update it into the tinyos 
project?<br><br>K.S.Lee 
<div>
<div></div>
<div class="Wj3C7c">
<br><br><blockquote>----- 
Original Message -----<br>From: Philip Levis &lt;<a href="mailto:pal <at> cs.stanford.edu" target="_blank">pal <at> cs.stanford.edu</a>&gt;<br>To: &#51060;&#44592;&#49453; &lt;<a href="mailto:gslee <at> hallym.ac.kr" target="_blank">gslee <at> hallym.ac.kr</a>&gt;<br>Cc: <a href="mailto:cssharp <at> eecs.berkeley.edu" target="_blank">cssharp <at> eecs.berkeley.edu</a>, Vlado Handziski &lt;<a href="mailto:handzisk <at> tkn.tu-berlin.de" target="_blank">handzisk <at> tkn.tu-berlin.de</a>&gt;, Joe Polastre &lt;<a href="mailto:polastre <at> cs.berkeley.edu" target="_blank">polastre <at> cs.berkeley.edu</a>&gt;<br>Sent: 2009/01/31 
13:49<br>Subject: Re: for Tinyos 2.x bugs...<br><br><br>On Jan 30, 2009, 
at 8:05 PM, Joe Polastre wrote:<br><br>&gt; please contact Phil Levis, <a href="mailto:pal <at> cs.stanford.edu" target="_blank">pal <at> cs.stanford.edu</a><br>&gt;<br>&gt; Best,<br>&gt; 
-Joe<br>&gt;<br>&gt; On Fri, Jan 30, 2009 at 7:39 PM, &#51060;&#44592;&#49453; &lt;<a href="mailto:gslee <at> hallym.ac.kr" target="_blank">gslee <at> hallym.ac.kr</a>&gt; 
wrote:<br>&gt;&gt;<br>&gt;&gt; Dear Joe Polastre , Cory Sharp and Vlado 
Handziski,<br>&gt;&gt;<br>&gt;&gt; I had developed our system with tinyos-2.x on 
last year.<br>&gt;&gt; I found the bug in tinyos-2.0 source code for MSP430 PLL 
problem <br>&gt;&gt; at power<br>&gt;&gt; up.<br>&gt;&gt;<br>&gt;&gt; I think 
the recent version does not fix this problem. If sink mote <br>&gt;&gt; will 
be<br>&gt;&gt; used<br>&gt;&gt; with unstable DC power supply, it can be 
operated incorrectly on <br>&gt;&gt; RS232 bit<br>&gt;&gt; rate...<br>&gt;&gt; 
Thus the gateway which is located upper layer of sink mote can not <br>&gt;&gt; 
receive<br>&gt;&gt; uploading packet.<br>&gt;&gt; Now, "the unstable DC power 
supply" is only meaning which rising <br>&gt;&gt; slop on<br>&gt;&gt; 
power-on<br>&gt;&gt; is low.<br>&gt;&gt;<br>&gt;&gt; Could I send a file which 
was fixed for this problem?<br>&gt;&gt; in the Tinyos.net site, the bug report 
menu is not operating now.<br>&gt;&gt; And the e-mail accounts which is cssharp 
and handzisk are not <br>&gt;&gt; response .<br>&gt;&gt;<br>&gt;&gt; Yours 
sincerely,<br>&gt;&gt; K.S.Lee<br><br><br>K.S.,<br><br>Better yet, please email 
tinyos-help!<br><br>Phil</blockquote>
</div>
</div>
<br>_______________________________________________<br>Tinyos-help 
mailing list<br><a href="mailto:Tinyos-help <at> millennium.berkeley.edu">Tinyos-help <at> millennium.berkeley.edu</a><br><a href="https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help" target="_blank">https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help</a><br>
</blockquote>
</div>
</blockquote>
</div>

Gmane