hi ,everyone:
      I have found that the problem was caused because I used ADC module which 
also uses TimerM
for sampling data. So both the TimerM and myself Module use Hplclock as timer. 
This caused collision
because they both want to set the rate of Compare2 timer ,and unfortunately, 
their frequency is different.
    Now can anyono give me some advise on how to solve that problem?
    Thx.
     

------------------  
roy  liu 
2007-01-02

-------------------------------------------------------------
From:roy  liu ^-^
Data:2007-01-01 14:29:49
[EMAIL PROTECTED]
Copy:
Subject:[Tinyos-help] clock bug in tossim?

hi ,everyone:
  My tinyos version is 1.1.15.I want to have a timer with the period of 1 ms in 
tossim simulator.
However it seems the timer module could not provide such short period, so I 
directly use HPLClock 
module of HPLclock.nc and call the command Clock.setRate(interval,scale).The 
parameters are 
interval=32,scale=1.
  It did fired every time,but the interval of tos_time was not a constant.It 
has several different 
interval time(converting into tos_time): 28182 ,9272,5368 and some others.
  What's the problem with my disposal? Any advice will be apprecaited.

  ps:
 my code segment:
command result_t MACControl.init()
{
       .......
      // initialize and start clock
      call Clock.setRate(32,1) ;
 }

uint_32t clocktime;
event result_t clock.fire(){
   clocktime++; 
   dbg(DBG_USR1,"clock.fire has been called at 
clocktime=%i,tos_state.tos_time=%i\n",clocktime,tos_state.tos_time);  
  }

DBG information:
0: clock.fire has been called at clockttime=1 .  tos_state.tos_time=19160787..
0: clock.fire has been called at clockttime=2 .  tos_state.tos_time=19188969..
0: clock.fire has been called at clockttime=3 .  tos_state.tos_time=19217151..
0: clock.fire has been called at clockttime=4 .  tos_state.tos_time=19245333..
0: clock.fire has been called at clockttime=5 .  tos_state.tos_time=19273515..
0: clock.fire has been called at clockttime=6 .  tos_state.tos_time=19278883..
                                                             
~~~~~~~~~~~~~~~~the interval became 5368
0: clock.fire has been called at clockttime=7 .  tos_state.tos_time=19280225..
0: clock.fire has been called at clockttime=8 .  tos_state.tos_time=19308407..
0: clock.fire has been called at clockttime=9 .  tos_state.tos_time=19336589..
0: clock.fire has been called at clockttime=10 . tos_state.tos_time=19364771..
0: clock.fire has been called at clockttime=11 . tos_state.tos_time=19392953..
0: clock.fire has been called at clockttime=12 . tos_state.tos_time=19400883..
0: clock.fire has been called at clockttime=13 . tos_state.tos_time=19429065..
0: clock.fire has been called at clockttime=14 . tos_state.tos_time=19457247..
0: clock.fire has been called at clockttime=15 . tos_state.tos_time=19485429..
0: clock.fire has been called at clockttime=16 . tos_state.tos_time=19513611..




   

--------------
roy  liu 
2007-01-01
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to