Hey Everyone.Bit of Backstory
(skip to the problem if you prefer)
My group and I are building a micromouse for a university project.
We have built a PCB based on the SMD AtMega168 and have been developing for some time. Going reasonably well.
We recently got back our new board and populated it with an AtMega 168 again but found its behaviour to be erratic. After extensive code testing and going crazy, it seemed that we were running out of ram, so we upgraded to the AtMega328. Our problems however, continued.The Problem
We have tested the exact same code to run flawlessly on the old board, but the exact same code on the new board is unpredictable.
Sometimes, the mouse will execute most of the movements we program. Reset and try again, and it may only move one square.
Reset and try yet again, and it may not move at all. No programming inbetween, just resetting (we also tried completely powering off each time)
There appears to be some kind of hardware issue with the new board.
The board came from the same schematic as the old board with only very minor wiring changes. One thing that I noticed was a decoupling capacitor for the micro is now nowhere near where it should be (thanks to autoroute).
Could that cause these issues?
Also tried a 2200uF cap on the 5V rail to see if that helped. It didnt.
Also also tried testing the motor controller (as it was upgraded from an L293D to an SN754410) and checking the crystal on a scope, it seems to be fine, hitting 20MHz on the dot.
Here are some photos of what we're dealing with, just so you can see.
Any help on what we can try would be appreciated as we are all about to go insane.
Thanks in advance!