After numerous builds, re-build, teardowns and start-again-from-the-ground-up-builds, we've got a pcb design we're happy with and firmware that works consistently well in all environments. All that remains is to wire the thing up to out board panels.
Since we're multiplexing the hall sensor array, we need only 15 wires (7 rows, 7 columns and absolutely not forgetting, no-way-we've-never-left-out-before, the ground connection) which is a massive improvement over the 50 or so we originally had to hand wire!
So far so good.
...actually wiring the thing is a right pain!
Since the PCB is on the underside of the board, it's a laborious task to solder one wire on the board, thread it through to the sensor row on the other side, solder it down to the correct row/column, then get the next wire and repeat. Not least because we always have to leave enough wire so the PCB isn't held up close against the back of the panel, so that it can be repeatedly flipped over for more wires to be soldered to it. The end result is a board with loads of big long loops of wire all over the place!
As well as being a pain to solder because of all the back-and-forth and board flipping, the AWG gauge wire is still a little too thick to be manageable for a final design.
So we had to come up with an idea to simplify the wiring process.
Firstly, we had to use the thinnest wire we could get hold of - which meant 0.125mm enamelled wire. Easy enough to get hold of, but tricky to solder (without the use of a solder pot). Then we had to come up with a method that would allow us to solder all the wires onto the PCB in one go, thread them through the board and solder them to the appropriate row/column on the topside.
The obvious solution would be to use a different coloured wire for every connection on the PCB. This seems obvious. Except it also means having to use relatively thick gauge wire (the coloured sleeve making up the bulk of the wire) and having a selection of at least 15 different coloured wires. It also means we'd have to be absolutely consistent with every coloured wire - so, for example, red would always have to go to pin1, blue to pin2 etc.
Instead of this, we built a "test rig".
The test rig allows us to "probe" each wire to find out which row/column it's connected to. We do this by putting the PCB into "test mode" when it boots up. We then send it serial commands to raise just one of the seven source-driver outputs high at any one time. So we send R1 and the driver output relating to row one goes high. R2 and all but the driver output relating to row two goes high. R3 and... well, you get the idea.
We now have a bunch of seven wires, one of which has been raised high to 5v. Simply brush each wire along the anode leg of an LED and when it lights up, you've found which wire is connected to which "row" output on the PCB.
Similarly the other seven wires are connected to the "column" inputs on the PCB. The PCB is continually monitoring these input pins (with internal pull-up resistors) waiting for one (or more) to go low (this is the basis of how the electronic board game actually works). So when one input goes from high to low, it sends out a serial message along the lines of C1 (for column one) C2 (for column two, and so on).
Touching each of these wires to ground sends a serial message back to our test rig, showing which column wire has been grounded - so we know which column on the board panel to connect it to.
All serial messages are displayed on the 16x2 character display (for no other reason than we had a few lying around!) and the status of each row/column is displayed so we can tell exactly which pin is wired to which wire, without having to keep flipping the board over and tracing each wire back to the PCB.
Being wired up on a breadboard, our test rig works. But it's a bit shonky. What it really needs is a nice PCB and enclosure, just to tidy it all up and make it a bit more reliable. Maybe we'll get round to that, once we've got a couple more of these board panels soldered up!