Here a schematic diagram I always use when using pic pwm and analog out.