Pommie said:
Contra to what most people state, the 16F628 is not a good replacement for the 16F84. The 16F628 cannot run unmodified 84 code yet there are many pics that can. The 16F877 can run unmodified 84 code. Just pretend it's a 84 with lots of I/O ports.
Sorry? - the 16F628 is the official MicroChip replacement for the 16F84, and has been for many years - it's uses EXACTLY the same 14 bit core, and there's even a migration document which tells you exctly what slight differences there is!.
The only 'modification' required to the code is to add two lines that disable the comparators - this is extremely trivial to do, and well documented. The 16F877/6 requires MORE changes to 84 code to allow it to run, at least four lines to turn the analogue inputs off (as it requires bank switching).
So contrary to what you appear to believe?, the 628 is the perfect replacement for the 84 - as it was designed to be!, and certainly closer than the 877.
If you want a version with analogue inputs?, try the 16F819 and 16F88, these are 18 pin but have analogue inputs. As with the rest they use the same 14 bit core, and are trivial to use in place of a 16x84.