<When I remove the keyboard DATA input to the processor I get the correct CLK and DATA outputs from the keyboard and when I connect the DATA to the processor whilst running it works fine. But as soon as I switch off and on again the same problem occurs. Does anyone have this problem, or solution?

Thanks>

Look at the tris registers on the PIC. They should be set to input on power up. There is a reset sequence that the PC sends to the keyboard on startup that you can try, but it souncs like it doesn't need it if it fires up correctly on it's own. Remember that the link between the PS/2 and the PC is a quasi I2C format, and the two valid states are input(high impedance) and low only.

Ron