My first experience with serial comunication was during my Exercise n.08 when I uploaded on my Hello Board the code Hello.ftdi.44.echo.c. Check that section for more details.
See also Exercise n.13 for an other example of serial comunication I did during the Fab Academy.
For this assigment I chose to work on serial comunication and in particular with the boards on the week's page.
The bridge board:
The node board:
I downloaded the png files and through Fab Modules following the settings of exercise 04 I created the .rml files.
In particular here the settings fot the traces of the bridge board:
Here the settings for the border:
Traces of the node board:
During the first milling of the board, I set wrongly the zero and this was the result:
Here the boards are almost ready and I were just waiting for the ATtiny45 to arrive.
I made a ribbon cable with 4 lines to connect the boards.
I read the Tutorial "Hello Serial Bus C" from the Fab Academy archive.
I modified the C programs in order to indentify the boards with different ids (0, 1, 2).
But when I powered the first board smoke came out. I disconnected everything and through my multimeter I find out that the V and the Ground were connected together. So I looked for the problem trying to clean around the traces with a cutter, but I got no improvment. So the "bridge-board" was out of service.
I decided to try to go ahead with the other two "node-boards" as far as I could. I figured out that they could be programmed without the "bridge-board" and maybe they even could comunicate between them and with my laptop (but at that point I was not sure).
I powered the board with the ribbon cable, I connected the Fab Isp board
I checked the connections with:
avrdude -p t45 -c usbtiny
The answer:
new-host:2 pablocolturi$ avrdude -p t45 -c usbtiny avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.01s avrdude: Device signature = 0x1e9206 (probably t45) avrdude: safemode: Fuses OK (E:FF, H:DF, L:62) avrdude done. Thank you.
Then I successfully programmed the two node-boards with:
new-host:2 pablocolturi$ make -f hello.bus.45.make program-usbtiny
I connected the boards together:
I opened CoolTerm and I configured the right port:
The boards answered when I sent the character "1" and "2" !!!
I wanted to run also the file term.py from the archive.
It was my very first time running a Python's script and I didn't know where to begin. After some research I finally found a well documentated page.
To run the Python script I would enter, with the terminal in the folder where the script is located:
python name-of-the-file name-of-the-port baud-speed
python term.py /dev/tty.usbserial-FT9FWYH0 9600
The usb serial port name can be found typing:
ls -al /dev/tty.usb*
The script run and the boards answered when I typed "1" and "2" on my keyboard!!!
If you check Final Project - Electronics section, you can se my attempt to turn a DC motor by serial comunication from my laptop. The example was taken from the book Make: AVR Programing, Elliot Williams.