Networking and Communications

This week I set out to make a simple serial interface between two attiny45s. Rather than interfacing the tiny with a computer via USB-serial, I wanted to send information - a string of numbers - from one attiny to the other, which would blink an LED for certain transmitted values. To do this I wrote a code to program the "transmitter" board that would print the numbers 0 through 8 in a repeating loop, and wrote a program for the "receiver" board that sent a HIGH signal to an output pin every time it received the number 4, turning on an LED driven by the output pin. I designed, milled, and stuffed the two boards and used Attiny45 microcontrollers, since I did not need the 44's extra pins. Both have a power LED to indicate a functioning power supply, and the receiver board also has an LED controlled by an output pin (PB0). I copied Neil's unrolled loop for sending bytes of data serially, bit by bit. The transmitter code ran fine and uploaded to the board, but I kept getting rc=-1 when trying to upload the receiver code to the receiver board, despite testing the board many times with a multimeter and seeing the power LED light up appropriately. Since the boards weren't designed with FTDI headers in mind, I wasn't able to verify outputs on a computer using FTDI-USB; the boards talk to each other via their 6-pin headers.

serialtransmitter.c
serialreceiver.c