You might want to look into the Timer Capture stuff on the chip.
I don't think any of it is supported in TOS, but it will give
you a hardware level timing between pin events. I've got ATMEGA
code you can look at if it'd help any at:
    http://www.etantdonnes.com/Motes/AVR128timers.zip

Also there are demos using the audible pingers on the micasb,
but of course I've forgotten the relevant search strings. Look
through this list for ping and position and other logical words.

I would be interested in your results as I have the same robot
position problems. I'm using a passive receiver on the bot with
fixed transmitters but haven't done enough to make it usable.
Getting the receiver to be omni-directional is my stumbling
block right now.

MS


Jose Araujo wrote:
Dear All,

I am working with a Tmote Sky, and i am trying to use it in order to get data from the ultrasound sensors to calculate the position of a robot.

I use one tmote for Tx and another to Rx. Here goes the list of “tools” that I use in the program:

-          ReadNow from the ADC in order to read the pin

-          Printf

- Alarm32KhzC – to call the ReadNow..in order to read the pin in a 32Khz frequency

- Msp430CounterMicroC – to count the time..because I need a micro second resolution

- Message Reception..since I am sending the ultrasound plus a message in the Tx and then I calculate the time difference

At the moment the program goes like this:

I tag the time when the msg arrives and then I tag it again when the ultrasound arrives in the ReadNow event. Then I subtract the value and I have the time between the msg and ultrasound. It seemed to be a good plan but in fact I am having a lot of trouble with this:

- Since I use the alarm.fired() event in order to call the ReadNow() and both are async events I am not able to have the 32Khz..so the better I can get is a 1ms period…instead of the 31.25us..

My question was if somebody has a better way to calculate this..to use different functions that the ones I use at the moment..because I notice that working with this processor and with this time restrictions I have a lot of conflicts..

Thanks a lot for the help,

José


------------------------------------------------------------------------

_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

--
Platform: WinXP/Cygwin
TinyOS version: 1.x, Boomerang
Programmer: MIB510
Device(s): Mica2, MicaZ, Tmote
Sensor board: homebrew

_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to