A friend and I are working on a robotics project. Our mobile robot application utilizes infrared technology for object detection, and eventually, communication. However, we have recently decided to implement an ultrasonic range finder on this project. The problem we have is that we are not familiar with how to program the TIMER registers nor how to work the interrupts. We are using one pin of our PIC16F877A to drive power to a 555 timer, which in turn, generates roughly a 42khz signal to be transmitted by the ultrasonic range finder. Once this signal is received, it sends a high pulse back to another pin of the pic. The problem we are having is getting the amount of time it takes from sending the signal to receiving the signal. As many of you know, we need the elapsed time in order to calculate the distance from the object. I've been trying to read up on both the TIMER registers and the RCTIME command as possibilities for helping us fix this problem but as of yet I've really gotten no where. If any of you could provide us with a sample code to go by we would greatly appreciate it. Thank you all for your time.
Bookmarks