On Thu, Mar 27, 2014 at 5:14 AM, Dingming Wu <[email protected]> wrote:

> Hi Eric,
>
> 0.238us is just 1/4uis. Note the DCO of TelosB runs at 4MiHz, a DCO tick
> would be 1/(4*1024*1024)=0.238us. This sub-microsecond level of precision
> is desirable for my application, not 1us level.
> I have checked the src code of tos/chips/msp430/timer. The SMLK of the MCU
> is DCO/4=1MiHz, It is a little bit confusing here, i don't know why the
> default frequency divider of SMLK is set to 4. Is it because of the
> unstable nature of the DCO if it runs at high frequency( 4MiHz or higher)?
> If i want a faster timer, can I directly set the frequency divider to 1
> (by setting the register BCSCTL2=0)?  In this way, timerA of MSP430 which
> is sourced by SMLK will run exactly at 4MiHz. Reading the TAR register
> directly sounds good, i shall try it.
>

I'm not sure why they did the divider as /4.   And they didn't document it.

Yes you should be able to set it to /1 however that effects some other
timing things and I dont remember all of them.


>
> Thank you Eric.
>
>
>
>
> 2014-03-27 14:41 GMT+08:00 Eric Decker <[email protected]>:
>
>>
>>
>>
>> On Tue, Mar 25, 2014 at 7:58 AM, Dingming Wu <[email protected]> wrote:
>>
>>> Hello everyone,
>>>
>>> I am running an application requires time information with very high
>>> precision. I know the MCU of TelosB has an internal DCO runs at a frequency
>>> of 4MHz, which means a DCO tick or a no operation instruction of the MCU
>>>  is 0.238us. This time precision is high enough for my application.
>>>
>>
>> Not sure how you got a DCO tick is 0.238 uS.
>>
>> TinyOS on the telosb uses binary time and the DCO is actually running  at
>> 4 MiHz = 1024x1024x1024 Hz
>>
>> What I do is use the underlying registers from the msp430f1611, TAR.
>>
>> I've added a TinyOS interface to these low level registers but that is in
>> the tp-freeforall repository.
>>
>> But I would recommend you fudge it and just use the register directly.
>>  It is programmed to tick with 1uis (binary us) resolution.
>>
>>
>>
>>> But the existing timers on TelosB can count at a precision of at most
>>> microsecond level. To obtain even higher time resolution, e.g.
>>> sub-microsecond, is it possible to measure the number of DCO ticks in
>>> TinyOS? For example, can i measure the # of ticks between two instants of
>>> transitions of the SFD pin?
>>>
>>>
>>> --
>>> Regards,
>>> 鼎名
>>>
>>> _______________________________________________
>>> Tinyos-help mailing list
>>> [email protected]
>>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>>
>>
>>
>>
>> --
>> Eric B. Decker
>> Senior (over 50 :-) Researcher
>>
>>
>
>
> --
> Regards,
> 鼎名
>



-- 
Eric B. Decker
Senior (over 50 :-) Researcher
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to