PAW6 - GolGrid - Conways Game Of Life

A place to document your own projects.

PAW6 - GolGrid - Conways Game Of Life

Postby matseng » Sun Jan 13, 2013 12:49 pm

As mentioned in an earlier post I'll try to do one small PCB project every week and then send for PCB's of it every Monday.

Last weeks board was a simple breakout board so this week I'm planning to do something a little bit more elaborate. I've been playing with programs emulation Conways Game Of Life (http://en.wikipedia.org/wiki/Conway's_Game_of_Life) since the early 80'ies on computers. But now is the time to make a hardware implementation of it.

A GameOfLife in hardware is certainly not a new or unique idea, Adafruit is selling a kit (by Dropout Design) for $17 with 4x4 pixels that can be linked into larger arrays with more pixels.

This weeks PAW will be a similar board, but SMD and using a small and cheap 14 pin PIC as the board microcontrollers. Unlike the Dropout board that have an elaborate communication between the boards to determine the next state of the grid my boards will merely be slave boards that only displays what the master tells them to display on the leds.

So one of the boards in the array of boards will have a more powerful PIC on it that will act as the master and send the grid updates to all slave controllers. The master board will probably also have a USB port for both power and maybe to upload data from a PC to be displayed on the GolGrid array.

Each 5x5 cm board will have 16 leds in a grid of 15mm. This means that if the boards are separated by exactly 10 mm the spacing between the outer leds of adjacent boards also will be 15 mm - making up a nice even grid of leds.

To easily get the distances between the boards correct I'll use standard paper staples since they are 13 mm wide (crown width) so if I put vias 1.5 mm from the edge of the board I can just plunk down a staple and get the 13-1.5-1.5=10 mm distance and at the same time transfer power and data between the boards.

Three staples in each direction is enough for VCC, GND and a common databus. Having a common databus means that each board needs to have a board number or board coordinate stored in its eeprom so it can filter out just the messages that are meant for it.

I'll probably use a PIC16F1824 which cost just over a dollar. Add $0.60 for leds, $0.30 for resistors and $1 for the pcb and the parts cost for a board in small quantities is only about $3 to $3.50.

BoardMeasurements.png
Two boards next to each other with distances
User avatar
matseng
Hero Member
Hero Member
 
Posts: 876
Joined: Sat Oct 15, 2011 12:29 pm
Location: Kuala Lumpur, Malaysia

Re: PAW6 - GolGrid - Conways Game Of Life

Postby Sjaak » Sun Jan 13, 2013 2:15 pm

If you want a more intelligent adressing scheme, you can send the packets through every node and let each node decrease the id of the packet. If the id is zero the node use the data otherwise forward it down the line.
User avatar
Sjaak
Fellow
Fellow
 
Posts: 3001
Joined: Sun Jan 03, 2010 2:45 pm
Location: Hiero

Re: PAW6 - GolGrid - Conways Game Of Life

Postby matseng » Sun Jan 13, 2013 10:24 pm

I was thinking of doing that first, but that would require that the data-connection between the boards are in one single chain. It would be possible to have some jumpers on the board to select in which direction the TX & RX of the microcontroller would be routed in order to build a contiguous chain snaking back and forth in the grid.

Another advantage of this is that the signal is regenerated in every node. That is not really super important today with high-impedance inputs and standard output drivers that can source/sink 25 mA without breaking a sweat. Back in the 80'ies a normal fat-out (number of inputs a output in the same family could drive) was about 5, more than that and you'd need to buffer the signal.

The coolest thing would of course be four separate tx/rx pairs in each direction, then the topology of the grid (5x5 boards or 3x15 boards) could be auto-detected and no configuration would be necessary at all. Microcontrollers with four uarts are not common, but the uarts could be implemented in bitbanged firmware especially if the speed is kept low like 2400/4800 bps or so. But this would require a lot of extra firmware and eight extra i/o-pins on the microcontroller as well so I stick with the easiest possible thing. Just a common uni-directional bus where addressed packets will be picked up by all nodes.

Since there are only 16 leds on each board the packages will be tiny. Allowing for a unique start-byte to avoid synchronization problems four bytes should be enough.

Code: Select all
Byte 0  -  1AAA AAAA
Byte 1  -  0AXX XXLL
Byte 2  -  0LLL LLLL
Byte 3  -  0LLL LLLL


Most Significant bit = 1 on the first byte in each package
A=Address/Id (8 in total for max 256 boards)
X=Spare/Unused
L=LED status bits (16 in total)
User avatar
matseng
Hero Member
Hero Member
 
Posts: 876
Joined: Sat Oct 15, 2011 12:29 pm
Location: Kuala Lumpur, Malaysia

Re: PAW6 - GolGrid - Conways Game Of Life

Postby matseng » Sun Jan 13, 2013 10:44 pm

I did a quick schematic this morning. It's really simple but it probably needs to be revised....

The leds are in a 4x4 matrix with the cathodes driven by 2n7000 n-fets. A setup button is connected to the slave processor for setting the board id. The slave processor will be running on its calibrated RC-oscillator and that will hopefully work as intended - if not some kind of autocalibration need to be implemented.

All boards will have the footprints for the master processor (currently PIC18F2550), a mini USB, crystal and some caps on them. But these parts will only be populated on one of the boards in each grid.

Schematic1.png
First schematic of GolGrid
User avatar
matseng
Hero Member
Hero Member
 
Posts: 876
Joined: Sat Oct 15, 2011 12:29 pm
Location: Kuala Lumpur, Malaysia

Re: PAW6 - GolGrid - Conways Game Of Life

Postby matseng » Mon Jan 14, 2013 4:42 am

Using the Microchip MAPS tool (http://www.microchip.com/maps/microcontroller.aspx) I took a quick look at what options I've got for the slave processor.

My requirements are 5 volts, internal oscillator, 14 or 18 pin device, some eeprom. Sorting the 21 matches on price the two cheapest are PIC16F526 and PIC16F1823.

The '526 is $0.62 in 100-quantity, have 1 Kwords Flash, 67 bytes Ram and 64 bytes eeprom.
The '1823 is $0.90 in 100-quantity, have 2 Kwords Flash, 128 bytes Ram and 256 bytes eeprom AND a serial port (eusart)

I'm sure that I can fit the firmware in the '526 since all it needs to do is to collect four bytes of serial data and update 16 booleans with the received data while it in the background refreshes the leds at about 100 Hz. Easy peasy...

But the '1823 have a hardware serial port so I don't need to make a bitbanged serial receive-function in software. That will save a lot of hacking. But on the other hand it goes against every fiber in my body to spend $30 extra on hardware when I can do something in firmware instead.

Luckily the '526 and '1823 share the same pinout (except that on one of them the ports are PORTA instead of PORTB) so I can actually start with the simpler-to-program '1823 and then just update the firmware later if I would want to support the '526 for a larger installation.
User avatar
matseng
Hero Member
Hero Member
 
Posts: 876
Joined: Sat Oct 15, 2011 12:29 pm
Location: Kuala Lumpur, Malaysia

Re: PAW6 - GolGrid - Conways Game Of Life

Postby matseng » Mon Jan 14, 2013 5:10 am

Files 'n stuff are kept here --> https://github.com/SmallRoomLabs/GolGrid
User avatar
matseng
Hero Member
Hero Member
 
Posts: 876
Joined: Sat Oct 15, 2011 12:29 pm
Location: Kuala Lumpur, Malaysia

Re: PAW6 - GolGrid - Conways Game Of Life

Postby matseng » Mon Jan 14, 2013 6:04 am

Did a quick routing of the PCB while having a few cups of coffee at Starbucks.... This is what I ended up with.

GolGrid-v1-960.png
Only the LEDs at the front, all the other parts hidden at the back of the PCB


I'm not too sure that I will keep it this way, I think I want to have all parts an the top this time so it will be cheaper to P&P a bunch of them some day... Or at least it will be easier to stencil solder paste, place the parts manually and then reflow them myself.
User avatar
matseng
Hero Member
Hero Member
 
Posts: 876
Joined: Sat Oct 15, 2011 12:29 pm
Location: Kuala Lumpur, Malaysia

Re: PAW6 - GolGrid - Conways Game Of Life

Postby nickjohnson » Mon Jan 14, 2013 6:45 am

You can get packages with multiple NFETs in one, which would reduce part count. I believe TI have a replacement for the venerable darlington array along those lines.

Also, are those surface mount headers for power etc? How do you plan to connect to them?
nickjohnson
Sr. Member
Sr. Member
 
Posts: 287
Joined: Mon Nov 26, 2012 4:32 am

Re: PAW6 - GolGrid - Conways Game Of Life

Postby matseng » Mon Jan 14, 2013 10:39 am

Ah yes, I haven't been thinking about the dual n-fet devices for a long time. Maybe it's time I reacquainted myself with them. I usually use a standard 2n7002 single n-fet transistor for things like this. They are very cheap, like $0.08 each in 100qty. The dual version can be found for $0.19 each in the same quantity. So they are slightly more expensive, just a few cents, but that might be offsetted by lower P&P costs.

Not at Seeedstudio though - they seem to charge by the number of pads...

No, the two sets of pads on the back of the board is for iscp/isp for the two PIC microcontrollers. The layout and pitch is correct for just taking a long-legged header and put it into a Pickit programmer and then just press the header down into the 0.5 mm holes (too small for the header to actually fit into it, but it will hopefully help keeping it in place more steadily.) They can of course be used for a real programming jig with pogopins as well....

For smaller arrays the power is planned to come via the mini-usb connector on the master-pcb. When going up to somewhat larger arrays the power needs to be fed via the 0 & 5 volt buses at the edges of the boards. That should not be a problem since the array needs to be mounted or suspended in a frame anyways and the wires suspending the array can also be used to "invisibly" supply the power as well. Two birds with one stone. :-)
User avatar
matseng
Hero Member
Hero Member
 
Posts: 876
Joined: Sat Oct 15, 2011 12:29 pm
Location: Kuala Lumpur, Malaysia

Re: PAW6 - GolGrid - Conways Game Of Life

Postby Sleepwalker3 » Mon Jan 14, 2013 6:52 pm

Nothing wrong with BOB's Mats, I think they're a valid project. Now if you really wanted to be retro, you could design the PAW board for a processor of that era, how about a Z80? I've still got one or two floating around ;)
User avatar
Sleepwalker3
Hero Member
Hero Member
 
Posts: 505
Joined: Mon Jan 16, 2012 4:12 am
Location: Down Under

Re: PAW6 - GolGrid - Conways Game Of Life

Postby matseng » Tue Jan 15, 2013 4:12 am

Mmmm... Z80... I actually did a few prototypes of a standard PC keyboard with a integrated Z80, character LCD and a modem to send text messages for a cellphone operator in Sweden back in 1985.

A CDP1802/COSMAC board would also be fun to to, but it's too hard to get the vintages cpu's for a decent price. I don't really fancy paying $30-$100 for an old microcontroller.
Last edited by matseng on Tue Jan 15, 2013 6:28 am, edited 1 time in total.
User avatar
matseng
Hero Member
Hero Member
 
Posts: 876
Joined: Sat Oct 15, 2011 12:29 pm
Location: Kuala Lumpur, Malaysia

Re: PAW6 - GolGrid - Conways Game Of Life

Postby matseng » Tue Jan 15, 2013 6:26 am

Re-routed the board with all the parts at the top...

GolGrid-v2-Master.png
Populated with parts for a Master


GolGrid-v2-Slave.png
Only the standard Slave-parts are on this board


GolGrid-v2-bottom.png
Bottom of board with the two programming headers
User avatar
matseng
Hero Member
Hero Member
 
Posts: 876
Joined: Sat Oct 15, 2011 12:29 pm
Location: Kuala Lumpur, Malaysia

Re: PAW6 - GolGrid - Conways Game Of Life

Postby nickjohnson » Tue Jan 15, 2013 8:35 am

Please, please put an apostrophe in Conway's before sending the boards off for fab. ;)
nickjohnson
Sr. Member
Sr. Member
 
Posts: 287
Joined: Mon Nov 26, 2012 4:32 am

Re: PAW6 - GolGrid - Conways Game Of Life

Postby matseng » Tue Jan 15, 2013 9:22 am

nickjohnson wrote:Please, please put an apostrophe in Conway's before sending the boards off for fab. ;)


Will do, thanks.

Apostrophes are the most difficult punctuation (if it actually belongs in the punctuation group at all?) to get right.

"The PCB's are blue" or "The PCBs are blue"?
"DP is Ians company" or "DP is Ian's company"?

And how do you do with a name that ends with a S like my name?

"DP is not Mats company" or "DP is not Matss company" or "DP is not Mats's company"?
Here maybe the easiest thing to do is just rewriting the sentence.
"Mats does not own DP"
User avatar
matseng
Hero Member
Hero Member
 
Posts: 876
Joined: Sat Oct 15, 2011 12:29 pm
Location: Kuala Lumpur, Malaysia

Re: PAW6 - GolGrid - Conways Game Of Life

Postby Alex555 » Tue Jan 15, 2013 9:53 am

"DP is not Mats' company."
Alex555
Full Member
Full Member
 
Posts: 107
Joined: Mon Oct 22, 2012 10:45 pm
Location: USA

Next

Return to Project logs

cron