I know you're new to PICBasic but you may want to take a look here:

http://ww1.microchip.com/downloads/e...Doc/41214a.pdf

Read through this document and see if anything in there is close to what you were looking for. If so the Capture/Compare/PWM module in the pic is what you will want to use.