The discussion today focused on networking with embedded system.
Download my files for this week's project here
I began this week by designing a simple PCB in EagleCAD that could be used as either a node or a bridge device. I had first chosen to implement SLIP so I designed my board based on Neil's example SLIP code as I didn't see his design on the webpage (I later found that it was in the RS232 section). After trying to get my SLIP boards to communicate, I realized I needed to simplify my code to test whether or not my serial baud rate was correct for each board so I moved to the simple RS232 implementation instead. I am glad I did because I had to change my bit_delay to 101 for each of my boards. This proved to fix my communication problems. I stuck with the RS232 to develop my node-to-node communication algorithm before moving on to SLIP.
My board has 2 buttons in addition to the LED. The concept is that
multiple devices will be connected together. Each device has an
address. When a node receives a message addressed to it, it will
flash an LED. If a button is pressed on this device, it will take
control of the medium and send out the address of another device on
the network. The left button will send a message to the current
node's address -1, and the right button sends a message to the current
node address +1. This wraps around to create a loop. I made 3
boards with the addresses 0,1, and 2.
The buttons work as follows:
Current Node ID |
Message sent when left button is pressed | Message sent when right button is pressed |
0 |
1 | 2 |
1 |
2 | 0 |
2 |
0 | 1 |
This results in the behavior shown in the video below.
Here is a link to all of my related files for this project.
Here are a couple of pictures of the boards. The first one shows all 3 nodes wired up to the FTDI cable, and the second picture shows a close-up of two nodes.
(Click this link if embedded video is not working)
Web template design: davereederdesign.com