assignment

This week we were tasked with creating an addressed network of boards that can communicate information to each other.

design

After having some difficulty creating a 72-pin touchpad with one microcontroller, I decided to move toward using multiple microcontrollers that will have to talk to each other. So, I decided to build a smaller prototype board with three microcontrollers: one master microcontroller that interpreted the result from two other ATTiny44s with three touchpads each.

An ATTiny44 with three touchpads.

The "master" ATTiny44 with LEDs.

The idea was to have the boards communicate using the existing programming header: the master would send over MOSI the name of a board it wants information from. Each touch board listens to MOSI and when it hears its name, connects to MISO and outputs the data. Since I'd used bit-banging serial before, I figured this would be a good way to encode the information.

After making hordes of touch boards, I got the touch working fine.

But the serial communication ended up being much harder than I expected... I could successfully echo the raw serial signal from a slave board to my computer through the master board, but as soon as the master board started trying to decode the serial signal from MISO and then re-encode and echo the signal to my laptop, it got back only gibberish...

I ran a ton of tests and could send binary signals (on/off when a pad is touched) across the communication line. I even ran a test generating a 1Hz square wave on the master board over MOSI, to which the slave board would light up and echo the wave back on MISO, to which the master board would light up. This showed that the full communication loop between master and slave boards worked fine.

This led me to believe there was a timing issue between the controllers. I was confused how, when reading a serial character, the board is always aligned to the framing of a character. I didn't have an oscilloscope at home to test, so I will continue to test in the shop.

My (currently) non-functioning code can be found here, and the board can be downloaded here.

The continuation of my networking adventure can be found here!