You have three options...

1. Your PBC has a command called PWM... go check it out in the manual - it even comes with an example.

2. Do s SEARCH on this forum (use PWM* as the search phrase) for heaps of topics on PWM many with examples.

3. Swap your 16F84 (I really don't know why folks still use this chip) for a pin compatible 16F628 which has hardware PWM on-board... the Datasheet in the Capture/Compare/PWM (CCP) Section explains step-by-step how to initialise and get that running...