Being pin compatible with the 16F877A AND the 16F887, the (40 pin variant) PIC18F47K40 should, in theory be a plug in replacement. Has anyone tried a replacement 40 (supposedly) compatible MPU and got it to work (including programming bootloader and getting a program to upload and run)?