Strangely enough I too am "...creating a ultrasound ranger as a..."
I've got a ping signal going to INT3 of a mica2 and need to
figure out how to write an interrupt handler for it. I want to
get one of the timers running real fast and use it to time the
spacing of multiple ping interrupts to locate a mobile robot.

It looks like there are two defines that get used for this
    TOSH_INTERRUPT and TOSH_SIGNAL
examples of which can seen in, e.g.:
    tos\platform\mica2\HPLUART0M.nc
What's the difference I have no idea yet.

The actual signals and vectors are defined in:
    cygwin\usr\local\avr\include\avr\iom128.h

Details of enabling ints on various pins is covered in the ATMEGA
manual. You can see the setup for the UART pins in the HPL file.

Unfortunately that's about as far as I've gotten, and I have a
separate "easier" project that I can use to block any further
progress, so it may stay that way for a while...


For twiddling regular ATMEGA DIO pins see how these macros are used:
TOSH_ASSIGN_PIN()
  in mica2/hardware.h:
   TOSH_ASSIGN_PIN(PW7, C, 7);
   TOSH_MAKE_PW7_OUTPUT();
and used in various places like:
   TOSH_CLR_PW7() or TOSH_SET_PW7()
note that most of the above are generated by generated macros so
you will _never_ find the actual definitions and just have to believe
that they work.

MS



Brian Vaughan wrote:
I’m creating an ultrasound ranger as part of a more complicated system. I’m creating the actual ultrasound sensor. I need to use the general purpose IO pins from the 51pin connector for two jobs. On one mote I need to send a high or low signal to one of the pins. On the second mote I need to create an interrupt on one of the pins I’m using.

I searched through some of the archives and TinyOS documentation and couldn’t find much. There’s lots of support for the ADC stuff, but I don’t want to sample the port. The reaction time needs to be quick and the ADC sampler seems to only poll every 10ms.

I’m using the mica2 mote and TinyOS1.15 (or something close to that, not 2.0).

So, could someone show me some sample code or point me in the direction of some documentation for this? Or even just give me some keywords to Google.

Thanks!


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

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

Reply via email to