Game of life-style game with multiple KL25Z

09 Jan 2014

Hi everyone!

I'm currently working on a project where I hope to create a game of life-style game in which I have an 8x8 array of kl257 boards, each representing a single cell on the grid. Each cell will need to communicate a character string to its 8 nearest neighbours, as well as store the information it receives from its 8 nearest neighbours. I'm having trouble finding where to start in order to achieve this 8, 2 way, neighbour communication. I've managed to set up simple two-way communication between two boards over a serial port, but at that point I run out of serial ports.

I have only very basic programming experience and absolutely zero electronics experience, and over the past few weeks have pretty much been bumbling from one disaster to the next, so it's very likely that the solution is either painfully obvious or totally impossible :P either way I'd really appreciate any help or advice

Thanks in advance,

Charlie

09 Jan 2014

The KL25Z supports 2 serial ports (PTD2, PTD3 for serial 2 and PTC3, PTC4 for serial 1) in addition to Serial 0 which is used for PC host messages/debugging. Assuming that the communication bandwidth for your application is relatively low, you could implement a communication bus based on a ring structure that uses 2 serial ports for each device. You would then need to write or find software to receive messages addressed at a particular node while forwarding all other messages to the next node in the ring. Some sort of timing protocol or master node system will be needed to keep things sorted. Alternatively you could implement such a bus solution using a single serial port and RS485 type drivers. A bus based on I2C would be another option, however it seems that currently the software for an I2C slave is not yet available for the KL25Z. The LPC1768 does support I2C slave modes and also offers CAN bus or even ethernet as alternatives.