floobydust wrote:
Well, a few things stick out:
1- You really do need more bypass caps... at least a 0.1uF on every IC chip. Also, as the board has some size, I would strategically add some additional 100uF caps around the board to maintain a low impedance on the supply traces.
2- Power supply traces are very thin... and some are quite long. There's an inconsistency with them as well... some are wider and some are quite thin.
3- The 7805 regulator, is it getting hot? Do you have a heatsink on it? Granted, the CMOS chips are all pretty low power, but the 7-segment displays can draw some current. What is the supply voltage to the board? Remember that the 7805 has to be some voltage level above it's regulated output to ensure proper regulation.
I would have likely gone for a 4-layer board with a ground and +5 plane. This would make things much easier for routing power. My small (3.8" x 2.5") Pocket SBC has 12- 0.1uF bypass caps plus 3- 63uF polymer caps for 7 chips total. It's also a 4-layer board and is dead quiet on noise. I'm a big fan of excess bypassing. Also, if you open sockets, you can hide the bypass caps under the IC itself. I do this on most of my PCBs, it's very effective for decoupling as you can get the bypass cap very close to the supply pin.
Hopefully adding some additional bypass caps will help, and perhaps swapping out the RAM as well for a test. Good luck on sorting it out.
1. Will definitely be taking this advice for rev2!
2. I should've mentioned that although I have power traces in the pictures I posted, I actually have a ground plane on the bottom and a power plane on the top. I have no idea if making the top a power plane vs. a ground plane was a "good" or "bad" idea, but that's just what I ended up doing. So, those traces aren't really representative of the actual PCB.
3. The 7805 does get a little warm but since I raised the resistance for the 7-segment LEDs (by a lot), it's not "hot". I have a heatsink and sil pad coming in the mail tomorrow. I am using a 2A, 12V wall adapter.
As for going with a 4-layer board, I have no opposition to it, but I wanted to see if I could pull it off with just two layers; I feel like (as someone who isn't an electrical engineer) it's probably fine.
Now, here's some exciting news: I tried something I should've tried days ago: pushing some bytes onto the stack before the interrupt occurs. I haven't tested this yet with hardware interrupts, but with a BRK, that actually "fixes" it! I haven't tried every possible combination, but I do know that pushing just a single byte is enough to get it working.
So, definitely going to check all the address lines for continuity...
So, it's not solved per se, but for now it looks like as long as the stack pointer is not $FF, this issue doesn't occur. But like I said, I haven't tried every possible value for the stack pointer.
EDIT: As far as I can tell, this failure only occurs when the stack pointer of $FF.
EDIT 2: Okay so, bad news: I wrote a program that uses a timer from a VIA to count up by seconds on the 7-segment LEDs, and it is now working, even if the stack pointer starts out at $FF, so. I am very confused.