Ultrasonic range sensor HC-SR04 using PIC16F877A

Try the following link, it will help you
Interfacing HC-04 Ultrasonic Sensor with PIC Microcontroller