FabAcademy 2017
TUYIHIMBAZE Serge

FabAcademy2017 - Projects





Embedded Networking and Communications
May 10, 2017 - Week#15


I worked on Embedded Networking and Communications connecting two microcontrollers (ATMEGA 328P and ATTINY 45). I Designed and programmed the first board which has the following components.

Microcontroller - Atmega 328p

LDR - Light sensor

Output pins for Servo motors and Lighting LED.

And Serial cable pin headers.




The second board I have made is able to receive signals from the first board through asynchronous bus communication.


I first prepared my boards, Here is the second board I made that has ATTINY 45 Microcontroller.




The Network I made between those two Microcontroller is to allow the First Microcontroller 1 byte of data per second to the receiver Microcontroller connected by asynchronous bus communication to make connections between them.






Implementing and interpreting networking protocols


Network Protocols


A network protocol defines rules and conventions for communication between network devices. Network protocols include mechanisms for devices to identify and make connections with each other, as well as formatting rules that specify how data is packaged into messages sent and received. Some protocols also support message ​acknowledgment and data compression designed for reliable and/or high-performance network communication.


Internet Protocols


The Internet Protocol family contains a set of related (and among the most widely used network protocols. Beside Internet Protocol (IP) itself, higher-level protocols like TCP, UDP, HTTP, and FTP all integrate with IP to provide additional capabilities. Similarly, lower-level Internet Protocols like ARP and ICMP also co-exist with IP. In general, higher level protocols in the IP family interact more closely with applications like Web browsers while lower-level protocols interact with network adapters and other computer hardware.






Wireless Network Protocols


Thanks to Wi-Fi, Bluetooth and LTE, wireless networks have become commonplace. Network protocols designed for use on wireless networks must support roaming mobile devices and deal with issues such as variable data rates and network security. More: Guide to Wireless Network Protocols.


Network Routing Protocols


Routing protocols are special-purpose protocols designed specifically for use by network routers on the Internet. A routing protocol can identify other routers, manage the pathways (called routes) between sources and destinations of network messages, and make dynamic routing decisions. Common routing protocols include EIGRP, OSPF and BGP. More: Top 5 Network Routing Protocols Explained.


How Network Protocols Are Implemented


Modern operating systems contain built-in software services that implement support for some network protocols. Applications like Web browsers contain software libraries that support the high level protocols necessary for that application to function. For some lower level TCP/IP and routing protocols, support is implemented in directly hardware (silicon chipsets) for improved performance. Each packet transmitted and received over a network contains binary data (ones and zeros that encode the contents of each message). Most protocols add a small header at the beginning of each packet to store information about the message's sender and its intended destination. Some protocols also add a footer at the end. Each network protocol has the ability to identify messages of its own kind and process the headers and footers as part of moving data among devices. A group of network protocols that work together at higher and lower levels are often called a protocol family. Students of networking traditionally learn about the OSI model that conceptually organizes network protocol families into specific layers for teaching purposes. More: How Computer Networks Work - Introduction to Protocols.



I attached here a video that shows how two boards are connected and communicating.


Programming Process


After I knew how to compile the code and edited the libraries to work with ATtiny45, I could start editing the code to make it communicate between the boards. I build up the code step by step, to see if everything was working the way I thought it would. But the mistake I was making is to write codes that seemed to control a pin remotely using a serial cable, which was not applying any networking protocal. So secondly, I programmed the boards with simple codes to check the LED lighting by pressing button on the transmitter board, but also I was missing the receiver codes. I used a bit of code to test my networking boards, because I didn't realize before that I had to write codes for both micro-controllers to communicate The LED on the master board was working the way I wanted, but not in normal networking protocal. Later I had to use ATTINY I2C Protocal to make networking correct. Here are Codes Attached