<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://projectswiki.eleceng.adelaide.edu.au/projects/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=A1628314</id>
	<title>Projects - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://projectswiki.eleceng.adelaide.edu.au/projects/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=A1628314"/>
	<link rel="alternate" type="text/html" href="https://projectswiki.eleceng.adelaide.edu.au/projects/index.php/Special:Contributions/A1628314"/>
	<updated>2026-05-04T02:44:25Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.4</generator>
	<entry>
		<id>https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2015s1-12_An_Open-Source_Local_Area_Network_(LAN)&amp;diff=5271</id>
		<title>Projects:2015s1-12 An Open-Source Local Area Network (LAN)</title>
		<link rel="alternate" type="text/html" href="https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2015s1-12_An_Open-Source_Local_Area_Network_(LAN)&amp;diff=5271"/>
		<updated>2015-10-23T04:03:12Z</updated>

		<summary type="html">&lt;p&gt;A1628314: /* Potential Issues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Introduction&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Team&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Members:&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Robert Long&amp;lt;br /&amp;gt;&lt;br /&gt;
Oscar Evans&amp;lt;br /&amp;gt;&lt;br /&gt;
Luke Hub-Mayner Warner&amp;lt;br /&amp;gt;&lt;br /&gt;
Leigh-Anthony Noye&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Supervisors:&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Andrew Allison&amp;lt;br /&amp;gt;&lt;br /&gt;
Braden Phillips&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Project Information&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
We will develop an Open-Source Local Area Network (LAN), based on the Arduino platform, and using the C&lt;br /&gt;
programming language. The purpose of this network is to serve as a simple low-cost platform for teaching principles&lt;br /&gt;
of real-time and embedded systems. There are three stages of development:&amp;lt;br /&amp;gt;&lt;br /&gt;
1. Get the Arduino up and working with an LCD display and a number pad, and program it as a glass type-writer, with&lt;br /&gt;
modes for the alphabetic characters, after the fashion of many mobile telephones. Students will need to use multiple&lt;br /&gt;
processes (threads) to control the display and the keypad, and to buffer characters.&amp;lt;br /&amp;gt;&lt;br /&gt;
2. Get Two, or more, Arduino microcontrollers exchanging text on an I2C bus. At this stage there is no collision&lt;br /&gt;
detection or addressing.&amp;lt;br /&amp;gt;&lt;br /&gt;
3. Provide an application layer which allocates addresses to clients. If I send a text as: &amp;quot;#57 Mr. Watson - Come here&amp;quot;&lt;br /&gt;
I want to see your number then the message: &amp;quot;Mr. Watson - Come here&amp;quot; appears only on the display of&lt;br /&gt;
client #57, and no other client. (There is still no encryption or security, just the convenience of an address.)&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Background&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
As mentioned throughout this wiki article, the overall aim of this project is to develop a platform that can be used to teach basic &lt;br /&gt;
real-time concepts in a limited embedded system. &amp;lt; br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For this reason, the C programming language has been chosen as the main language in this project. C provides a low enough level of abstraction &lt;br /&gt;
for students to be able to appreciate the underlying effects of real-time paradigms, without becoming wrapped up in something like assembly code.&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Aim&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
This project aims to produce an open source local area network (LAN). It is to be based on&lt;br /&gt;
the Arduino platform and use the C programming language. This must operate over an I2C&lt;br /&gt;
bus on the Arduino units with each unit to have its own bus connecting to a centralised server.&lt;br /&gt;
Each client unit must also have its own display and keypad for input/output interaction with&lt;br /&gt;
users. The purpose of this is to create a simple, low-cost platform for teaching principles&lt;br /&gt;
of real-time and embedded systems. This system is to include an application layer which&lt;br /&gt;
allocates addresses to clients however there will not be any security or encryption included.&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Motivation&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
The University of Adelaide course, Real Time and Embedded Systems, utilises the C pro-&lt;br /&gt;
gramming language to teach real-time and concurrency methodologies. To ensure this is&lt;br /&gt;
effective as possible it is best to use teaching tools which are grounded in familiar tools.&lt;br /&gt;
This is why the example of a LAN implemented in Arduino units using C is a compelling&lt;br /&gt;
choice. Likewise I2C is a well-developed and extensively used bus protocol. Exposing students &lt;br /&gt;
to these tools and protocols which are actively being used in industry is an invaluable&lt;br /&gt;
experience. In previous years, the course has utilised desktop computers to teach the C in&lt;br /&gt;
practicals and the PIC microprocessors as a teaching tool for the embedded systems theory.&lt;br /&gt;
The outcome of this project will enable the two sets of theory taught by the course to be&lt;br /&gt;
concatenated thus removing current disjointed approach of practicals.&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Significance&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
With several closed source networking options available, providing a simple open source alternative is&lt;br /&gt;
an advantage. Physical implementation is left to the user, and such this system might find itself in large scale remote sensing and monitoring situations. &amp;lt;br /&amp;gt;&lt;br /&gt;
Some examples might include: &amp;lt;br /&amp;gt;&lt;br /&gt;
1. Vineyard water table level monitoring. &amp;lt;br /&amp;gt;&lt;br /&gt;
2. Mine environment variable sensing.&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Approach/Architecture Design&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
The LAN has a star architecture with token ring methodology. The network will consist of a server and at least two clients terminals. The clients will each be given a chance to send a message in turn and thus holding a token granting access to the server.&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Technical Details&amp;#039;&amp;#039;&amp;#039;==&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;Screen&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
The chosen screen was the LCD12864 and is shown in appendix C. This screen was chosen&lt;br /&gt;
for its flexibility and low cost as discussed above in the budget. It communicates to the&lt;br /&gt;
Arduino through SPI however this is mostly abstracted away and is not of concern to&lt;br /&gt;
this project. The Screen is a 128 x 64 pixel LCD shield. The header bar&lt;br /&gt;
allows for identification information and incoming message alert. Under this there is room&lt;br /&gt;
for the received or in progress outgoing message. The size of this is three rows of sixteen&lt;br /&gt;
characters allowing for a maximum message size of forty five characters long. This is well&lt;br /&gt;
within the memory requirements of the Arduino Uno and should allow for several messages&lt;br /&gt;
to be queued. &lt;br /&gt;
&lt;br /&gt;
A library of code was found for the screen. A significant proportion of this is written&lt;br /&gt;
in C meaning little work is required to utilise this as part of the project. The useful&lt;br /&gt;
inclusions from this library in the context of the project are the font library, the ability to&lt;br /&gt;
draw lines and the cursor function. The font library allows us to select from a wide variety&lt;br /&gt;
of sizes and characters. This will be further discussed below. The line drawing functions allow &lt;br /&gt;
the screen to be sectioned of into user-editable and non-user-editable sections. This also increases &lt;br /&gt;
readability and usability. The cursor function allows for easier message editing but does however bring further design choices.&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;Keypad&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
&lt;br /&gt;
As discussed in previous sections the keypad being used as the primary input device for this&lt;br /&gt;
project is the FIT0129 membrane keypad. Text input will be&lt;br /&gt;
entered in the style of old mobile phone keypad. The keypad&lt;br /&gt;
is to be connected to the Arduino Uno through the digital pass through connectors on the&lt;br /&gt;
screen shield.&lt;br /&gt;
To investigate the waveform of the button presses, one horizontal line was connected to&lt;br /&gt;
a five Volt power source and a vertical line was connected to the oscilloscope. This allowed the waveform to be inspected and the shortest press to be estimated.&lt;br /&gt;
The waveform has very little bounce which implies that including a de-bounce algorithm is&lt;br /&gt;
not necessary in this project. The minimum button press&lt;br /&gt;
time was fifty milliseconds. This is an important as it effects the polling time and total&lt;br /&gt;
utilisation of processing time.&lt;br /&gt;
When a button is held down, the waveform persists. This means a choice has to be made&lt;br /&gt;
between the press counting as a single press or as many presses until the button is released.&lt;br /&gt;
The programming of these two choices is equally challenging and thus it was decided to treat&lt;br /&gt;
21&lt;br /&gt;
the long press as a single press and to wait for the button to be released before looking for&lt;br /&gt;
the new press.&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;Cursor&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
&lt;br /&gt;
The cursor functionality has been started as the included library mentioned above includes&lt;br /&gt;
cursor functions. This has been worked with and functions allowing the cursor to work with&lt;br /&gt;
the chosen screen layout and specifc message size have been outlined in the code. Functions&lt;br /&gt;
allowing the cursor to be moved between characters in all situations have also been created&lt;br /&gt;
for the specifc screen layout that has been chosen. This has lead to a number of design&lt;br /&gt;
decisions which have been made.&lt;br /&gt;
The first is whether the text should be inserted or overridden when the cursor has been&lt;br /&gt;
backtracked through the text. Overriding the text is less intensive computationally and is&lt;br /&gt;
simpler to program. However from a usability perspective insert is the more natural option&lt;br /&gt;
as this is the method of many modern devices. For these reasons override has been chosen&lt;br /&gt;
initially however if time and resources permit insert is an extension goal to the project.&lt;br /&gt;
Secondly a choice between allowing users to insert text anywhere in the message string,&lt;br /&gt;
even after blank space, or only where text has already been placed (or a adding to the end).&lt;br /&gt;
A decision was made to&lt;br /&gt;
allow the user to insert characters anywhere in the message, regardless of unused space and to fill the unused space with spaces.&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;Finite State Machine&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
Due to the restrictive nature of the keypad, a finite state machine&lt;br /&gt;
in the form of old mobile phones is needed to allow users to access all alphabetic characters.&lt;br /&gt;
&lt;br /&gt;
When a button on the keypad is pressed, the position of this press is passed to a decoder&lt;br /&gt;
program. This program essentially takes in a key press and returns an array which is two&lt;br /&gt;
characters long. The first character is the character to be placed on the screen and the&lt;br /&gt;
second character is a message character that is used to tell the program whether to stay&lt;br /&gt;
in the same place, move forward or perform some other special function. It would stay in&lt;br /&gt;
the same place in the situation where it is the first character of a set or where the pressed&lt;br /&gt;
key is the same as the previous. This would mean that the user is still cycling through the&lt;br /&gt;
characters associated with that key.&lt;br /&gt;
It was initially desirable to simply use a two dimensional array to formulate the finite state&lt;br /&gt;
machine. However this was not feasible due to different keys having different amounts of&lt;br /&gt;
characters associated with them. To make this work it would require an array as long as&lt;br /&gt;
the lowest common denominator of the amount. This would turn out to be sixty characters&lt;br /&gt;
long due to there being keys with two, three, four and five characters.&lt;br /&gt;
Thus the code structure used to allow users to cycle through characters was an array of&lt;br /&gt;
arrays, shown in Appendix G. This allowed different lengths to be used whilst still primarily&lt;br /&gt;
using the same method of accessing the characters. A variable is also held to keep track of&lt;br /&gt;
how many times a key has been pressed. This corresponds to which element in the array&lt;br /&gt;
should be returned. This variable is reset when a different key is pressed.&lt;br /&gt;
The secondary return byte allows for special functionality to be returned as well as nor-&lt;br /&gt;
mal characters. This includes:&lt;br /&gt;
1. Send:&lt;br /&gt;
This key initialises the process of sending the message to another client. It tells the&lt;br /&gt;
unit the message is ready and should be sent when the server polls it next.&lt;br /&gt;
2. Save Character:&lt;br /&gt;
When the desired character has been reached and the next character is on the same&lt;br /&gt;
key (for instance two of the same letters in a row) it is necessary to have a key which&lt;br /&gt;
does not add a character but saves the current one and moves the cursor forward. The&lt;br /&gt;
&amp;#039;A&amp;#039; character was used to implement this functionality. When it is invoked the decoder&lt;br /&gt;
program returns a space (as that is the default state of each character in the message&lt;br /&gt;
20&lt;br /&gt;
array) and the signalling character to tell the program that it needs to move forward.&lt;br /&gt;
It is noted this functionality can also be achieved by using the cursor.&lt;br /&gt;
3. State Switch&lt;br /&gt;
When invoked this key switches between the default writing message state and the&lt;br /&gt;
reading message state. This will show any queued messages using first in first out methodology.&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;Inter Integrated Circuit&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
Inter Integrated Circuit known better as I2C (&amp;#039;&amp;#039;pronounced I-squared-C&amp;#039;&amp;#039;) was our chosen communications protocol. I2C is a pull down high protocol utilizing 2 lines, data and clock. An I2C communication bus uses a Master/Slave approach. Where there is one Master device which controls all traffic on the bus from any slave devices. For our project our I2C buses will have only a single slave device to prevent complications.      &lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;Messaging&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
Messages will be stored in each client until the server poll the client to see if they have a message. the server poll each client in a loop. The messages are 31 characters long 30 byte character message and 1 byte integer address stored as a character. When the client is  polled it will either respond with a null message or an actual message. the server will read the message and process it if need or move on to polling the next client.&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;References and Standards&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
We are currently implementing the threads using [http://dunkels.com/adam/pt/ Protothreads], a low-overhead, stackless approach. &amp;lt;br /&amp;gt;&lt;br /&gt;
The [https://code.google.com/p/u8glib/ Universal Graphics Library (u8glib)], is a general graphics library for communication with various (read many)&lt;br /&gt;
standard graphical screens. We chose this as a simple and easy to use library, we many options available for extension if required. &amp;lt;br /&amp;gt;&lt;br /&gt;
Communication will be through the [https://en.wikipedia.org/wiki/I%C2%B2C I2C] protocol. This protocol is simple to follow, and a good introduction for students with limited exposure to &lt;br /&gt;
embedded communication. &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>A1628314</name></author>
		
	</entry>
	<entry>
		<id>https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2015s1-12_An_Open-Source_Local_Area_Network_(LAN)&amp;diff=5269</id>
		<title>Projects:2015s1-12 An Open-Source Local Area Network (LAN)</title>
		<link rel="alternate" type="text/html" href="https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2015s1-12_An_Open-Source_Local_Area_Network_(LAN)&amp;diff=5269"/>
		<updated>2015-10-23T04:02:52Z</updated>

		<summary type="html">&lt;p&gt;A1628314: /* Approach/Architecture Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Introduction&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Team&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Members:&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Robert Long&amp;lt;br /&amp;gt;&lt;br /&gt;
Oscar Evans&amp;lt;br /&amp;gt;&lt;br /&gt;
Luke Hub-Mayner Warner&amp;lt;br /&amp;gt;&lt;br /&gt;
Leigh-Anthony Noye&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Supervisors:&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Andrew Allison&amp;lt;br /&amp;gt;&lt;br /&gt;
Braden Phillips&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Project Information&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
We will develop an Open-Source Local Area Network (LAN), based on the Arduino platform, and using the C&lt;br /&gt;
programming language. The purpose of this network is to serve as a simple low-cost platform for teaching principles&lt;br /&gt;
of real-time and embedded systems. There are three stages of development:&amp;lt;br /&amp;gt;&lt;br /&gt;
1. Get the Arduino up and working with an LCD display and a number pad, and program it as a glass type-writer, with&lt;br /&gt;
modes for the alphabetic characters, after the fashion of many mobile telephones. Students will need to use multiple&lt;br /&gt;
processes (threads) to control the display and the keypad, and to buffer characters.&amp;lt;br /&amp;gt;&lt;br /&gt;
2. Get Two, or more, Arduino microcontrollers exchanging text on an I2C bus. At this stage there is no collision&lt;br /&gt;
detection or addressing.&amp;lt;br /&amp;gt;&lt;br /&gt;
3. Provide an application layer which allocates addresses to clients. If I send a text as: &amp;quot;#57 Mr. Watson - Come here&amp;quot;&lt;br /&gt;
I want to see your number then the message: &amp;quot;Mr. Watson - Come here&amp;quot; appears only on the display of&lt;br /&gt;
client #57, and no other client. (There is still no encryption or security, just the convenience of an address.)&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Background&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
As mentioned throughout this wiki article, the overall aim of this project is to develop a platform that can be used to teach basic &lt;br /&gt;
real-time concepts in a limited embedded system. &amp;lt; br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For this reason, the C programming language has been chosen as the main language in this project. C provides a low enough level of abstraction &lt;br /&gt;
for students to be able to appreciate the underlying effects of real-time paradigms, without becoming wrapped up in something like assembly code.&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Aim&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
This project aims to produce an open source local area network (LAN). It is to be based on&lt;br /&gt;
the Arduino platform and use the C programming language. This must operate over an I2C&lt;br /&gt;
bus on the Arduino units with each unit to have its own bus connecting to a centralised server.&lt;br /&gt;
Each client unit must also have its own display and keypad for input/output interaction with&lt;br /&gt;
users. The purpose of this is to create a simple, low-cost platform for teaching principles&lt;br /&gt;
of real-time and embedded systems. This system is to include an application layer which&lt;br /&gt;
allocates addresses to clients however there will not be any security or encryption included.&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Motivation&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
The University of Adelaide course, Real Time and Embedded Systems, utilises the C pro-&lt;br /&gt;
gramming language to teach real-time and concurrency methodologies. To ensure this is&lt;br /&gt;
effective as possible it is best to use teaching tools which are grounded in familiar tools.&lt;br /&gt;
This is why the example of a LAN implemented in Arduino units using C is a compelling&lt;br /&gt;
choice. Likewise I2C is a well-developed and extensively used bus protocol. Exposing students &lt;br /&gt;
to these tools and protocols which are actively being used in industry is an invaluable&lt;br /&gt;
experience. In previous years, the course has utilised desktop computers to teach the C in&lt;br /&gt;
practicals and the PIC microprocessors as a teaching tool for the embedded systems theory.&lt;br /&gt;
The outcome of this project will enable the two sets of theory taught by the course to be&lt;br /&gt;
concatenated thus removing current disjointed approach of practicals.&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Significance&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
With several closed source networking options available, providing a simple open source alternative is&lt;br /&gt;
an advantage. Physical implementation is left to the user, and such this system might find itself in large scale remote sensing and monitoring situations. &amp;lt;br /&amp;gt;&lt;br /&gt;
Some examples might include: &amp;lt;br /&amp;gt;&lt;br /&gt;
1. Vineyard water table level monitoring. &amp;lt;br /&amp;gt;&lt;br /&gt;
2. Mine environment variable sensing.&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Approach/Architecture Design&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
The LAN has a star architecture with token ring methodology. The network will consist of a server and at least two clients terminals. The clients will each be given a chance to send a message in turn and thus holding a token granting access to the server.&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Potential Issues&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Technical Details&amp;#039;&amp;#039;&amp;#039;==&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;Screen&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
The chosen screen was the LCD12864 and is shown in appendix C. This screen was chosen&lt;br /&gt;
for its flexibility and low cost as discussed above in the budget. It communicates to the&lt;br /&gt;
Arduino through SPI however this is mostly abstracted away and is not of concern to&lt;br /&gt;
this project. The Screen is a 128 x 64 pixel LCD shield. The header bar&lt;br /&gt;
allows for identification information and incoming message alert. Under this there is room&lt;br /&gt;
for the received or in progress outgoing message. The size of this is three rows of sixteen&lt;br /&gt;
characters allowing for a maximum message size of forty five characters long. This is well&lt;br /&gt;
within the memory requirements of the Arduino Uno and should allow for several messages&lt;br /&gt;
to be queued. &lt;br /&gt;
&lt;br /&gt;
A library of code was found for the screen. A significant proportion of this is written&lt;br /&gt;
in C meaning little work is required to utilise this as part of the project. The useful&lt;br /&gt;
inclusions from this library in the context of the project are the font library, the ability to&lt;br /&gt;
draw lines and the cursor function. The font library allows us to select from a wide variety&lt;br /&gt;
of sizes and characters. This will be further discussed below. The line drawing functions allow &lt;br /&gt;
the screen to be sectioned of into user-editable and non-user-editable sections. This also increases &lt;br /&gt;
readability and usability. The cursor function allows for easier message editing but does however bring further design choices.&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;Keypad&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
&lt;br /&gt;
As discussed in previous sections the keypad being used as the primary input device for this&lt;br /&gt;
project is the FIT0129 membrane keypad. Text input will be&lt;br /&gt;
entered in the style of old mobile phone keypad. The keypad&lt;br /&gt;
is to be connected to the Arduino Uno through the digital pass through connectors on the&lt;br /&gt;
screen shield.&lt;br /&gt;
To investigate the waveform of the button presses, one horizontal line was connected to&lt;br /&gt;
a five Volt power source and a vertical line was connected to the oscilloscope. This allowed the waveform to be inspected and the shortest press to be estimated.&lt;br /&gt;
The waveform has very little bounce which implies that including a de-bounce algorithm is&lt;br /&gt;
not necessary in this project. The minimum button press&lt;br /&gt;
time was fifty milliseconds. This is an important as it effects the polling time and total&lt;br /&gt;
utilisation of processing time.&lt;br /&gt;
When a button is held down, the waveform persists. This means a choice has to be made&lt;br /&gt;
between the press counting as a single press or as many presses until the button is released.&lt;br /&gt;
The programming of these two choices is equally challenging and thus it was decided to treat&lt;br /&gt;
21&lt;br /&gt;
the long press as a single press and to wait for the button to be released before looking for&lt;br /&gt;
the new press.&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;Cursor&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
&lt;br /&gt;
The cursor functionality has been started as the included library mentioned above includes&lt;br /&gt;
cursor functions. This has been worked with and functions allowing the cursor to work with&lt;br /&gt;
the chosen screen layout and specifc message size have been outlined in the code. Functions&lt;br /&gt;
allowing the cursor to be moved between characters in all situations have also been created&lt;br /&gt;
for the specifc screen layout that has been chosen. This has lead to a number of design&lt;br /&gt;
decisions which have been made.&lt;br /&gt;
The first is whether the text should be inserted or overridden when the cursor has been&lt;br /&gt;
backtracked through the text. Overriding the text is less intensive computationally and is&lt;br /&gt;
simpler to program. However from a usability perspective insert is the more natural option&lt;br /&gt;
as this is the method of many modern devices. For these reasons override has been chosen&lt;br /&gt;
initially however if time and resources permit insert is an extension goal to the project.&lt;br /&gt;
Secondly a choice between allowing users to insert text anywhere in the message string,&lt;br /&gt;
even after blank space, or only where text has already been placed (or a adding to the end).&lt;br /&gt;
A decision was made to&lt;br /&gt;
allow the user to insert characters anywhere in the message, regardless of unused space and to fill the unused space with spaces.&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;Finite State Machine&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
Due to the restrictive nature of the keypad, a finite state machine&lt;br /&gt;
in the form of old mobile phones is needed to allow users to access all alphabetic characters.&lt;br /&gt;
&lt;br /&gt;
When a button on the keypad is pressed, the position of this press is passed to a decoder&lt;br /&gt;
program. This program essentially takes in a key press and returns an array which is two&lt;br /&gt;
characters long. The first character is the character to be placed on the screen and the&lt;br /&gt;
second character is a message character that is used to tell the program whether to stay&lt;br /&gt;
in the same place, move forward or perform some other special function. It would stay in&lt;br /&gt;
the same place in the situation where it is the first character of a set or where the pressed&lt;br /&gt;
key is the same as the previous. This would mean that the user is still cycling through the&lt;br /&gt;
characters associated with that key.&lt;br /&gt;
It was initially desirable to simply use a two dimensional array to formulate the finite state&lt;br /&gt;
machine. However this was not feasible due to different keys having different amounts of&lt;br /&gt;
characters associated with them. To make this work it would require an array as long as&lt;br /&gt;
the lowest common denominator of the amount. This would turn out to be sixty characters&lt;br /&gt;
long due to there being keys with two, three, four and five characters.&lt;br /&gt;
Thus the code structure used to allow users to cycle through characters was an array of&lt;br /&gt;
arrays, shown in Appendix G. This allowed different lengths to be used whilst still primarily&lt;br /&gt;
using the same method of accessing the characters. A variable is also held to keep track of&lt;br /&gt;
how many times a key has been pressed. This corresponds to which element in the array&lt;br /&gt;
should be returned. This variable is reset when a different key is pressed.&lt;br /&gt;
The secondary return byte allows for special functionality to be returned as well as nor-&lt;br /&gt;
mal characters. This includes:&lt;br /&gt;
1. Send:&lt;br /&gt;
This key initialises the process of sending the message to another client. It tells the&lt;br /&gt;
unit the message is ready and should be sent when the server polls it next.&lt;br /&gt;
2. Save Character:&lt;br /&gt;
When the desired character has been reached and the next character is on the same&lt;br /&gt;
key (for instance two of the same letters in a row) it is necessary to have a key which&lt;br /&gt;
does not add a character but saves the current one and moves the cursor forward. The&lt;br /&gt;
&amp;#039;A&amp;#039; character was used to implement this functionality. When it is invoked the decoder&lt;br /&gt;
program returns a space (as that is the default state of each character in the message&lt;br /&gt;
20&lt;br /&gt;
array) and the signalling character to tell the program that it needs to move forward.&lt;br /&gt;
It is noted this functionality can also be achieved by using the cursor.&lt;br /&gt;
3. State Switch&lt;br /&gt;
When invoked this key switches between the default writing message state and the&lt;br /&gt;
reading message state. This will show any queued messages using first in first out methodology.&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;Inter Integrated Circuit&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
Inter Integrated Circuit known better as I2C (&amp;#039;&amp;#039;pronounced I-squared-C&amp;#039;&amp;#039;) was our chosen communications protocol. I2C is a pull down high protocol utilizing 2 lines, data and clock. An I2C communication bus uses a Master/Slave approach. Where there is one Master device which controls all traffic on the bus from any slave devices. For our project our I2C buses will have only a single slave device to prevent complications.      &lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;Messaging&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
Messages will be stored in each client until the server poll the client to see if they have a message. the server poll each client in a loop. The messages are 31 characters long 30 byte character message and 1 byte integer address stored as a character. When the client is  polled it will either respond with a null message or an actual message. the server will read the message and process it if need or move on to polling the next client.&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;References and Standards&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
We are currently implementing the threads using [http://dunkels.com/adam/pt/ Protothreads], a low-overhead, stackless approach. &amp;lt;br /&amp;gt;&lt;br /&gt;
The [https://code.google.com/p/u8glib/ Universal Graphics Library (u8glib)], is a general graphics library for communication with various (read many)&lt;br /&gt;
standard graphical screens. We chose this as a simple and easy to use library, we many options available for extension if required. &amp;lt;br /&amp;gt;&lt;br /&gt;
Communication will be through the [https://en.wikipedia.org/wiki/I%C2%B2C I2C] protocol. This protocol is simple to follow, and a good introduction for students with limited exposure to &lt;br /&gt;
embedded communication. &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>A1628314</name></author>
		
	</entry>
	<entry>
		<id>https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2015s1-12_An_Open-Source_Local_Area_Network_(LAN)&amp;diff=5259</id>
		<title>Projects:2015s1-12 An Open-Source Local Area Network (LAN)</title>
		<link rel="alternate" type="text/html" href="https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2015s1-12_An_Open-Source_Local_Area_Network_(LAN)&amp;diff=5259"/>
		<updated>2015-10-23T03:59:47Z</updated>

		<summary type="html">&lt;p&gt;A1628314: /* Messaging */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Introduction&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Team&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Members:&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Robert Long&amp;lt;br /&amp;gt;&lt;br /&gt;
