Re: pwm by pic microcontroller
No, you can't use timed instruction loops if the PIC has to handle the keyboard and the display too. Now I think the easiest way to do it would be to set up a timer to make periodic interrupts. At each interrupt advance a state machine variable and set or clear the appropriate output bits to make the four signals come out the way you want.
This method is subject to some phase jitter because it depends on interrupt latency, and it is speed limited because the interrupt rate cannot be faster than the interrupt service routine. When a different frequency is needed, just change the setup of the timer so it interrupts are the appropriate rate.