You might check out the Visual Device Initializer from Microchip. This is an add-on tool to MPLAB which allows you to set up peripherals, such as the PWM, by specifying operating parameters. It doesn't support every part yet, but does the 18XXX and the dsPIC parts. Code for the 18XXX could probably be fairly easily converted to run on the 16XXX parts.
Has anybody heard of an automated assembly code generator for pic? I
> mean when I want a PWM of 50Hz it will produce the assembler code.