Hi David,
Yes you can use a 4mhz resonator or 4 mhz crystal with 22pf caps. Just change the config settings from HS to XT (actually it doesn't matter for 4 mhz but play it safe) and you should be running. The fact you mentioned just touching a capacitor made it work again makes me think you have a solder joint problem. Try re-flowing the solder to see if that clears it up. The differences between the 877 and 877A are that there are A to D's and comparators on the 877A that need to be disabled in order to use the PortA and PortE pins as digital. Check the data sheet to get the exact register names to disable.
Also make sure you have .1uf caps on both sides of the chip as close as possible to the power supply pins. These are more important on the "A" version of the chip.
I've used both the 877, 877A, and the drop in upgrade 18F452 and have to be honest, I didn't have any problems. I made 2 layer and 4 layer boards for them. I did have a wandering wire once though, and it took out my RTC chip and the uP. Also discovered the RTC crystal had to be replaced.
It's all part of the game. But it's even worse when you're on a deadline to get the damn thing working.
We're here to help David.
HTH,
BobK
Bookmarks