If you can find this book ...
**broken link removed**
In the chapter on interrupt handling, there is one problem/outline for setting up an echo sounding range finder, using an ultrasonic transmitter and receiver pair.
It is suggested that the ultrasonic range is 2.5 m, with a resolution of 1 cm. You might have to read more of the chapter to fill in the details ....
This material is definitely in the first edition of the book. I am not absolutely sure about the second edition. .... It seems like the general idea could be transferred to the micro that you have chosen. ....