Oscar Evans&amp;lt;br /&amp;gt;&lt;br /&gt;
Luke Hub-Mayner Warner&amp;lt;br /&amp;gt;&lt;br /&gt;
Leigh-Anthony Noye&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Supervisors:&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Andrew Allison&amp;lt;br /&amp;gt;&lt;br /&gt;
Braden Phillips&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Project Information&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
We will develop an Open-Source Local Area Network (LAN), based on the Arduino platform, and using the C&lt;br /&gt;
programming language. The purpose of this network is to serve as a simple low-cost platform for teaching principles&lt;br /&gt;
of real-time and embedded systems. There are three stages of development:&amp;lt;br /&amp;gt;&lt;br /&gt;
1. Get the Arduino up and working with an LCD display and a number pad, and program it as a glass type-writer, with&lt;br /&gt;
modes for the alphabetic characters, after the fashion of many mobile telephones. Students will need to use multiple&lt;br /&gt;
processes (threads) to control the display and the keypad, and to buffer characters.&amp;lt;br /&amp;gt;&lt;br /&gt;
2. Get Two, or more, Arduino microcontrollers exchanging text on an I2C bus. At this stage there is no collision&lt;br /&gt;
detection or addressing.&amp;lt;br /&amp;gt;&lt;br /&gt;
3. Provide an application layer which allocates addresses to clients. If I send a text as: &amp;quot;#57 Mr. Watson - Come here&amp;quot;&lt;br /&gt;
I want to see your number then the message: &amp;quot;Mr. Watson - Come here&amp;quot; appears only on the display of&lt;br /&gt;
client #57, and no other client. (There is still no encryption or security, just the convenience of an address.)&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Background&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
As mentioned throughout this wiki article, the overall aim of this project is to develop a platform that can be used to teach basic &lt;br /&gt;
real-time concepts in a limited embedded system. &amp;lt; br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For this reason, the C programming language has been chosen as the main language in this project. C provides a low enough level of abstraction &lt;br /&gt;
for students to be able to appreciate the underlying effects of real-time paradigms, without becoming wrapped up in something like assembly code.&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Aim&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
This project aims to produce an open source local area network (LAN). It is to be based on&lt;br /&gt;
the Arduino platform and use the C programming language. This must operate over an I2C&lt;br /&gt;
bus on the Arduino units with each unit to have its own bus connecting to a centralised server.&lt;br /&gt;
Each client unit must also have its own display and keypad for input/output interaction with&lt;br /&gt;
users. The purpose of this is to create a simple, low-cost platform for teaching principles&lt;br /&gt;
of real-time and embedded systems. This system is to include an application layer which&lt;br /&gt;
allocates addresses to clients however there will not be any security or encryption included.&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Motivation&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
The University of Adelaide course, Real Time and Embedded Systems, utilises the C pro-&lt;br /&gt;
gramming language to teach real-time and concurrency methodologies. To ensure this is&lt;br /&gt;
effective as possible it is best to use teaching tools which are grounded in familiar tools.&lt;br /&gt;
This is why the example of a LAN implemented in Arduino units using C is a compelling&lt;br /&gt;
choice. Likewise I2C is a well-developed and extensively used bus protocol. Exposing students &lt;br /&gt;
to these tools and protocols which are actively being used in industry is an invaluable&lt;br /&gt;
experience. In previous years, the course has utilised desktop computers to teach the C in&lt;br /&gt;
practicals and the PIC microprocessors as a teaching tool for the embedded systems theory.&lt;br /&gt;
The outcome of this project will enable the two sets of theory taught by the course to be&lt;br /&gt;
concatenated thus removing current disjointed approach of practicals.&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Significance&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
With several closed source networking options available, providing a simple open source alternative is&lt;br /&gt;
an advantage. Physical implementation is left to the user, and such this system might find itself in large scale remote sensing and monitoring situations. &amp;lt;br /&amp;gt;&lt;br /&gt;
Some examples might include: &amp;lt;br /&amp;gt;&lt;br /&gt;
1. Vineyard water table level monitoring. &amp;lt;br /&amp;gt;&lt;br /&gt;
2. Mine environment variable sensing.&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Approach/Architecture Design&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Potential Issues&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Technical Details&amp;#039;&amp;#039;&amp;#039;==&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;Screen&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
The chosen screen was the LCD12864 and is shown in appendix C. This screen was chosen&lt;br /&gt;
for its flexibility and low cost as discussed above in the budget. It communicates to the&lt;br /&gt;
Arduino through SPI however this is mostly abstracted away and is not of concern to&lt;br /&gt;
this project. The Screen is a 128 x 64 pixel LCD shield. The header bar&lt;br /&gt;
allows for identification information and incoming message alert. Under this there is room&lt;br /&gt;
for the received or in progress outgoing message. The size of this is three rows of sixteen&lt;br /&gt;
characters allowing for a maximum message size of forty five characters long. This is well&lt;br /&gt;
within the memory requirements of the Arduino Uno and should allow for several messages&lt;br /&gt;
to be queued. &lt;br /&gt;
&lt;br /&gt;
A library of code was found for the screen. A significant proportion of this is written&lt;br /&gt;
in C meaning little work is required to utilise this as part of the project. The useful&lt;br /&gt;
inclusions from this library in the context of the project are the font library, the ability to&lt;br /&gt;
draw lines and the cursor function. The font library allows us to select from a wide variety&lt;br /&gt;
of sizes and characters. This will be further discussed below. The line drawing functions allow &lt;br /&gt;
the screen to be sectioned of into user-editable and non-user-editable sections. This also increases &lt;br /&gt;
readability and usability. The cursor function allows for easier message editing but does however bring further design choices.&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;Keypad&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
&lt;br /&gt;
As discussed in previous sections the keypad being used as the primary input device for this&lt;br /&gt;
project is the FIT0129 membrane keypad. Text input will be&lt;br /&gt;
entered in the style of old mobile phone keypad. The keypad&lt;br /&gt;
is to be connected to the Arduino Uno through the digital pass through connectors on the&lt;br /&gt;
screen shield.&lt;br /&gt;
To investigate the waveform of the button presses, one horizontal line was connected to&lt;br /&gt;
a five Volt power source and a vertical line was connected to the oscilloscope. This allowed the waveform to be inspected and the shortest press to be estimated.&lt;br /&gt;
The waveform has very little bounce which implies that including a de-bounce algorithm is&lt;br /&gt;
not necessary in this project. The minimum button press&lt;br /&gt;
time was fifty milliseconds. This is an important as it effects the polling time and total&lt;br /&gt;
utilisation of processing time.&lt;br /&gt;
When a button is held down, the waveform persists. This means a choice has to be made&lt;br /&gt;
between the press counting as a single press or as many presses until the button is released.&lt;br /&gt;
The programming of these two choices is equally challenging and thus it was decided to treat&lt;br /&gt;
21&lt;br /&gt;
the long press as a single press and to wait for the button to be released before looking for&lt;br /&gt;
the new press.&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;Cursor&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
&lt;br /&gt;
The cursor functionality has been started as the included library mentioned above includes&lt;br /&gt;
cursor functions. This has been worked with and functions allowing the cursor to work with&lt;br /&gt;
the chosen screen layout and specifc message size have been outlined in the code. Functions&lt;br /&gt;
allowing the cursor to be moved between characters in all situations have also been created&lt;br /&gt;
for the specifc screen layout that has been chosen. This has lead to a number of design&lt;br /&gt;
decisions which have been made.&lt;br /&gt;
The first is whether the text should be inserted or overridden when the cursor has been&lt;br /&gt;
backtracked through the text. Overriding the text is less intensive computationally and is&lt;br /&gt;
simpler to program. However from a usability perspective insert is the more natural option&lt;br /&gt;
as this is the method of many modern devices. For these reasons override has been chosen&lt;br /&gt;
initially however if time and resources permit insert is an extension goal to the project.&lt;br /&gt;
Secondly a choice between allowing users to insert text anywhere in the message string,&lt;br /&gt;
even after blank space, or only where text has already been placed (or a adding to the end).&lt;br /&gt;
A decision was made to&lt;br /&gt;
allow the user to insert characters anywhere in the message, regardless of unused space and to fill the unused space with spaces.&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;Finite State Machine&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
Due to the restrictive nature of the keypad, a finite state machine&lt;br /&gt;
in the form of old mobile phones is needed to allow users to access all alphabetic characters.&lt;br /&gt;
&lt;br /&gt;
When a button on the keypad is pressed, the position of this press is passed to a decoder&lt;br /&gt;
program. This program essentially takes in a key press and returns an array which is two&lt;br /&gt;
characters long. The first character is the character to be placed on the screen and the&lt;br /&gt;
second character is a message character that is used to tell the program whether to stay&lt;br /&gt;
in the same place, move forward or perform some other special function. It would stay in&lt;br /&gt;
the same place in the situation where it is the first character of a set or where the pressed&lt;br /&gt;
key is the same as the previous. This would mean that the user is still cycling through the&lt;br /&gt;
characters associated with that key.&lt;br /&gt;
It was initially desirable to simply use a two dimensional array to formulate the finite state&lt;br /&gt;
machine. However this was not feasible due to different keys having different amounts of&lt;br /&gt;
characters associated with them. To make this work it would require an array as long as&lt;br /&gt;
the lowest common denominator of the amount. This would turn out to be sixty characters&lt;br /&gt;
long due to there being keys with two, three, four and five characters.&lt;br /&gt;
Thus the code structure used to allow users to cycle through characters was an array of&lt;br /&gt;
arrays, shown in Appendix G. This allowed different lengths to be used whilst still primarily&lt;br /&gt;
using the same method of accessing the characters. A variable is also held to keep track of&lt;br /&gt;
how many times a key has been pressed. This corresponds to which element in the array&lt;br /&gt;
should be returned. This variable is reset when a different key is pressed.&lt;br /&gt;
The secondary return byte allows for special functionality to be returned as well as nor-&lt;br /&gt;
mal characters. This includes:&lt;br /&gt;
1. Send:&lt;br /&gt;
This key initialises the process of sending the message to another client. It tells the&lt;br /&gt;
unit the message is ready and should be sent when the server polls it next.&lt;br /&gt;
2. Save Character:&lt;br /&gt;
When the desired character has been reached and the next character is on the same&lt;br /&gt;
key (for instance two of the same letters in a row) it is necessary to have a key which&lt;br /&gt;
does not add a character but saves the current one and moves the cursor forward. The&lt;br /&gt;
&amp;#039;A&amp;#039; character was used to implement this functionality. When it is invoked the decoder&lt;br /&gt;
program returns a space (as that is the default state of each character in the message&lt;br /&gt;
20&lt;br /&gt;
array) and the signalling character to tell the program that it needs to move forward.&lt;br /&gt;
It is noted this functionality can also be achieved by using the cursor.&lt;br /&gt;
3. State Switch&lt;br /&gt;
When invoked this key switches between the default writing message state and the&lt;br /&gt;
reading message state. This will show any queued messages using first in first out methodology.&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;Inter Integrated Circuit&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
Inter Integrated Circuit known better as I2C (&amp;#039;&amp;#039;pronounced I-squared-C&amp;#039;&amp;#039;) was our chosen communications protocol. I2C is a pull down high protocol utilizing 2 lines, data and clock. An I2C communication bus uses a Master/Slave approach. Where there is one Master device which controls all traffic on the bus from any slave devices. For our project our I2C buses will have only a single slave device to prevent complications.      &lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;Messaging&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
Messages will be stored in each client until the server poll the client to see if they have a message. the server poll each client in a loop. The messages are 31 characters long 30 byte character message and 1 byte integer address stored as a character. When the client is  polled it will either respond with a null message or an actual message. the server will read the message and process it if need or move on to polling the next client.&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;References and Standards&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
We are currently implementing the threads using [http://dunkels.com/adam/pt/ Protothreads], a low-overhead, stackless approach. &amp;lt;br /&amp;gt;&lt;br /&gt;
The [https://code.google.com/p/u8glib/ Universal Graphics Library (u8glib)], is a general graphics library for communication with various (read many)&lt;br /&gt;
standard graphical screens. We chose this as a simple and easy to use library, we many options available for extension if required. &amp;lt;br /&amp;gt;&lt;br /&gt;
Communication will be through the [https://en.wikipedia.org/wiki/I%C2%B2C I2C] protocol. This protocol is simple to follow, and a good introduction for students with limited exposure to &lt;br /&gt;
embedded communication. &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>A1628314</name></author>
		
	</entry>
	<entry>
		<id>https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2015s1-12_An_Open-Source_Local_Area_Network_(LAN)&amp;diff=5252</id>
		<title>Projects:2015s1-12 An Open-Source Local Area Network (LAN)</title>
		<link rel="alternate" type="text/html" href="https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2015s1-12_An_Open-Source_Local_Area_Network_(LAN)&amp;diff=5252"/>
		<updated>2015-10-23T03:54:48Z</updated>

		<summary type="html">&lt;p&gt;A1628314: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Introduction&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Team&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Members:&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Robert Long&amp;lt;br /&amp;gt;&lt;br /&gt;
Oscar Evans&amp;lt;br /&amp;gt;&lt;br /&gt;
Luke Hub-Mayner Warner&amp;lt;br /&amp;gt;&lt;br /&gt;
Leigh-Anthony Noye&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Supervisors:&amp;#039;&amp;#039;&amp;#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
Andrew Allison&amp;lt;br /&amp;gt;&lt;br /&gt;
Braden Phillips&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Project Information&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
We will develop an Open-Source Local Area Network (LAN), based on the Arduino platform, and using the C&lt;br /&gt;
programming language. The purpose of this network is to serve as a simple low-cost platform for teaching principles&lt;br /&gt;
of real-time and embedded systems. There are three stages of development:&amp;lt;br /&amp;gt;&lt;br /&gt;
1. Get the Arduino up and working with an LCD display and a number pad, and program it as a glass type-writer, with&lt;br /&gt;
modes for the alphabetic characters, after the fashion of many mobile telephones. Students will need to use multiple&lt;br /&gt;
processes (threads) to control the display and the keypad, and to buffer characters.&amp;lt;br /&amp;gt;&lt;br /&gt;
2. Get Two, or more, Arduino microcontrollers exchanging text on an I2C bus. At this stage there is no collision&lt;br /&gt;
detection or addressing.&amp;lt;br /&amp;gt;&lt;br /&gt;
3. Provide an application layer which allocates addresses to clients. If I send a text as: &amp;quot;#57 Mr. Watson - Come here&amp;quot;&lt;br /&gt;
I want to see your number then the message: &amp;quot;Mr. Watson - Come here&amp;quot; appears only on the display of&lt;br /&gt;
client #57, and no other client. (There is still no encryption or security, just the convenience of an address.)&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Background&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
As mentioned throughout this wiki article, the overall aim of this project is to develop a platform that can be used to teach basic &lt;br /&gt;
real-time concepts in a limited embedded system. &amp;lt; br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For this reason, the C programming language has been chosen as the main language in this project. C provides a low enough level of abstraction &lt;br /&gt;
for students to be able to appreciate the underlying effects of real-time paradigms, without becoming wrapped up in something like assembly code.&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Aim&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
This project aims to produce an open source local area network (LAN). It is to be based on&lt;br /&gt;
the Arduino platform and use the C programming language. This must operate over an I2C&lt;br /&gt;
bus on the Arduino units with each unit to have its own bus connecting to a centralised server.&lt;br /&gt;
Each client unit must also have its own display and keypad for input/output interaction with&lt;br /&gt;
users. The purpose of this is to create a simple, low-cost platform for teaching principles&lt;br /&gt;
of real-time and embedded systems. This system is to include an application layer which&lt;br /&gt;
allocates addresses to clients however there will not be any security or encryption included.&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Motivation&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
The University of Adelaide course, Real Time and Embedded Systems, utilises the C pro-&lt;br /&gt;
gramming language to teach real-time and concurrency methodologies. To ensure this is&lt;br /&gt;
effective as possible it is best to use teaching tools which are grounded in familiar tools.&lt;br /&gt;
This is why the example of a LAN implemented in Arduino units using C is a compelling&lt;br /&gt;
choice. Likewise I2C is a well-developed and extensively used bus protocol. Exposing students &lt;br /&gt;
to these tools and protocols which are actively being used in industry is an invaluable&lt;br /&gt;
experience. In previous years, the course has utilised desktop computers to teach the C in&lt;br /&gt;
practicals and the PIC microprocessors as a teaching tool for the embedded systems theory.&lt;br /&gt;
The outcome of this project will enable the two sets of theory taught by the course to be&lt;br /&gt;
concatenated thus removing current disjointed approach of practicals.&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Significance&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
With several closed source networking options available, providing a simple open source alternative is&lt;br /&gt;
an advantage. Physical implementation is left to the user, and such this system might find itself in large scale remote sensing and monitoring situations. &amp;lt;br /&amp;gt;&lt;br /&gt;
Some examples might include: &amp;lt;br /&amp;gt;&lt;br /&gt;
1. Vineyard water table level monitoring. &amp;lt;br /&amp;gt;&lt;br /&gt;
2. Mine environment variable sensing.&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Approach/Architecture Design&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Potential Issues&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Technical Details&amp;#039;&amp;#039;&amp;#039;==&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;Screen&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
The chosen screen was the LCD12864 and is shown in appendix C. This screen was chosen&lt;br /&gt;
for its flexibility and low cost as discussed above in the budget. It communicates to the&lt;br /&gt;
Arduino through SPI however this is mostly abstracted away and is not of concern to&lt;br /&gt;
this project. The Screen is a 128 x 64 pixel LCD shield. The header bar&lt;br /&gt;
allows for identification information and incoming message alert. Under this there is room&lt;br /&gt;
for the received or in progress outgoing message. The size of this is three rows of sixteen&lt;br /&gt;
characters allowing for a maximum message size of forty five characters long. This is well&lt;br /&gt;
within the memory requirements of the Arduino Uno and should allow for several messages&lt;br /&gt;
to be queued. &lt;br /&gt;
&lt;br /&gt;
A library of code was found for the screen. A significant proportion of this is written&lt;br /&gt;
in C meaning little work is required to utilise this as part of the project. The useful&lt;br /&gt;
inclusions from this library in the context of the project are the font library, the ability to&lt;br /&gt;
draw lines and the cursor function. The font library allows us to select from a wide variety&lt;br /&gt;
of sizes and characters. This will be further discussed below. The line drawing functions allow &lt;br /&gt;
the screen to be sectioned of into user-editable and non-user-editable sections. This also increases &lt;br /&gt;
readability and usability. The cursor function allows for easier message editing but does however bring further design choices.&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;Keypad&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
&lt;br /&gt;
As discussed in previous sections the keypad being used as the primary input device for this&lt;br /&gt;
project is the FIT0129 membrane keypad. Text input will be&lt;br /&gt;
entered in the style of old mobile phone keypad. The keypad&lt;br /&gt;
is to be connected to the Arduino Uno through the digital pass through connectors on the&lt;br /&gt;
screen shield.&lt;br /&gt;
To investigate the waveform of the button presses, one horizontal line was connected to&lt;br /&gt;
a five Volt power source and a vertical line was connected to the oscilloscope. This allowed the waveform to be inspected and the shortest press to be estimated.&lt;br /&gt;
The waveform has very little bounce which implies that including a de-bounce algorithm is&lt;br /&gt;
not necessary in this project. The minimum button press&lt;br /&gt;
time was fifty milliseconds. This is an important as it effects the polling time and total&lt;br /&gt;
utilisation of processing time.&lt;br /&gt;
When a button is held down, the waveform persists. This means a choice has to be made&lt;br /&gt;
between the press counting as a single press or as many presses until the button is released.&lt;br /&gt;
The programming of these two choices is equally challenging and thus it was decided to treat&lt;br /&gt;
21&lt;br /&gt;
the long press as a single press and to wait for the button to be released before looking for&lt;br /&gt;
the new press.&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;Cursor&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
&lt;br /&gt;
The cursor functionality has been started as the included library mentioned above includes&lt;br /&gt;
cursor functions. This has been worked with and functions allowing the cursor to work with&lt;br /&gt;
the chosen screen layout and specifc message size have been outlined in the code. Functions&lt;br /&gt;
allowing the cursor to be moved between characters in all situations have also been created&lt;br /&gt;
for the specifc screen layout that has been chosen. This has lead to a number of design&lt;br /&gt;
decisions which have been made.&lt;br /&gt;
The first is whether the text should be inserted or overridden when the cursor has been&lt;br /&gt;
backtracked through the text. Overriding the text is less intensive computationally and is&lt;br /&gt;
simpler to program. However from a usability perspective insert is the more natural option&lt;br /&gt;
as this is the method of many modern devices. For these reasons override has been chosen&lt;br /&gt;
initially however if time and resources permit insert is an extension goal to the project.&lt;br /&gt;
Secondly a choice between allowing users to insert text anywhere in the message string,&lt;br /&gt;
even after blank space, or only where text has already been placed (or a adding to the end).&lt;br /&gt;
A decision was made to&lt;br /&gt;
allow the user to insert characters anywhere in the message, regardless of unused space and to fill the unused space with spaces.&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;Finite State Machine&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
Due to the restrictive nature of the keypad, a finite state machine&lt;br /&gt;
in the form of old mobile phones is needed to allow users to access all alphabetic characters.&lt;br /&gt;
&lt;br /&gt;
When a button on the keypad is pressed, the position of this press is passed to a decoder&lt;br /&gt;
program. This program essentially takes in a key press and returns an array which is two&lt;br /&gt;
characters long. The first character is the character to be placed on the screen and the&lt;br /&gt;
second character is a message character that is used to tell the program whether to stay&lt;br /&gt;
in the same place, move forward or perform some other special function. It would stay in&lt;br /&gt;
the same place in the situation where it is the first character of a set or where the pressed&lt;br /&gt;
key is the same as the previous. This would mean that the user is still cycling through the&lt;br /&gt;
characters associated with that key.&lt;br /&gt;
It was initially desirable to simply use a two dimensional array to formulate the finite state&lt;br /&gt;
machine. However this was not feasible due to different keys having different amounts of&lt;br /&gt;
characters associated with them. To make this work it would require an array as long as&lt;br /&gt;
the lowest common denominator of the amount. This would turn out to be sixty characters&lt;br /&gt;
long due to there being keys with two, three, four and five characters.&lt;br /&gt;
Thus the code structure used to allow users to cycle through characters was an array of&lt;br /&gt;
arrays, shown in Appendix G. This allowed different lengths to be used whilst still primarily&lt;br /&gt;
using the same method of accessing the characters. A variable is also held to keep track of&lt;br /&gt;
how many times a key has been pressed. This corresponds to which element in the array&lt;br /&gt;
should be returned. This variable is reset when a different key is pressed.&lt;br /&gt;
The secondary return byte allows for special functionality to be returned as well as nor-&lt;br /&gt;
mal characters. This includes:&lt;br /&gt;
1. Send:&lt;br /&gt;
This key initialises the process of sending the message to another client. It tells the&lt;br /&gt;
unit the message is ready and should be sent when the server polls it next.&lt;br /&gt;
2. Save Character:&lt;br /&gt;
When the desired character has been reached and the next character is on the same&lt;br /&gt;
key (for instance two of the same letters in a row) it is necessary to have a key which&lt;br /&gt;
does not add a character but saves the current one and moves the cursor forward. The&lt;br /&gt;
&amp;#039;A&amp;#039; character was used to implement this functionality. When it is invoked the decoder&lt;br /&gt;
program returns a space (as that is the default state of each character in the message&lt;br /&gt;
20&lt;br /&gt;
array) and the signalling character to tell the program that it needs to move forward.&lt;br /&gt;
It is noted this functionality can also be achieved by using the cursor.&lt;br /&gt;
3. State Switch&lt;br /&gt;
When invoked this key switches between the default writing message state and the&lt;br /&gt;
reading message state. This will show any queued messages using first in first out methodology.&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;Inter Integrated Circuit&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
Inter Integrated Circuit known better as I2C (&amp;#039;&amp;#039;pronounced I-squared-C&amp;#039;&amp;#039;) was our chosen communications protocol. I2C is a pull down high protocol utilizing 2 lines, data and clock. An I2C communication bus uses a Master/Slave approach. Where there is one Master device which controls all traffic on the bus from any slave devices. For our project our I2C buses will have only a single slave device to prevent complications.      &lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;Messaging&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;References and Standards&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
We are currently implementing the threads using [http://dunkels.com/adam/pt/ Protothreads], a low-overhead, stackless approach. &amp;lt;br /&amp;gt;&lt;br /&gt;
The [https://code.google.com/p/u8glib/ Universal Graphics Library (u8glib)], is a general graphics library for communication with various (read many)&lt;br /&gt;
standard graphical screens. We chose this as a simple and easy to use library, we many options available for extension if required. &amp;lt;br /&amp;gt;&lt;br /&gt;
Communication will be through the [https://en.wikipedia.org/wiki/I%C2%B2C I2C] protocol. This protocol is simple to follow, and a good introduction for students with limited exposure to &lt;br /&gt;
embedded communication. &amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>A1628314</name></author>
		
	</entry>
</feed>