Scott Zitek - Fab Academy 2014

Networking and communications

Week 13 Assignment

The assignment for this week is to design and build a wired &/or wireless network connecting at least two nodes. I decided to make a small network based upon a serial asynchronous bus.


Bus bridge

  1. I used Eagle CAD to create a modified version of the ATtiny45 based hello.bus.45.bridge.cad design and added a second LED.
  2. Eagle CAD schematic for bus.45.bridge


    Eagle CAD board layout for bus.45.bridge


    Completed bus.45.bridge circuit showing components and connections.


bus.45.bridge related files


Bus node #1

  1. I used Eagle CAD to create a modified version of the ATtiny45 based hello.bus.45.node.cad design and added a second LED.
  2. Eagle CAD schematic for bus.45.node


    Eagle CAD board layout for bus.45.node


    Completed bus.45.node circuit showing components and connections.


bus.45.node related files


Bus node #2

  1. I decided to design a version of the bus node using an ATtiny44 so that I could add additional input and output features. I used Eagle CAD to create an ATtiny44 based node board that has two LEDs, a pushbutton, an optional photo-detector, and an optional 20 MHz crystal.
  2. Eagle CAD schematic for bus.44.node


    Eagle CAD board layout for bus.44.node


    Completed bus.44.node circuit showing components and connections.


bus.44.node related files


Setting up the network

  1. I started by programming the bridge node. To do this I needed to connect the FTDI cable for power and the ISP.

  2. I then programmed the nodes one at a time by connecting them to the ISP and to the bridge node by the bus cable in order to receive power.

  3. After all the nodes were programmed I put them on the network at the same time.
  4. All three nodes


  5. I first tried to communicate the with the nodes using term.py in Ubuntu 12.04 by using the command: sudo python term.py /dev/ttyUSB0 9600. The program term.py worked but all three nodes just sat there doing nothing.

  6. I then tried it on my Windows 7 computer. Hyperterminal is no longer included with Windows 7 so I had to find it on the web and install it. I used Windows Device Manager to determine that the FTDI was connected to COM3. I then configured hyper terminal for COM3, 9600 bits per second, 8 data bits, no parity bits, 1 stop bit, and no flow control.

  7. This time the green LEDs on all three nodes blinked each time I pressed a key on the keyboard. The node in the middle of the bus (ATtiny45 node) responded intermittently and sometimes the response was garbled. If I reset the power to the node sometimes it would work better sometimes it would work worse.
  8. Garbled responses


  9. It seemed like a timing problem to me, so I looked into calibrating the clock. Atmel Studio has an option related to this. It said that the OSCCAL value for this chip at 8 MHz was 0x9D. However, I decided to first try to change the bit_delay_time value to 102 (it was initially 100). What a different this made. The node seems to work every time now and the responses are not garbled anymore.

  10. The bridge node was a different story. Although the green LED blinked to indicate it was receiving data, the red LED never blinked and the bridge node never displayed anything on hyperterminal.

  11. Instead of only responding when receiving it's node ID, I edited the bridge program to echo back any data it received.
  12. Really garbled responses from the bridge node.


  13. I don't know if the data is garbled to the node, from the node, or both. However, it appeared that communications with the bridge node was not working well. The input data to the node was probably garbled to the point it did not match it's node ID, which would explain it not lighting the red LED or sending a message to hyperterm. Atmel Studio said that the OSCCAL value for this chip at 8 MHz was 0x58. I decided to first try to change the bit_delay_time value to 104 (it was initially 100). This solved the problem completely. This node also works every time now and the responses are not garbled anymore.

  14. Here is the "serial asynchronous bus" in action.


Back to index