Hi
I just sent it again because is seems the first one did not appear in the
list.
André
----- Original Message -----
From: "André Miguel de Almeida Marrão Rodrigues"
<[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, November 21, 2007 10:15 PM
Subject: Pulse detection in T2 TMote port
Hi
I need do detect a digital 1ms width pulse in tmote port.
I have modified the TEP 109 - Binary Pin-Connected Sensor in order to
detect the rising
edge of the sinal (a square sinal with 1ms width) and that worked perfect
until the day
that I get the node with my device near a WIFI router. Somehow noise
introduced in the
circuit and there are a few false pulses.
So now I want to detected the raising edge and the failing edge (using the
TEP 109 code) and
measure the time between them, which should be arround 1ms. First things
become complicated
because I'm not sure how to get the uS timer on TMote (so I use the ms
timer...) and perhaps most importante I'm not sure
if I can process 2 interrupts (with the associated code on the driver and
on the program) in a 1ms timeframe.
The code for the driver is the one from the TEP109 (user button); my code
is:
event void Notify.notify(bool val) {
uint32_t begin;
uint32_t now;
if (val == FALSE) {
call Timer1ms.startOneShot(2); //just to count the time from the raising
edge
}
else { //so it's a falling edge
begin = call Timer1ms.gett0();
now = call Timer1ms.getNow();
if ((now - begin)< 2000 ){
.......> a true pulse was detected
Any advice or ideas are much appreciated.
Regards,
André Rodrigues
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help