You want to time the pulse width or count the number per second?
Depending on the speed and resolution you can either set up a periodic
Timer and sample the input -- the minimum Timer is somewhere between
1 and 3 milli-sec; or  you can use the Capture features of the ATMEGA
to get micro-second resolution in hardware.

I have some code for the Capture hardware under T1 at:
     http://www.etantdonnes.com/Motes/AVR128timers.zip
but if you are inexperience with TOS and microcontrollers you
may be at a loss to use it...

For some reason none of this is directly supported under TOS.

In all cases the advised approach is to read through the doc/tutorial
to get some experience with TOS and then start trying to decipher
the controller manual.

MS


Giuseppe Aiello wrote:
> Hi, I really need help with this. I have to read a pulse signal from an 
> encoder. I'm using an ATmel128 microcontroller with Tinyos 2.1. I've 
> read some post where it is said that it is possible to do this by using 
> the principle of edge detection. I'm trying to adapt the application 
> TestUserButton to my needs, but for me this is a difficult task because 
> I don't have a lot of experience with tinyos and this program is 
> intended for another platform. Any help with this will be greatly 
> appreciated.
> Thanks
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to