Wednesday, 21 May 2014

New PCB designs for electronic board game

A while back we got a working prototype of our electronic board game, in the form of a "set-in-space-dungeon-crawler". It worked quite nicely, but as we talked to other tabletop gamers, it became apparent that a generic gaming system would have a much wider appeal (not everyone is a sci-fi/Warhammer 40K fan!)

So we set about making a series of generic 6x8 board sections, which could be arranged in any number of ways: in a 3x2 arrangement to create a playing surface 12 x 24 squares in size (perfect for a football/sports pitch, meaning we're eventually getting close to creating our electronic Blood Bowl game that was started so many years ago!) or even a 6x1 arrangement, to create a big long 8 x 36 grid which could be used as a Wild West town, complete with model buildings along each long edge.

Our original design used two 16F883 PIC microcontrollers, each with 28 pins. Allowing for power, ground and data lines, this gives us 24 i/o pins on each mcu, for a total of 48 for each 6x8 board section.

Now we're using software serial (bit-banging) for data transfer, and the internal oscillator on the chip, running at 8Mhz. During testing, everything has worked fine. But there's just a nagging feeling that this might not be quite good enough for a production board: in the past we've had problems with software serial on a 16F628 running on its own internal oscillator - after a few minutes (and particularly if the chip is face down on the table with no ventilation, so the ambient temperature can rise over time) the bits of data can drift, giving inaccurate readings.

When we had problems like this in the past, they were fixed quite easily by adding a crystal to the mcu. But we don't have any spare pins to add a crystal to each mcu on our board sections - all our pins are used for i/o lines!

The answer?
PISO shift registers!

The 74HC165 is a parallel in serial out (PISO) shift register. It can be used with similar shift registers, and they can all share the same clock and latching lines, while the data can be cascaded from one shift register to the next.

After four or five attempts, we've finally got a board design that
a) we're happy with
b) uses only surface mount parts (so the back of each board section is completely flat and requires no additional enclosure to be built around the pcb)

We're using the original connector idea, only this time we need only three pins. In our earlier version, we used five pins, so that each socket was symmetrical (a mirror image on both sides) which allowed the different board sections to be placed in any orientation. To keep things simple, with this design, we're going to force all boards to be placed the same way around - the easiest way to achieve this is to place the connectors slightly off centre. Once we know that boards can only be connected a certain way around, we don't need the extra pins and can keep the connectors down to just 3 pins, instead of five.

Of course, a new board layout means a new mdf laser cutting template, with extra holes for all those shift registers:

With these designs complete, we're ready for the next BuildBrighton open evening, to have a go at laser etching the board(s) and laser cutting the mdf, to give this new design a trial run. If all goes well, we might even make this the first design that we have a go at screen printing, once we've got our new space at the Boiler Room Studios up and running!

No comments:

Post a comment