I chose a PIC18F4620 when I needed a pin compatible upgrade to the 16F877A, maybe it will fit your needs.