FAB ACADEMY 2013////////////////////////////
Javier Pérez Contonente aka Japi

Week14 .- Networking and communications

The purpose of this hello world example is to network several boards together in the form of a serial bus. The bridge board is connected to a computer via a FTDI cable. The three nodes boards are connected to the bridge board.

Nodes

I downloaded the png boards diagrams from here then I milled and soldered the boards: One bridge (with an FTDI header to conncet to the computer) and three nodes:

boards

For each node in the network I modified the "hello.bus.45.c".
Each node needs to have a different ID number, in my case (0, 1, 2, 3) changing the next line:

Changing node ID

Once the c file is saved. Connect the bridge board to your computer with the FTDI header and using your FabISP, flash the bridge board with each node number:


Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.


C:\Users\Japi\Documents\My Box Files\___MASTER___\__fabAcademy__\Week_14_Network
ing and communications\hello.bridge\bus_fixed>make -f hello.bus.45.make program-
usbtiny
avr-objcopy -O ihex hello.bus.45.out hello.bus.45.c.hex;\
        avr-size --mcu=attiny45 --format=avr hello.bus.45.out
AVR Memory Usage
----------------
Device: attiny45

Program:     796 bytes (19.4% Full)
(.text + .data + .bootloader)

Data:          4 bytes (1.6% Full)
(.data + .bss + .noinit)


avrdude -p t45 -P usb -c usbtiny -U flash:w:hello.bus.45.c.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e9206
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed

         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "hello.bus.45.c.hex"
avrdude: input file hello.bus.45.c.hex auto detected as Intel Hex
avrdude: writing flash (796 bytes):

Writing | ################################################## | 100% 0.73s



avrdude: 796 bytes of flash written
avrdude: verifying flash memory against hello.bus.45.c.hex:
avrdude: load data flash data from input file hello.bus.45.c.hex:
avrdude: input file hello.bus.45.c.hex auto detected as Intel Hex
avrdude: input file hello.bus.45.c.hex contains 796 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.48s



avrdude: verifying ...
avrdude: 796 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.


C:\Users\Japi\Documents\My Box Files\___MASTER___\__fabAcademy__\Week_14_Network
ing and communications\hello.bridge\bus_fixed>



Once the all the boards are flashed you can communicate with your network through the ARDUINO IDE in the serial monitor window:

Arduino serial monitor

Or running the python program term.py:


Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Japi>CD C:\Users\Japi\Documents\My Box Files\___MASTER___\__fabAcademy_
_\Week_14_Networking and communications\hello.bridge

C:\Users\Japi\Documents\My Box Files\___MASTER___\__fabAcademy__\Week_14_Network
ing and communications\hello.bridge>python term.py COM3 9600



Python terminal

THe three nodes and the bridge working:

Network working