<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.emacinc.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jgreene</id>
	<title>wiki.emacinc.com - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.emacinc.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jgreene"/>
	<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/wiki/Special:Contributions/Jgreene"/>
	<updated>2026-05-23T08:50:09Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.6</generator>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_getkey&amp;diff=3124</id>
		<title>Example getkey</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_getkey&amp;diff=3124"/>
		<updated>2014-01-03T23:02:08Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|(11.14.13-11:41-&amp;gt;JG+);(11.14.13-15:30-&amp;gt;MD-);(11.21.13-14:06-&amp;gt;JG+);(11.21.13-16:15-&amp;gt;MD-);(12.03.13-14:21-&amp;gt;JG+);(01.04.14-17:01-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;getkey&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;getkey&amp;lt;/code&amp;gt; example C project demonstrates how to use a keypad with a SoM150ES carrier board. It provides examples of how to specify, inspect and test associations between character-data and keypad-keys. It demonstrates how to turn key-presses into character-data using the same techniques as the big keyboard on your PC. It's also a good introduction to the mysteries of matrix encoding (see [http://wikidev.emacinc.com/wiki/Example_getkey#A_Note_on_Matrix_Encoding A Note on Matrix Encoding, below]).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;getkey&amp;lt;/code&amp;gt; C example project creates one executable: &amp;lt;code&amp;gt;getkey&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
==Usage and Behavior== &lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''getkey''' program requires the following hardware.&lt;br /&gt;
&lt;br /&gt;
* A [http://www.emacinc.com/som/som150es.htm SOM-150ES carrier board] (Available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/som/som9G20.htm SOM-9G20M] and [http://www.emacinc.com/som/som9x25.htm SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible keypad ([http://www.emacinc.com/sbc_microcontroller_addons.htm Available from EMAC], refer to item# E20-21 or E020-25. [https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CCsQFjAA&amp;amp;url=http%3A%2F%2Fwww.in2tec.com%2Flib%2Fdownloadfile.php%3Ffilename%3D4000_series_keypads_datasheet.pdf%26loc%3Ddocuments%2F%26ct%3Dpdf&amp;amp;ei=Wf-MUrGxO-nEyQGggoGgCg&amp;amp;usg=AFQjCNEQxIaiH6-gx6uTq4O66o1YVDunZw&amp;amp;bvm=bv.56643336,d.aWc Datasheet]). &lt;br /&gt;
&lt;br /&gt;
[[File:Som150 with keypad.JPG | 500px ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
SOM-150ES carrier board with keypad&lt;br /&gt;
&lt;br /&gt;
===Plugging the Keypad into the SOM-150ES Carrier Board===&lt;br /&gt;
&lt;br /&gt;
Plug the keypad into the HDR5 KEYPAD header of the SOM-150ES Carrier Board.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Example getkey howtopluginthekeypad 0.png|500px]]&lt;br /&gt;
&lt;br /&gt;
Ensure that '''pin 0''' of the keypad's ribbon cable is lined up with '''pin 2''' on the header.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Example getkey howtopluginthekeypad 1.png|500px]]&lt;br /&gt;
&lt;br /&gt;
===The Keypad Matrix File===&lt;br /&gt;
&lt;br /&gt;
The keypad matrix file specifies associations between keypad-keys and characters. For each key in the keypad's grid of keys we specify a character in a grid of characters.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; [[File:Example_getkey_minimalkeypad.png|200px]] &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; [[File: Example_getkey_matrixfile.png|150px]]&lt;br /&gt;
&lt;br /&gt;
In this example we see an E020-21 keypad on the left and an example keypad matrix file (&amp;lt;code&amp;gt;Key-E020-21&amp;lt;/code&amp;gt;, included in the project) opened in a text editor on the right. The character matrix may be freely edited to suit.&lt;br /&gt;
&lt;br /&gt;
====A Note on Matrix Encoding====&lt;br /&gt;
&lt;br /&gt;
Matrix Encoding is a technique for translating individual xy locations on a 2d matrix into unique integer values. Here we see locations in a 4x4 matrix being translated into an 8bit value. Pins 0,1,2,3 handle the key y coordinate; pins 4,5,6,7 handle the x coordinate. Key '''A''' is at (7,0); '''B''':(6,0); '''K''':(5,2); Etc.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; [[File:Matrix encoding.png]]&lt;br /&gt;
&lt;br /&gt;
Thus, when a key is pressed, we get a corrosponding integer value on the header.&amp;lt;br /&amp;gt; &lt;br /&gt;
For example: Pressing the '''F''' key sets the values on pins '''1''' and '''6''' to 1. This gives us a binary value of 01000010. Integer value: 66 . So when the value at the header equals 66 we know that the '''F''' key was pressed.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Note''' This is an abstract, general example of a keypad using matrix encoding. Your keypad will probably have different characters on it's keys and output slightly different values.&lt;br /&gt;
&lt;br /&gt;
===Using getkey===&lt;br /&gt;
&lt;br /&gt;
The '''getkey''' program is controlled from the console via command line parameters. You can specify the keypad device node, specify the keypad matrix file (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above), display the current matrix in the console and test individual character-key associations.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;./getkey [-d device -b -g -s file]&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
;-d:Specify the keypad device node. The default is &amp;lt;code&amp;gt;/dev/keypad&amp;lt;/code&amp;gt;&lt;br /&gt;
;-b:Test an individual key-character association (via &amp;quot;read blocking&amp;quot;). The program will sleep until a key on the keypad is pressed, then output that key's character to the console.&lt;br /&gt;
;-g:Outputs the current keypad matrix (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above) to the console.&lt;br /&gt;
;-s:Specify the keypad matrix file. (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above). If a keypad matrix file is not specified then the character associated with the last keypad key pressed is returned.&lt;br /&gt;
&lt;br /&gt;
'''Note on parameter order.''' Parameters are evaluated in order. If blocking ('''b''') or device specifications ('''d''') are used, they must be declared before the matrix arguments on the command line.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Mapping a Keypad Device Node to a Keypad Matrix File===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;./getkey -d /dev/keypad0 -s /path/to/this/file/Key-E020-21&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program will map the keypad at the device node &amp;lt;code&amp;gt;/dev/keypad0&amp;lt;/code&amp;gt; to the matrix file &amp;lt;code&amp;gt;Key-E020-21&amp;lt;/code&amp;gt;. This associates each character in the grid of characters in the matrix file (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above) with a key in the grid of keys on the keypad.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Displaying the Character Presently Associated With a Key on the Keypad===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;./getkey -d /dev/keypad0 -b&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program will wait until a key is pressed on the keypad. When a key is pressed it will display the character associated with that pressed key, as specified in the keypad matrix file (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above).&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./getkey -d /dev/keypad0 -b&lt;br /&gt;
5&lt;br /&gt;
root@som9g20:/tmp#&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In this case I pressed the '''5''' key on the keypad.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Displaying the Character Matrix Presently Associated with the Keypad===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;./getkey -d /dev/keypad0 -g&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program will display the character matrix (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above) presently associated with the keypad at &amp;lt;code&amp;gt;/dev/keypad0''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./getkey -d /dev/keypad0 -g&lt;br /&gt;
1 2 3 C   &lt;br /&gt;
4 5 6 D   &lt;br /&gt;
7 8 9 E   &lt;br /&gt;
A 0 B F   &lt;br /&gt;
root@som9g20:/tmp#&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The character matrix displayed here is that of the &amp;lt;code&amp;gt;Key-E020-21&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;getkey&amp;lt;code example C project demonstrates how to use a keypad with a SoM150ES carrier board.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_getkey&amp;diff=3123</id>
		<title>Example getkey</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_getkey&amp;diff=3123"/>
		<updated>2014-01-03T23:00:53Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Plugging the Keypad into the SOM-150ES Carrier Board */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|(11.14.13-11:41-&amp;gt;JG+);(11.14.13-15:30-&amp;gt;MD-);(11.21.13-14:06-&amp;gt;JG+);(11.21.13-16:15-&amp;gt;MD-);(12.03.13-14:21-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,InProgress}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;getkey&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;getkey&amp;lt;/code&amp;gt; example C project demonstrates how to use a keypad with a SoM150ES carrier board. It provides examples of how to specify, inspect and test associations between character-data and keypad-keys. It demonstrates how to turn key-presses into character-data using the same techniques as the big keyboard on your PC. It's also a good introduction to the mysteries of matrix encoding (see [http://wikidev.emacinc.com/wiki/Example_getkey#A_Note_on_Matrix_Encoding A Note on Matrix Encoding, below]).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;getkey&amp;lt;/code&amp;gt; C example project creates one executable: &amp;lt;code&amp;gt;getkey&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
==Usage and Behavior== &lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''getkey''' program requires the following hardware.&lt;br /&gt;
&lt;br /&gt;
* A [http://www.emacinc.com/som/som150es.htm SOM-150ES carrier board] (Available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/som/som9G20.htm SOM-9G20M] and [http://www.emacinc.com/som/som9x25.htm SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible keypad ([http://www.emacinc.com/sbc_microcontroller_addons.htm Available from EMAC], refer to item# E20-21 or E020-25. [https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CCsQFjAA&amp;amp;url=http%3A%2F%2Fwww.in2tec.com%2Flib%2Fdownloadfile.php%3Ffilename%3D4000_series_keypads_datasheet.pdf%26loc%3Ddocuments%2F%26ct%3Dpdf&amp;amp;ei=Wf-MUrGxO-nEyQGggoGgCg&amp;amp;usg=AFQjCNEQxIaiH6-gx6uTq4O66o1YVDunZw&amp;amp;bvm=bv.56643336,d.aWc Datasheet]). &lt;br /&gt;
&lt;br /&gt;
[[File:Som150 with keypad.JPG | 500px ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
SOM-150ES carrier board with keypad&lt;br /&gt;
&lt;br /&gt;
===Plugging the Keypad into the SOM-150ES Carrier Board===&lt;br /&gt;
&lt;br /&gt;
Plug the keypad into the HDR5 KEYPAD header of the SOM-150ES Carrier Board.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Example getkey howtopluginthekeypad 0.png|500px]]&lt;br /&gt;
&lt;br /&gt;
Ensure that '''pin 0''' of the keypad's ribbon cable is lined up with '''pin 2''' on the header.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Example getkey howtopluginthekeypad 1.png|500px]]&lt;br /&gt;
&lt;br /&gt;
===The Keypad Matrix File===&lt;br /&gt;
&lt;br /&gt;
The keypad matrix file specifies associations between keypad-keys and characters. For each key in the keypad's grid of keys we specify a character in a grid of characters.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; [[File:Example_getkey_minimalkeypad.png|200px]] &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; [[File: Example_getkey_matrixfile.png|150px]]&lt;br /&gt;
&lt;br /&gt;
In this example we see an E020-21 keypad on the left and an example keypad matrix file (&amp;lt;code&amp;gt;Key-E020-21&amp;lt;/code&amp;gt;, included in the project) opened in a text editor on the right. The character matrix may be freely edited to suit.&lt;br /&gt;
&lt;br /&gt;
====A Note on Matrix Encoding====&lt;br /&gt;
&lt;br /&gt;
Matrix Encoding is a technique for translating individual xy locations on a 2d matrix into unique integer values. Here we see locations in a 4x4 matrix being translated into an 8bit value. Pins 0,1,2,3 handle the key y coordinate; pins 4,5,6,7 handle the x coordinate. Key '''A''' is at (7,0); '''B''':(6,0); '''K''':(5,2); Etc.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; [[File:Matrix encoding.png]]&lt;br /&gt;
&lt;br /&gt;
Thus, when a key is pressed, we get a corrosponding integer value on the header.&amp;lt;br /&amp;gt; &lt;br /&gt;
For example: Pressing the '''F''' key sets the values on pins '''1''' and '''6''' to 1. This gives us a binary value of 01000010. Integer value: 66 . So when the value at the header equals 66 we know that the '''F''' key was pressed.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Note''' This is an abstract, general example of a keypad using matrix encoding. Your keypad will probably have different characters on it's keys and output slightly different values.&lt;br /&gt;
&lt;br /&gt;
===Using getkey===&lt;br /&gt;
&lt;br /&gt;
The '''getkey''' program is controlled from the console via command line parameters. You can specify the keypad device node, specify the keypad matrix file (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above), display the current matrix in the console and test individual character-key associations.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;./getkey [-d device -b -g -s file]&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
;-d:Specify the keypad device node. The default is &amp;lt;code&amp;gt;/dev/keypad&amp;lt;/code&amp;gt;&lt;br /&gt;
;-b:Test an individual key-character association (via &amp;quot;read blocking&amp;quot;). The program will sleep until a key on the keypad is pressed, then output that key's character to the console.&lt;br /&gt;
;-g:Outputs the current keypad matrix (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above) to the console.&lt;br /&gt;
;-s:Specify the keypad matrix file. (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above). If a keypad matrix file is not specified then the character associated with the last keypad key pressed is returned.&lt;br /&gt;
&lt;br /&gt;
'''Note on parameter order.''' Parameters are evaluated in order. If blocking ('''b''') or device specifications ('''d''') are used, they must be declared before the matrix arguments on the command line.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Mapping a Keypad Device Node to a Keypad Matrix File===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;./getkey -d /dev/keypad0 -s /path/to/this/file/Key-E020-21&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program will map the keypad at the device node &amp;lt;code&amp;gt;/dev/keypad0&amp;lt;/code&amp;gt; to the matrix file &amp;lt;code&amp;gt;Key-E020-21&amp;lt;/code&amp;gt;. This associates each character in the grid of characters in the matrix file (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above) with a key in the grid of keys on the keypad.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Displaying the Character Presently Associated With a Key on the Keypad===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;./getkey -d /dev/keypad0 -b&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program will wait until a key is pressed on the keypad. When a key is pressed it will display the character associated with that pressed key, as specified in the keypad matrix file (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above).&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./getkey -d /dev/keypad0 -b&lt;br /&gt;
5&lt;br /&gt;
root@som9g20:/tmp#&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In this case I pressed the '''5''' key on the keypad.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Displaying the Character Matrix Presently Associated with the Keypad===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;./getkey -d /dev/keypad0 -g&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program will display the character matrix (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above) presently associated with the keypad at &amp;lt;code&amp;gt;/dev/keypad0''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./getkey -d /dev/keypad0 -g&lt;br /&gt;
1 2 3 C   &lt;br /&gt;
4 5 6 D   &lt;br /&gt;
7 8 9 E   &lt;br /&gt;
A 0 B F   &lt;br /&gt;
root@som9g20:/tmp#&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The character matrix displayed here is that of the &amp;lt;code&amp;gt;Key-E020-21&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;getkey&amp;lt;code example C project demonstrates how to use a keypad with a SoM150ES carrier board.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_getkey&amp;diff=3122</id>
		<title>Example getkey</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_getkey&amp;diff=3122"/>
		<updated>2014-01-03T23:00:02Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|(11.14.13-11:41-&amp;gt;JG+);(11.14.13-15:30-&amp;gt;MD-);(11.21.13-14:06-&amp;gt;JG+);(11.21.13-16:15-&amp;gt;MD-);(12.03.13-14:21-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,InProgress}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;getkey&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;getkey&amp;lt;/code&amp;gt; example C project demonstrates how to use a keypad with a SoM150ES carrier board. It provides examples of how to specify, inspect and test associations between character-data and keypad-keys. It demonstrates how to turn key-presses into character-data using the same techniques as the big keyboard on your PC. It's also a good introduction to the mysteries of matrix encoding (see [http://wikidev.emacinc.com/wiki/Example_getkey#A_Note_on_Matrix_Encoding A Note on Matrix Encoding, below]).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;getkey&amp;lt;/code&amp;gt; C example project creates one executable: &amp;lt;code&amp;gt;getkey&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
==Usage and Behavior== &lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''getkey''' program requires the following hardware.&lt;br /&gt;
&lt;br /&gt;
* A [http://www.emacinc.com/som/som150es.htm SOM-150ES carrier board] (Available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/som/som9G20.htm SOM-9G20M] and [http://www.emacinc.com/som/som9x25.htm SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible keypad ([http://www.emacinc.com/sbc_microcontroller_addons.htm Available from EMAC], refer to item# E20-21 or E020-25. [https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CCsQFjAA&amp;amp;url=http%3A%2F%2Fwww.in2tec.com%2Flib%2Fdownloadfile.php%3Ffilename%3D4000_series_keypads_datasheet.pdf%26loc%3Ddocuments%2F%26ct%3Dpdf&amp;amp;ei=Wf-MUrGxO-nEyQGggoGgCg&amp;amp;usg=AFQjCNEQxIaiH6-gx6uTq4O66o1YVDunZw&amp;amp;bvm=bv.56643336,d.aWc Datasheet]). &lt;br /&gt;
&lt;br /&gt;
[[File:Som150 with keypad.JPG | 500px ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
SOM-150ES carrier board with keypad&lt;br /&gt;
&lt;br /&gt;
===Plugging the Keypad into the SOM-150ES Carrier Board===&lt;br /&gt;
&lt;br /&gt;
Plug the keypad into the HDR5 KEYPAD header of the SOM-150ES Carrier Board.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Example getkey howtopluginthekeypad 0.png|500px]]&lt;br /&gt;
&lt;br /&gt;
Make sure that you line up '''pin 0''' of the keypad's ribbon cable with '''pin 2''' of the header.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Example getkey howtopluginthekeypad 1.png|500px]]&lt;br /&gt;
&lt;br /&gt;
===The Keypad Matrix File===&lt;br /&gt;
&lt;br /&gt;
The keypad matrix file specifies associations between keypad-keys and characters. For each key in the keypad's grid of keys we specify a character in a grid of characters.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; [[File:Example_getkey_minimalkeypad.png|200px]] &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; [[File: Example_getkey_matrixfile.png|150px]]&lt;br /&gt;
&lt;br /&gt;
In this example we see an E020-21 keypad on the left and an example keypad matrix file (&amp;lt;code&amp;gt;Key-E020-21&amp;lt;/code&amp;gt;, included in the project) opened in a text editor on the right. The character matrix may be freely edited to suit.&lt;br /&gt;
&lt;br /&gt;
====A Note on Matrix Encoding====&lt;br /&gt;
&lt;br /&gt;
Matrix Encoding is a technique for translating individual xy locations on a 2d matrix into unique integer values. Here we see locations in a 4x4 matrix being translated into an 8bit value. Pins 0,1,2,3 handle the key y coordinate; pins 4,5,6,7 handle the x coordinate. Key '''A''' is at (7,0); '''B''':(6,0); '''K''':(5,2); Etc.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; [[File:Matrix encoding.png]]&lt;br /&gt;
&lt;br /&gt;
Thus, when a key is pressed, we get a corrosponding integer value on the header.&amp;lt;br /&amp;gt; &lt;br /&gt;
For example: Pressing the '''F''' key sets the values on pins '''1''' and '''6''' to 1. This gives us a binary value of 01000010. Integer value: 66 . So when the value at the header equals 66 we know that the '''F''' key was pressed.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Note''' This is an abstract, general example of a keypad using matrix encoding. Your keypad will probably have different characters on it's keys and output slightly different values.&lt;br /&gt;
&lt;br /&gt;
===Using getkey===&lt;br /&gt;
&lt;br /&gt;
The '''getkey''' program is controlled from the console via command line parameters. You can specify the keypad device node, specify the keypad matrix file (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above), display the current matrix in the console and test individual character-key associations.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;./getkey [-d device -b -g -s file]&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
;-d:Specify the keypad device node. The default is &amp;lt;code&amp;gt;/dev/keypad&amp;lt;/code&amp;gt;&lt;br /&gt;
;-b:Test an individual key-character association (via &amp;quot;read blocking&amp;quot;). The program will sleep until a key on the keypad is pressed, then output that key's character to the console.&lt;br /&gt;
;-g:Outputs the current keypad matrix (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above) to the console.&lt;br /&gt;
;-s:Specify the keypad matrix file. (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above). If a keypad matrix file is not specified then the character associated with the last keypad key pressed is returned.&lt;br /&gt;
&lt;br /&gt;
'''Note on parameter order.''' Parameters are evaluated in order. If blocking ('''b''') or device specifications ('''d''') are used, they must be declared before the matrix arguments on the command line.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Mapping a Keypad Device Node to a Keypad Matrix File===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;./getkey -d /dev/keypad0 -s /path/to/this/file/Key-E020-21&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program will map the keypad at the device node &amp;lt;code&amp;gt;/dev/keypad0&amp;lt;/code&amp;gt; to the matrix file &amp;lt;code&amp;gt;Key-E020-21&amp;lt;/code&amp;gt;. This associates each character in the grid of characters in the matrix file (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above) with a key in the grid of keys on the keypad.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Displaying the Character Presently Associated With a Key on the Keypad===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;./getkey -d /dev/keypad0 -b&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program will wait until a key is pressed on the keypad. When a key is pressed it will display the character associated with that pressed key, as specified in the keypad matrix file (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above).&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./getkey -d /dev/keypad0 -b&lt;br /&gt;
5&lt;br /&gt;
root@som9g20:/tmp#&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In this case I pressed the '''5''' key on the keypad.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Displaying the Character Matrix Presently Associated with the Keypad===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;./getkey -d /dev/keypad0 -g&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program will display the character matrix (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above) presently associated with the keypad at &amp;lt;code&amp;gt;/dev/keypad0''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./getkey -d /dev/keypad0 -g&lt;br /&gt;
1 2 3 C   &lt;br /&gt;
4 5 6 D   &lt;br /&gt;
7 8 9 E   &lt;br /&gt;
A 0 B F   &lt;br /&gt;
root@som9g20:/tmp#&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The character matrix displayed here is that of the &amp;lt;code&amp;gt;Key-E020-21&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;getkey&amp;lt;code example C project demonstrates how to use a keypad with a SoM150ES carrier board.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_getkey&amp;diff=3121</id>
		<title>Example getkey</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_getkey&amp;diff=3121"/>
		<updated>2014-01-03T22:59:25Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|(11.14.13-11:41-&amp;gt;JG+);(11.14.13-15:30-&amp;gt;MD-);(11.21.13-14:06-&amp;gt;JG+);(11.21.13-16:15-&amp;gt;MD-);(12.03.13-14:21-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,InProgress}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;getkey&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;getkey&amp;lt;/code&amp;gt; example C project demonstrates how to use a keypad with a SoM150ES carrier board. It provides examples of how to specify, inspect and test associations between character-data and keypad-keys. It demonstrates how to turn key-presses into character-data using the same techniques as the big keyboard on your PC. It is a good introduction to the mysteries of matrix encoding (see [http://wikidev.emacinc.com/wiki/Example_getkey#A_Note_on_Matrix_Encoding A Note on Matrix Encoding, below]).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;getkey&amp;lt;/code&amp;gt; C example project creates one executable: &amp;lt;code&amp;gt;getkey&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
==Usage and Behavior== &lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''getkey''' program requires the following hardware.&lt;br /&gt;
&lt;br /&gt;
* A [http://www.emacinc.com/som/som150es.htm SOM-150ES carrier board] (Available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/som/som9G20.htm SOM-9G20M] and [http://www.emacinc.com/som/som9x25.htm SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible keypad ([http://www.emacinc.com/sbc_microcontroller_addons.htm Available from EMAC], refer to item# E20-21 or E020-25. [https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CCsQFjAA&amp;amp;url=http%3A%2F%2Fwww.in2tec.com%2Flib%2Fdownloadfile.php%3Ffilename%3D4000_series_keypads_datasheet.pdf%26loc%3Ddocuments%2F%26ct%3Dpdf&amp;amp;ei=Wf-MUrGxO-nEyQGggoGgCg&amp;amp;usg=AFQjCNEQxIaiH6-gx6uTq4O66o1YVDunZw&amp;amp;bvm=bv.56643336,d.aWc Datasheet]). &lt;br /&gt;
&lt;br /&gt;
[[File:Som150 with keypad.JPG | 500px ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
SOM-150ES carrier board with keypad&lt;br /&gt;
&lt;br /&gt;
===Plugging the Keypad into the SOM-150ES Carrier Board===&lt;br /&gt;
&lt;br /&gt;
Plug the keypad into the HDR5 KEYPAD header of the SOM-150ES Carrier Board.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Example getkey howtopluginthekeypad 0.png|500px]]&lt;br /&gt;
&lt;br /&gt;
Make sure that you line up '''pin 0''' of the keypad's ribbon cable with '''pin 2''' of the header.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Example getkey howtopluginthekeypad 1.png|500px]]&lt;br /&gt;
&lt;br /&gt;
===The Keypad Matrix File===&lt;br /&gt;
&lt;br /&gt;
The keypad matrix file specifies associations between keypad-keys and characters. For each key in the keypad's grid of keys we specify a character in a grid of characters.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; [[File:Example_getkey_minimalkeypad.png|200px]] &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; [[File: Example_getkey_matrixfile.png|150px]]&lt;br /&gt;
&lt;br /&gt;
In this example we see an E020-21 keypad on the left and an example keypad matrix file (&amp;lt;code&amp;gt;Key-E020-21&amp;lt;/code&amp;gt;, included in the project) opened in a text editor on the right. The character matrix may be freely edited to suit.&lt;br /&gt;
&lt;br /&gt;
====A Note on Matrix Encoding====&lt;br /&gt;
&lt;br /&gt;
Matrix Encoding is a technique for translating individual xy locations on a 2d matrix into unique integer values. Here we see locations in a 4x4 matrix being translated into an 8bit value. Pins 0,1,2,3 handle the key y coordinate; pins 4,5,6,7 handle the x coordinate. Key '''A''' is at (7,0); '''B''':(6,0); '''K''':(5,2); Etc.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; [[File:Matrix encoding.png]]&lt;br /&gt;
&lt;br /&gt;
Thus, when a key is pressed, we get a corrosponding integer value on the header.&amp;lt;br /&amp;gt; &lt;br /&gt;
For example: Pressing the '''F''' key sets the values on pins '''1''' and '''6''' to 1. This gives us a binary value of 01000010. Integer value: 66 . So when the value at the header equals 66 we know that the '''F''' key was pressed.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Note''' This is an abstract, general example of a keypad using matrix encoding. Your keypad will probably have different characters on it's keys and output slightly different values.&lt;br /&gt;
&lt;br /&gt;
===Using getkey===&lt;br /&gt;
&lt;br /&gt;
The '''getkey''' program is controlled from the console via command line parameters. You can specify the keypad device node, specify the keypad matrix file (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above), display the current matrix in the console and test individual character-key associations.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;./getkey [-d device -b -g -s file]&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
;-d:Specify the keypad device node. The default is &amp;lt;code&amp;gt;/dev/keypad&amp;lt;/code&amp;gt;&lt;br /&gt;
;-b:Test an individual key-character association (via &amp;quot;read blocking&amp;quot;). The program will sleep until a key on the keypad is pressed, then output that key's character to the console.&lt;br /&gt;
;-g:Outputs the current keypad matrix (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above) to the console.&lt;br /&gt;
;-s:Specify the keypad matrix file. (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above). If a keypad matrix file is not specified then the character associated with the last keypad key pressed is returned.&lt;br /&gt;
&lt;br /&gt;
'''Note on parameter order.''' Parameters are evaluated in order. If blocking ('''b''') or device specifications ('''d''') are used, they must be declared before the matrix arguments on the command line.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Mapping a Keypad Device Node to a Keypad Matrix File===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;./getkey -d /dev/keypad0 -s /path/to/this/file/Key-E020-21&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program will map the keypad at the device node &amp;lt;code&amp;gt;/dev/keypad0&amp;lt;/code&amp;gt; to the matrix file &amp;lt;code&amp;gt;Key-E020-21&amp;lt;/code&amp;gt;. This associates each character in the grid of characters in the matrix file (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above) with a key in the grid of keys on the keypad.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Displaying the Character Presently Associated With a Key on the Keypad===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;./getkey -d /dev/keypad0 -b&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program will wait until a key is pressed on the keypad. When a key is pressed it will display the character associated with that pressed key, as specified in the keypad matrix file (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above).&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./getkey -d /dev/keypad0 -b&lt;br /&gt;
5&lt;br /&gt;
root@som9g20:/tmp#&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In this case I pressed the '''5''' key on the keypad.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Displaying the Character Matrix Presently Associated with the Keypad===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;./getkey -d /dev/keypad0 -g&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program will display the character matrix (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above) presently associated with the keypad at &amp;lt;code&amp;gt;/dev/keypad0''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./getkey -d /dev/keypad0 -g&lt;br /&gt;
1 2 3 C   &lt;br /&gt;
4 5 6 D   &lt;br /&gt;
7 8 9 E   &lt;br /&gt;
A 0 B F   &lt;br /&gt;
root@som9g20:/tmp#&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The character matrix displayed here is that of the &amp;lt;code&amp;gt;Key-E020-21&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;getkey&amp;lt;code example C project demonstrates how to use a keypad with a SoM150ES carrier board.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_getkey&amp;diff=3120</id>
		<title>Example getkey</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_getkey&amp;diff=3120"/>
		<updated>2014-01-03T22:59:09Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|(11.14.13-11:41-&amp;gt;JG+);(11.14.13-15:30-&amp;gt;MD-);(11.21.13-14:06-&amp;gt;JG+);(11.21.13-16:15-&amp;gt;MD-);(12.03.13-14:21-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,InProgress}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;getkey&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;getkey&amp;lt;code&amp;gt; example C project demonstrates how to use a keypad with a SoM150ES carrier board. It provides examples of how to specify, inspect and test associations between character-data and keypad-keys. It demonstrates how to turn key-presses into character-data using the same techniques as the big keyboard on your PC. It is a good introduction to the mysteries of matrix encoding (see [http://wikidev.emacinc.com/wiki/Example_getkey#A_Note_on_Matrix_Encoding A Note on Matrix Encoding, below]).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;getkey&amp;lt;/code&amp;gt; C example project creates one executable: &amp;lt;code&amp;gt;getkey&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
==Usage and Behavior== &lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''getkey''' program requires the following hardware.&lt;br /&gt;
&lt;br /&gt;
* A [http://www.emacinc.com/som/som150es.htm SOM-150ES carrier board] (Available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/som/som9G20.htm SOM-9G20M] and [http://www.emacinc.com/som/som9x25.htm SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible keypad ([http://www.emacinc.com/sbc_microcontroller_addons.htm Available from EMAC], refer to item# E20-21 or E020-25. [https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CCsQFjAA&amp;amp;url=http%3A%2F%2Fwww.in2tec.com%2Flib%2Fdownloadfile.php%3Ffilename%3D4000_series_keypads_datasheet.pdf%26loc%3Ddocuments%2F%26ct%3Dpdf&amp;amp;ei=Wf-MUrGxO-nEyQGggoGgCg&amp;amp;usg=AFQjCNEQxIaiH6-gx6uTq4O66o1YVDunZw&amp;amp;bvm=bv.56643336,d.aWc Datasheet]). &lt;br /&gt;
&lt;br /&gt;
[[File:Som150 with keypad.JPG | 500px ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
SOM-150ES carrier board with keypad&lt;br /&gt;
&lt;br /&gt;
===Plugging the Keypad into the SOM-150ES Carrier Board===&lt;br /&gt;
&lt;br /&gt;
Plug the keypad into the HDR5 KEYPAD header of the SOM-150ES Carrier Board.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Example getkey howtopluginthekeypad 0.png|500px]]&lt;br /&gt;
&lt;br /&gt;
Make sure that you line up '''pin 0''' of the keypad's ribbon cable with '''pin 2''' of the header.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Example getkey howtopluginthekeypad 1.png|500px]]&lt;br /&gt;
&lt;br /&gt;
===The Keypad Matrix File===&lt;br /&gt;
&lt;br /&gt;
The keypad matrix file specifies associations between keypad-keys and characters. For each key in the keypad's grid of keys we specify a character in a grid of characters.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; [[File:Example_getkey_minimalkeypad.png|200px]] &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; [[File: Example_getkey_matrixfile.png|150px]]&lt;br /&gt;
&lt;br /&gt;
In this example we see an E020-21 keypad on the left and an example keypad matrix file (&amp;lt;code&amp;gt;Key-E020-21&amp;lt;/code&amp;gt;, included in the project) opened in a text editor on the right. The character matrix may be freely edited to suit.&lt;br /&gt;
&lt;br /&gt;
====A Note on Matrix Encoding====&lt;br /&gt;
&lt;br /&gt;
Matrix Encoding is a technique for translating individual xy locations on a 2d matrix into unique integer values. Here we see locations in a 4x4 matrix being translated into an 8bit value. Pins 0,1,2,3 handle the key y coordinate; pins 4,5,6,7 handle the x coordinate. Key '''A''' is at (7,0); '''B''':(6,0); '''K''':(5,2); Etc.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; [[File:Matrix encoding.png]]&lt;br /&gt;
&lt;br /&gt;
Thus, when a key is pressed, we get a corrosponding integer value on the header.&amp;lt;br /&amp;gt; &lt;br /&gt;
For example: Pressing the '''F''' key sets the values on pins '''1''' and '''6''' to 1. This gives us a binary value of 01000010. Integer value: 66 . So when the value at the header equals 66 we know that the '''F''' key was pressed.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Note''' This is an abstract, general example of a keypad using matrix encoding. Your keypad will probably have different characters on it's keys and output slightly different values.&lt;br /&gt;
&lt;br /&gt;
===Using getkey===&lt;br /&gt;
&lt;br /&gt;
The '''getkey''' program is controlled from the console via command line parameters. You can specify the keypad device node, specify the keypad matrix file (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above), display the current matrix in the console and test individual character-key associations.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;./getkey [-d device -b -g -s file]&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
;-d:Specify the keypad device node. The default is &amp;lt;code&amp;gt;/dev/keypad&amp;lt;/code&amp;gt;&lt;br /&gt;
;-b:Test an individual key-character association (via &amp;quot;read blocking&amp;quot;). The program will sleep until a key on the keypad is pressed, then output that key's character to the console.&lt;br /&gt;
;-g:Outputs the current keypad matrix (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above) to the console.&lt;br /&gt;
;-s:Specify the keypad matrix file. (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above). If a keypad matrix file is not specified then the character associated with the last keypad key pressed is returned.&lt;br /&gt;
&lt;br /&gt;
'''Note on parameter order.''' Parameters are evaluated in order. If blocking ('''b''') or device specifications ('''d''') are used, they must be declared before the matrix arguments on the command line.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Mapping a Keypad Device Node to a Keypad Matrix File===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;./getkey -d /dev/keypad0 -s /path/to/this/file/Key-E020-21&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program will map the keypad at the device node &amp;lt;code&amp;gt;/dev/keypad0&amp;lt;/code&amp;gt; to the matrix file &amp;lt;code&amp;gt;Key-E020-21&amp;lt;/code&amp;gt;. This associates each character in the grid of characters in the matrix file (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above) with a key in the grid of keys on the keypad.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Displaying the Character Presently Associated With a Key on the Keypad===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;./getkey -d /dev/keypad0 -b&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program will wait until a key is pressed on the keypad. When a key is pressed it will display the character associated with that pressed key, as specified in the keypad matrix file (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above).&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./getkey -d /dev/keypad0 -b&lt;br /&gt;
5&lt;br /&gt;
root@som9g20:/tmp#&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In this case I pressed the '''5''' key on the keypad.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Displaying the Character Matrix Presently Associated with the Keypad===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;./getkey -d /dev/keypad0 -g&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program will display the character matrix (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above) presently associated with the keypad at &amp;lt;code&amp;gt;/dev/keypad0''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./getkey -d /dev/keypad0 -g&lt;br /&gt;
1 2 3 C   &lt;br /&gt;
4 5 6 D   &lt;br /&gt;
7 8 9 E   &lt;br /&gt;
A 0 B F   &lt;br /&gt;
root@som9g20:/tmp#&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The character matrix displayed here is that of the &amp;lt;code&amp;gt;Key-E020-21&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;getkey&amp;lt;code example C project demonstrates how to use a keypad with a SoM150ES carrier board.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_getkey&amp;diff=3119</id>
		<title>Example getkey</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_getkey&amp;diff=3119"/>
		<updated>2014-01-03T22:58:38Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|(11.14.13-11:41-&amp;gt;JG+);(11.14.13-15:30-&amp;gt;MD-);(11.21.13-14:06-&amp;gt;JG+);(11.21.13-16:15-&amp;gt;MD-);(12.03.13-14:21-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,InProgress}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;getkey&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;getkey&amp;lt;code example C project demonstrates how to use a keypad with a SoM150ES carrier board. It provides examples of how to specify, inspect and test associations between character-data and keypad-keys. It demonstrates how to turn key-presses into character-data using the same techniques as the big keyboard on your PC. It is a good introduction to the mysteries of matrix encoding (see [http://wikidev.emacinc.com/wiki/Example_getkey#A_Note_on_Matrix_Encoding A Note on Matrix Encoding, below]).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;getkey&amp;lt;/code&amp;gt; C example project creates one executable: &amp;lt;code&amp;gt;getkey&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
==Usage and Behavior== &lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''getkey''' program requires the following hardware.&lt;br /&gt;
&lt;br /&gt;
* A [http://www.emacinc.com/som/som150es.htm SOM-150ES carrier board] (Available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/som/som9G20.htm SOM-9G20M] and [http://www.emacinc.com/som/som9x25.htm SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible keypad ([http://www.emacinc.com/sbc_microcontroller_addons.htm Available from EMAC], refer to item# E20-21 or E020-25. [https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CCsQFjAA&amp;amp;url=http%3A%2F%2Fwww.in2tec.com%2Flib%2Fdownloadfile.php%3Ffilename%3D4000_series_keypads_datasheet.pdf%26loc%3Ddocuments%2F%26ct%3Dpdf&amp;amp;ei=Wf-MUrGxO-nEyQGggoGgCg&amp;amp;usg=AFQjCNEQxIaiH6-gx6uTq4O66o1YVDunZw&amp;amp;bvm=bv.56643336,d.aWc Datasheet]). &lt;br /&gt;
&lt;br /&gt;
[[File:Som150 with keypad.JPG | 500px ]]&amp;lt;br /&amp;gt;&lt;br /&gt;
SOM-150ES carrier board with keypad&lt;br /&gt;
&lt;br /&gt;
===Plugging the Keypad into the SOM-150ES Carrier Board===&lt;br /&gt;
&lt;br /&gt;
Plug the keypad into the HDR5 KEYPAD header of the SOM-150ES Carrier Board.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Example getkey howtopluginthekeypad 0.png|500px]]&lt;br /&gt;
&lt;br /&gt;
Make sure that you line up '''pin 0''' of the keypad's ribbon cable with '''pin 2''' of the header.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:Example getkey howtopluginthekeypad 1.png|500px]]&lt;br /&gt;
&lt;br /&gt;
===The Keypad Matrix File===&lt;br /&gt;
&lt;br /&gt;
The keypad matrix file specifies associations between keypad-keys and characters. For each key in the keypad's grid of keys we specify a character in a grid of characters.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; [[File:Example_getkey_minimalkeypad.png|200px]] &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; [[File: Example_getkey_matrixfile.png|150px]]&lt;br /&gt;
&lt;br /&gt;
In this example we see an E020-21 keypad on the left and an example keypad matrix file (&amp;lt;code&amp;gt;Key-E020-21&amp;lt;/code&amp;gt;, included in the project) opened in a text editor on the right. The character matrix may be freely edited to suit.&lt;br /&gt;
&lt;br /&gt;
====A Note on Matrix Encoding====&lt;br /&gt;
&lt;br /&gt;
Matrix Encoding is a technique for translating individual xy locations on a 2d matrix into unique integer values. Here we see locations in a 4x4 matrix being translated into an 8bit value. Pins 0,1,2,3 handle the key y coordinate; pins 4,5,6,7 handle the x coordinate. Key '''A''' is at (7,0); '''B''':(6,0); '''K''':(5,2); Etc.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; [[File:Matrix encoding.png]]&lt;br /&gt;
&lt;br /&gt;
Thus, when a key is pressed, we get a corrosponding integer value on the header.&amp;lt;br /&amp;gt; &lt;br /&gt;
For example: Pressing the '''F''' key sets the values on pins '''1''' and '''6''' to 1. This gives us a binary value of 01000010. Integer value: 66 . So when the value at the header equals 66 we know that the '''F''' key was pressed.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Note''' This is an abstract, general example of a keypad using matrix encoding. Your keypad will probably have different characters on it's keys and output slightly different values.&lt;br /&gt;
&lt;br /&gt;
===Using getkey===&lt;br /&gt;
&lt;br /&gt;
The '''getkey''' program is controlled from the console via command line parameters. You can specify the keypad device node, specify the keypad matrix file (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above), display the current matrix in the console and test individual character-key associations.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;./getkey [-d device -b -g -s file]&amp;lt;/code&amp;gt; &lt;br /&gt;
&lt;br /&gt;
;-d:Specify the keypad device node. The default is &amp;lt;code&amp;gt;/dev/keypad&amp;lt;/code&amp;gt;&lt;br /&gt;
;-b:Test an individual key-character association (via &amp;quot;read blocking&amp;quot;). The program will sleep until a key on the keypad is pressed, then output that key's character to the console.&lt;br /&gt;
;-g:Outputs the current keypad matrix (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above) to the console.&lt;br /&gt;
;-s:Specify the keypad matrix file. (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above). If a keypad matrix file is not specified then the character associated with the last keypad key pressed is returned.&lt;br /&gt;
&lt;br /&gt;
'''Note on parameter order.''' Parameters are evaluated in order. If blocking ('''b''') or device specifications ('''d''') are used, they must be declared before the matrix arguments on the command line.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Mapping a Keypad Device Node to a Keypad Matrix File===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;./getkey -d /dev/keypad0 -s /path/to/this/file/Key-E020-21&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program will map the keypad at the device node &amp;lt;code&amp;gt;/dev/keypad0&amp;lt;/code&amp;gt; to the matrix file &amp;lt;code&amp;gt;Key-E020-21&amp;lt;/code&amp;gt;. This associates each character in the grid of characters in the matrix file (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above) with a key in the grid of keys on the keypad.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Displaying the Character Presently Associated With a Key on the Keypad===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;./getkey -d /dev/keypad0 -b&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program will wait until a key is pressed on the keypad. When a key is pressed it will display the character associated with that pressed key, as specified in the keypad matrix file (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above).&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./getkey -d /dev/keypad0 -b&lt;br /&gt;
5&lt;br /&gt;
root@som9g20:/tmp#&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In this case I pressed the '''5''' key on the keypad.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Displaying the Character Matrix Presently Associated with the Keypad===&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;./getkey -d /dev/keypad0 -g&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program will display the character matrix (see notes on the [http://wikidev.emacinc.com/wiki/Example_getkey#The_Keypad_Matrix_File keypad matrix file], above) presently associated with the keypad at &amp;lt;code&amp;gt;/dev/keypad0''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./getkey -d /dev/keypad0 -g&lt;br /&gt;
1 2 3 C   &lt;br /&gt;
4 5 6 D   &lt;br /&gt;
7 8 9 E   &lt;br /&gt;
A 0 B F   &lt;br /&gt;
root@som9g20:/tmp#&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The character matrix displayed here is that of the &amp;lt;code&amp;gt;Key-E020-21&amp;lt;/code&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;getkey&amp;lt;code example C project demonstrates how to use a keypad with a SoM150ES carrier board.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3116</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3116"/>
		<updated>2014-01-03T22:49:46Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Usage Example. Ring Demo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|Review(01.03.14-16:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of SOM-150ES carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC [http://www.emacinc.com/som/som150es.htm SOM-150ES] carrier board. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
[[File:know_your_som_150.jpg|frame|left|SOM-150ES carrier board with GPIO, LEDs and analog IO indicated.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a detail of the '''HDR1 PLD &amp;amp; BUFFERED GPIO''' header. Pin 49 is hot. The bottom pins: 2,4,6...46,48,50; are all ground. Port A is pins 1,3,5,7,9,11,13,15. Port B is pins 17,19,21,23,25,27,29,31. Port C is pins 33,35,37,39,41,43,45,47. &lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''-a'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: a&lt;br /&gt;
&lt;br /&gt;
A/D Demo&lt;br /&gt;
[0]=126 [1]=11B [2]=12C [3]=12B &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What you see there is low-level ambient signals (radio waves? astral perturbations?) being picked up by the analog-in pins 11,12,13,14. Press '''a''' a few times and watch the values change. &lt;br /&gt;
&lt;br /&gt;
This is the HDR8 ANALOG IO header.&lt;br /&gt;
&lt;br /&gt;
[[File:analog_io_header_detail.jpg]]&lt;br /&gt;
&lt;br /&gt;
Let's do a couple of experiments on our analog in pins. &lt;br /&gt;
&lt;br /&gt;
Connect pin 20 to pin 11 (with, say, a double mini-grabber wire thingy). Hit '''a'''. Note that our first value is higher than the others. It should read '''3FF'''. That means that our first analog-in pin has 2.5V on it.&lt;br /&gt;
&lt;br /&gt;
Connect pin 1 to pin 11. Hit '''a'''. Note that our first value is lower than the others. It's the vicinity of 0. That means that our first analog-in pin is getting grounded.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board LD1-LD8. (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. See [[http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board]], above, for details.&lt;br /&gt;
&lt;br /&gt;
This is the suave ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press r.&lt;br /&gt;
&lt;br /&gt;
The system sets a bit on Port C to 1, then sets it to 0, then sets the bit after that to 1, then sets that pin to 0, and so on; sequentially. It makes a nice light-show effect on the LED strip (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above).&lt;br /&gt;
&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins. As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3115</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3115"/>
		<updated>2014-01-03T22:48:58Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Usage Example. Ring Demo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|Review(01.03.14-16:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of SOM-150ES carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC [http://www.emacinc.com/som/som150es.htm SOM-150ES] carrier board. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
[[File:know_your_som_150.jpg|frame|left|SOM-150ES carrier board with GPIO, LEDs and analog IO indicated.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a detail of the '''HDR1 PLD &amp;amp; BUFFERED GPIO''' header. Pin 49 is hot. The bottom pins: 2,4,6...46,48,50; are all ground. Port A is pins 1,3,5,7,9,11,13,15. Port B is pins 17,19,21,23,25,27,29,31. Port C is pins 33,35,37,39,41,43,45,47. &lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''-a'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: a&lt;br /&gt;
&lt;br /&gt;
A/D Demo&lt;br /&gt;
[0]=126 [1]=11B [2]=12C [3]=12B &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What you see there is low-level ambient signals (radio waves? astral perturbations?) being picked up by the analog-in pins 11,12,13,14. Press '''a''' a few times and watch the values change. &lt;br /&gt;
&lt;br /&gt;
This is the HDR8 ANALOG IO header.&lt;br /&gt;
&lt;br /&gt;
[[File:analog_io_header_detail.jpg]]&lt;br /&gt;
&lt;br /&gt;
Let's do a couple of experiments on our analog in pins. &lt;br /&gt;
&lt;br /&gt;
Connect pin 20 to pin 11 (with, say, a double mini-grabber wire thingy). Hit '''a'''. Note that our first value is higher than the others. It should read '''3FF'''. That means that our first analog-in pin has 2.5V on it.&lt;br /&gt;
&lt;br /&gt;
Connect pin 1 to pin 11. Hit '''a'''. Note that our first value is lower than the others. It's the vicinity of 0. That means that our first analog-in pin is getting grounded.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board LD1-LD8. (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. See [[http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board]], above, for details.&lt;br /&gt;
&lt;br /&gt;
This is the suave ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press r.&lt;br /&gt;
&lt;br /&gt;
The system sets a bit on Port C to 1, then sets it to 0, then sets the bit after that to 1, then sets that pin to 0, and so on; sequentially. It makes a nice light-show effect on the LED strip (see Know Your Carrier Board, above).&lt;br /&gt;
&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins. As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3114</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3114"/>
		<updated>2014-01-03T22:47:39Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|Review(01.03.14-16:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of SOM-150ES carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC [http://www.emacinc.com/som/som150es.htm SOM-150ES] carrier board. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
[[File:know_your_som_150.jpg|frame|left|SOM-150ES carrier board with GPIO, LEDs and analog IO indicated.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a detail of the '''HDR1 PLD &amp;amp; BUFFERED GPIO''' header. Pin 49 is hot. The bottom pins: 2,4,6...46,48,50; are all ground. Port A is pins 1,3,5,7,9,11,13,15. Port B is pins 17,19,21,23,25,27,29,31. Port C is pins 33,35,37,39,41,43,45,47. &lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''-a'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: a&lt;br /&gt;
&lt;br /&gt;
A/D Demo&lt;br /&gt;
[0]=126 [1]=11B [2]=12C [3]=12B &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What you see there is low-level ambient signals (radio waves? astral perturbations?) being picked up by the analog-in pins 11,12,13,14. Press '''a''' a few times and watch the values change. &lt;br /&gt;
&lt;br /&gt;
This is the HDR8 ANALOG IO header.&lt;br /&gt;
&lt;br /&gt;
[[File:analog_io_header_detail.jpg]]&lt;br /&gt;
&lt;br /&gt;
Let's do a couple of experiments on our analog in pins. &lt;br /&gt;
&lt;br /&gt;
Connect pin 20 to pin 11 (with, say, a double mini-grabber wire thingy). Hit '''a'''. Note that our first value is higher than the others. It should read '''3FF'''. That means that our first analog-in pin has 2.5V on it.&lt;br /&gt;
&lt;br /&gt;
Connect pin 1 to pin 11. Hit '''a'''. Note that our first value is lower than the others. It's the vicinity of 0. That means that our first analog-in pin is getting grounded.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board LD1-LD8. (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. See [[http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board]], above, for details.&lt;br /&gt;
&lt;br /&gt;
This is the suave ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press r.&lt;br /&gt;
&lt;br /&gt;
The system sets a bit on Port C to 1, then sets it to 0, then sets the bit after that to 1, then sets that pin to 0, and so on; sequentially. It makes a nice light-show effect.&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see Know Your Carrier Board, above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3113</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3113"/>
		<updated>2014-01-03T22:45:52Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Usage Example. Ring Demo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|InProgress(12.05.13-12:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of SOM-150ES carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC [http://www.emacinc.com/som/som150es.htm SOM-150ES] carrier board. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
[[File:know_your_som_150.jpg|frame|left|SOM-150ES carrier board with GPIO, LEDs and analog IO indicated.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a detail of the '''HDR1 PLD &amp;amp; BUFFERED GPIO''' header. Pin 49 is hot. The bottom pins: 2,4,6...46,48,50; are all ground. Port A is pins 1,3,5,7,9,11,13,15. Port B is pins 17,19,21,23,25,27,29,31. Port C is pins 33,35,37,39,41,43,45,47. &lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''-a'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: a&lt;br /&gt;
&lt;br /&gt;
A/D Demo&lt;br /&gt;
[0]=126 [1]=11B [2]=12C [3]=12B &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What you see there is low-level ambient signals (radio waves? astral perturbations?) being picked up by the analog-in pins 11,12,13,14. Press '''a''' a few times and watch the values change. &lt;br /&gt;
&lt;br /&gt;
This is the HDR8 ANALOG IO header.&lt;br /&gt;
&lt;br /&gt;
[[File:analog_io_header_detail.jpg]]&lt;br /&gt;
&lt;br /&gt;
Let's do a couple of experiments on our analog in pins. &lt;br /&gt;
&lt;br /&gt;
Connect pin 20 to pin 11 (with, say, a double mini-grabber wire thingy). Hit '''a'''. Note that our first value is higher than the others. It should read '''3FF'''. That means that our first analog-in pin has 2.5V on it.&lt;br /&gt;
&lt;br /&gt;
Connect pin 1 to pin 11. Hit '''a'''. Note that our first value is lower than the others. It's the vicinity of 0. That means that our first analog-in pin is getting grounded.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board LD1-LD8. (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. See [[http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board]], above, for details.&lt;br /&gt;
&lt;br /&gt;
This is the suave ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press r.&lt;br /&gt;
&lt;br /&gt;
The system sets a bit on Port C to 1, then sets it to 0, then sets the bit after that to 1, then sets that pin to 0, and so on; sequentially. It makes a nice light-show effect.&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see Know Your Carrier Board, above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3110</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3110"/>
		<updated>2014-01-03T22:42:11Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Usage Example. Count Demo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|InProgress(12.05.13-12:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of SOM-150ES carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC [http://www.emacinc.com/som/som150es.htm SOM-150ES] carrier board. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
[[File:know_your_som_150.jpg|frame|left|SOM-150ES carrier board with GPIO, LEDs and analog IO indicated.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a detail of the '''HDR1 PLD &amp;amp; BUFFERED GPIO''' header. Pin 49 is hot. The bottom pins: 2,4,6...46,48,50; are all ground. Port A is pins 1,3,5,7,9,11,13,15. Port B is pins 17,19,21,23,25,27,29,31. Port C is pins 33,35,37,39,41,43,45,47. &lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''-a'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: a&lt;br /&gt;
&lt;br /&gt;
A/D Demo&lt;br /&gt;
[0]=126 [1]=11B [2]=12C [3]=12B &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What you see there is low-level ambient signals (radio waves? astral perturbations?) being picked up by the analog-in pins 11,12,13,14. Press '''a''' a few times and watch the values change. &lt;br /&gt;
&lt;br /&gt;
This is the HDR8 ANALOG IO header.&lt;br /&gt;
&lt;br /&gt;
[[File:analog_io_header_detail.jpg]]&lt;br /&gt;
&lt;br /&gt;
Let's do a couple of experiments on our analog in pins. &lt;br /&gt;
&lt;br /&gt;
Connect pin 20 to pin 11 (with, say, a double mini-grabber wire thingy). Hit '''a'''. Note that our first value is higher than the others. It should read '''3FF'''. That means that our first analog-in pin has 2.5V on it.&lt;br /&gt;
&lt;br /&gt;
Connect pin 1 to pin 11. Hit '''a'''. Note that our first value is lower than the others. It's the vicinity of 0. That means that our first analog-in pin is getting grounded.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board LD1-LD8. (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. See [[http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board]], above, for details.&lt;br /&gt;
&lt;br /&gt;
This is the suave ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.&lt;br /&gt;
&lt;br /&gt;
[[File:Io demo led action sample 2.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The board lights the LEDs in numeric sequence, 1-8, then repeats; looping until a key is pressed.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3109</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3109"/>
		<updated>2014-01-03T22:41:37Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Usage Example. Input to Output Demo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|InProgress(12.05.13-12:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of SOM-150ES carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC [http://www.emacinc.com/som/som150es.htm SOM-150ES] carrier board. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
[[File:know_your_som_150.jpg|frame|left|SOM-150ES carrier board with GPIO, LEDs and analog IO indicated.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a detail of the '''HDR1 PLD &amp;amp; BUFFERED GPIO''' header. Pin 49 is hot. The bottom pins: 2,4,6...46,48,50; are all ground. Port A is pins 1,3,5,7,9,11,13,15. Port B is pins 17,19,21,23,25,27,29,31. Port C is pins 33,35,37,39,41,43,45,47. &lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''-a'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: a&lt;br /&gt;
&lt;br /&gt;
A/D Demo&lt;br /&gt;
[0]=126 [1]=11B [2]=12C [3]=12B &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What you see there is low-level ambient signals (radio waves? astral perturbations?) being picked up by the analog-in pins 11,12,13,14. Press '''a''' a few times and watch the values change. &lt;br /&gt;
&lt;br /&gt;
This is the HDR8 ANALOG IO header.&lt;br /&gt;
&lt;br /&gt;
[[File:analog_io_header_detail.jpg]]&lt;br /&gt;
&lt;br /&gt;
Let's do a couple of experiments on our analog in pins. &lt;br /&gt;
&lt;br /&gt;
Connect pin 20 to pin 11 (with, say, a double mini-grabber wire thingy). Hit '''a'''. Note that our first value is higher than the others. It should read '''3FF'''. That means that our first analog-in pin has 2.5V on it.&lt;br /&gt;
&lt;br /&gt;
Connect pin 1 to pin 11. Hit '''a'''. Note that our first value is lower than the others. It's the vicinity of 0. That means that our first analog-in pin is getting grounded.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board (LD1-LD8. see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. See [[http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board]], above, for details.&lt;br /&gt;
&lt;br /&gt;
This is the suave ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.&lt;br /&gt;
&lt;br /&gt;
[[File:Io demo led action sample 2.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The board lights the LEDs in numeric sequence, 1-8, then repeats; looping until a key is pressed.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3107</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3107"/>
		<updated>2014-01-03T22:40:53Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Usage Example. Input to Output Demo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|InProgress(12.05.13-12:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of SOM-150ES carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC [http://www.emacinc.com/som/som150es.htm SOM-150ES] carrier board. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
[[File:know_your_som_150.jpg|frame|left|SOM-150ES carrier board with GPIO, LEDs and analog IO indicated.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a detail of the '''HDR1 PLD &amp;amp; BUFFERED GPIO''' header. Pin 49 is hot. The bottom pins: 2,4,6...46,48,50; are all ground. Port A is pins 1,3,5,7,9,11,13,15. Port B is pins 17,19,21,23,25,27,29,31. Port C is pins 33,35,37,39,41,43,45,47. &lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''-a'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: a&lt;br /&gt;
&lt;br /&gt;
A/D Demo&lt;br /&gt;
[0]=126 [1]=11B [2]=12C [3]=12B &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What you see there is low-level ambient signals (radio waves? astral perturbations?) being picked up by the analog-in pins 11,12,13,14. Press '''a''' a few times and watch the values change. &lt;br /&gt;
&lt;br /&gt;
This is the HDR8 ANALOG IO header.&lt;br /&gt;
&lt;br /&gt;
[[File:analog_io_header_detail.jpg]]&lt;br /&gt;
&lt;br /&gt;
Let's do a couple of experiments on our analog in pins. &lt;br /&gt;
&lt;br /&gt;
Connect pin 20 to pin 11 (with, say, a double mini-grabber wire thingy). Hit '''a'''. Note that our first value is higher than the others. It should read '''3FF'''. That means that our first analog-in pin has 2.5V on it.&lt;br /&gt;
&lt;br /&gt;
Connect pin 1 to pin 11. Hit '''a'''. Note that our first value is lower than the others. It's the vicinity of 0. That means that our first analog-in pin is getting grounded.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board (LD1-LD8. see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. See [[http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board]], above, for details.&lt;br /&gt;
&lt;br /&gt;
This is the suave ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.&lt;br /&gt;
&lt;br /&gt;
[[File:Io demo led action sample 2.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The board lights the LEDs in numeric sequence, 1-8, then repeats; looping until a key is pressed.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3105</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3105"/>
		<updated>2014-01-03T22:39:49Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Usage Example. Input to Output Demo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|InProgress(12.05.13-12:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of SOM-150ES carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC [http://www.emacinc.com/som/som150es.htm SOM-150ES] carrier board. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
[[File:know_your_som_150.jpg|frame|left|SOM-150ES carrier board with GPIO, LEDs and analog IO indicated.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a detail of the '''HDR1 PLD &amp;amp; BUFFERED GPIO''' header. Pin 49 is hot. The bottom pins: 2,4,6...46,48,50; are all ground. Port A is pins 1,3,5,7,9,11,13,15. Port B is pins 17,19,21,23,25,27,29,31. Port C is pins 33,35,37,39,41,43,45,47. &lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''-a'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: a&lt;br /&gt;
&lt;br /&gt;
A/D Demo&lt;br /&gt;
[0]=126 [1]=11B [2]=12C [3]=12B &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What you see there is low-level ambient signals (radio waves? astral perturbations?) being picked up by the analog-in pins 11,12,13,14. Press '''a''' a few times and watch the values change. &lt;br /&gt;
&lt;br /&gt;
This is the HDR8 ANALOG IO header.&lt;br /&gt;
&lt;br /&gt;
[[File:analog_io_header_detail.jpg]]&lt;br /&gt;
&lt;br /&gt;
Let's do a couple of experiments on our analog in pins. &lt;br /&gt;
&lt;br /&gt;
Connect pin 20 to pin 11 (with, say, a double mini-grabber wire thingy). Hit '''a'''. Note that our first value is higher than the others. It should read '''3FF'''. That means that our first analog-in pin has 2.5V on it.&lt;br /&gt;
&lt;br /&gt;
Connect pin 1 to pin 11. Hit '''a'''. Note that our first value is lower than the others. It's the vicinity of 0. That means that our first analog-in pin is getting grounded.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board (LD1-LD8. see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. See [[fhgdfhfhg]], above, for details.&lt;br /&gt;
&lt;br /&gt;
This is the suave ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.&lt;br /&gt;
&lt;br /&gt;
[[File:Io demo led action sample 2.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The board lights the LEDs in numeric sequence, 1-8, then repeats; looping until a key is pressed.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3104</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3104"/>
		<updated>2014-01-03T22:38:19Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Usage Example. Input to Output Demo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|InProgress(12.05.13-12:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of SOM-150ES carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC [http://www.emacinc.com/som/som150es.htm SOM-150ES] carrier board. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
[[File:know_your_som_150.jpg|frame|left|SOM-150ES carrier board with GPIO, LEDs and analog IO indicated.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a detail of the '''HDR1 PLD &amp;amp; BUFFERED GPIO''' header. Pin 49 is hot. The bottom pins: 2,4,6...46,48,50; are all ground. Port A is pins 1,3,5,7,9,11,13,15. Port B is pins 17,19,21,23,25,27,29,31. Port C is pins 33,35,37,39,41,43,45,47. &lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''-a'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: a&lt;br /&gt;
&lt;br /&gt;
A/D Demo&lt;br /&gt;
[0]=126 [1]=11B [2]=12C [3]=12B &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What you see there is low-level ambient signals (radio waves? astral perturbations?) being picked up by the analog-in pins 11,12,13,14. Press '''a''' a few times and watch the values change. &lt;br /&gt;
&lt;br /&gt;
This is the HDR8 ANALOG IO header.&lt;br /&gt;
&lt;br /&gt;
[[File:analog_io_header_detail.jpg]]&lt;br /&gt;
&lt;br /&gt;
Let's do a couple of experiments on our analog in pins. &lt;br /&gt;
&lt;br /&gt;
Connect pin 20 to pin 11 (with, say, a double mini-grabber wire thingy). Hit '''a'''. Note that our first value is higher than the others. It should read '''3FF'''. That means that our first analog-in pin has 2.5V on it.&lt;br /&gt;
&lt;br /&gt;
Connect pin 1 to pin 11. Hit '''a'''. Note that our first value is lower than the others. It's the vicinity of 0. That means that our first analog-in pin is getting grounded.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board (LD1-LD8. see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;detail of board. gpio header closeup with ports b and c labelled&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the suave ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.&lt;br /&gt;
&lt;br /&gt;
[[File:Io demo led action sample 2.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The board lights the LEDs in numeric sequence, 1-8, then repeats; looping until a key is pressed.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3102</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3102"/>
		<updated>2014-01-03T22:36:01Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Usage Example. A/D Demo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|InProgress(12.05.13-12:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of SOM-150ES carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC [http://www.emacinc.com/som/som150es.htm SOM-150ES] carrier board. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
[[File:know_your_som_150.jpg|frame|left|SOM-150ES carrier board with GPIO, LEDs and analog IO indicated.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a detail of the '''HDR1 PLD &amp;amp; BUFFERED GPIO''' header. Pin 49 is hot. The bottom pins: 2,4,6...46,48,50; are all ground. Port A is pins 1,3,5,7,9,11,13,15. Port B is pins 17,19,21,23,25,27,29,31. Port C is pins 33,35,37,39,41,43,45,47. &lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''-a'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: a&lt;br /&gt;
&lt;br /&gt;
A/D Demo&lt;br /&gt;
[0]=126 [1]=11B [2]=12C [3]=12B &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What you see there is low-level ambient signals (radio waves? astral perturbations?) being picked up by the analog-in pins 11,12,13,14. Press '''a''' a few times and watch the values change. &lt;br /&gt;
&lt;br /&gt;
This is the HDR8 ANALOG IO header.&lt;br /&gt;
&lt;br /&gt;
[[File:analog_io_header_detail.jpg]]&lt;br /&gt;
&lt;br /&gt;
Let's do a couple of experiments on our analog in pins. &lt;br /&gt;
&lt;br /&gt;
Connect pin 20 to pin 11 (with, say, a double mini-grabber wire thingy). Hit '''a'''. Note that our first value is higher than the others. It should read '''3FF'''. That means that our first analog-in pin has 2.5V on it.&lt;br /&gt;
&lt;br /&gt;
Connect pin 1 to pin 11. Hit '''a'''. Note that our first value is lower than the others. It's the vicinity of 0. That means that our first analog-in pin is getting grounded.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board (LD1-LD8. see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;detail of board. gpio header closeup with ports b and c labelled&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.&lt;br /&gt;
&lt;br /&gt;
[[File:Io demo led action sample 2.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The board lights the LEDs in numeric sequence, 1-8, then repeats; looping until a key is pressed.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3101</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3101"/>
		<updated>2014-01-03T22:34:25Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Usage Example. A/D Demo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|InProgress(12.05.13-12:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of SOM-150ES carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC [http://www.emacinc.com/som/som150es.htm SOM-150ES] carrier board. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
[[File:know_your_som_150.jpg|frame|left|SOM-150ES carrier board with GPIO, LEDs and analog IO indicated.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a detail of the '''HDR1 PLD &amp;amp; BUFFERED GPIO''' header. Pin 49 is hot. The bottom pins: 2,4,6...46,48,50; are all ground. Port A is pins 1,3,5,7,9,11,13,15. Port B is pins 17,19,21,23,25,27,29,31. Port C is pins 33,35,37,39,41,43,45,47. &lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''-a'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: a&lt;br /&gt;
&lt;br /&gt;
A/D Demo&lt;br /&gt;
[0]=126 [1]=11B [2]=12C [3]=12B &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What you see there is low-level ambient signals (radio waves? astral perturbations?) being picked up by the analog-in pins 11,12,13,14. Press '''a''' a few times and watch the values change. &lt;br /&gt;
&lt;br /&gt;
This is the HDR8 ANALOG IO header.&lt;br /&gt;
&lt;br /&gt;
[[File:analog_io_header_detail.jpg]]&lt;br /&gt;
&lt;br /&gt;
Let's do a couple of experiments on our analog in pins. &lt;br /&gt;
&lt;br /&gt;
Connect pin 20 to pin 11 (with, say, a double mini-grabber wire thingy). Hit '''a'''. Note that our first value is higher than the others. It should read '''3FF'''. That means that the pin has 2.5V on it.&lt;br /&gt;
&lt;br /&gt;
Connect pin 1 to pin 11. Hit '''a'''. Note that our first value is lower than the others. It's the vicinity of 0. That means that the first analog in pin is getting grounded.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board (LD1-LD8. see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;detail of board. gpio header closeup with ports b and c labelled&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.&lt;br /&gt;
&lt;br /&gt;
[[File:Io demo led action sample 2.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The board lights the LEDs in numeric sequence, 1-8, then repeats; looping until a key is pressed.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=File:Analog_io_header_detail.jpg&amp;diff=3098</id>
		<title>File:Analog io header detail.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=File:Analog_io_header_detail.jpg&amp;diff=3098"/>
		<updated>2014-01-03T22:14:11Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3097</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3097"/>
		<updated>2014-01-03T22:13:58Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Usage Example. A/D Demo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|InProgress(12.05.13-12:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of SOM-150ES carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC [http://www.emacinc.com/som/som150es.htm SOM-150ES] carrier board. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
[[File:know_your_som_150.jpg|frame|left|SOM-150ES carrier board with GPIO, LEDs and analog IO indicated.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a detail of the '''HDR1 PLD &amp;amp; BUFFERED GPIO''' header. Pin 49 is hot. The bottom pins: 2,4,6...46,48,50; are all ground. Port A is pins 1,3,5,7,9,11,13,15. Port B is pins 17,19,21,23,25,27,29,31. Port C is pins 33,35,37,39,41,43,45,47. &lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''-a'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: a&lt;br /&gt;
&lt;br /&gt;
A/D Demo&lt;br /&gt;
[0]=126 [1]=11B [2]=12C [3]=12B &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What you see there is low-level ambient signals (radio waves? astral perturbations?) being picked up by the analog-in pins 11,12,13,14. Press '''a''' a few times and watch the values change. &lt;br /&gt;
&lt;br /&gt;
This is the HDR8 ANALOG IO header.&lt;br /&gt;
&lt;br /&gt;
[[File:analog_io_header_detail.jpg]]&lt;br /&gt;
&lt;br /&gt;
Now we will play with the analog signals being picked up on our four pins.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board (LD1-LD8. see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;detail of board. gpio header closeup with ports b and c labelled&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.&lt;br /&gt;
&lt;br /&gt;
[[File:Io demo led action sample 2.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The board lights the LEDs in numeric sequence, 1-8, then repeats; looping until a key is pressed.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3093</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3093"/>
		<updated>2014-01-03T21:40:28Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Usage Example. A/D Demo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|InProgress(12.05.13-12:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of SOM-150ES carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC [http://www.emacinc.com/som/som150es.htm SOM-150ES] carrier board. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
[[File:know_your_som_150.jpg|frame|left|SOM-150ES carrier board with GPIO, LEDs and analog IO indicated.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a detail of the '''HDR1 PLD &amp;amp; BUFFERED GPIO''' header. Pin 49 is hot. The bottom pins: 2,4,6...46,48,50; are all ground. Port A is pins 1,3,5,7,9,11,13,15. Port B is pins 17,19,21,23,25,27,29,31. Port C is pins 33,35,37,39,41,43,45,47. &lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''-a'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: a&lt;br /&gt;
&lt;br /&gt;
A/D Demo&lt;br /&gt;
[0]=126 [1]=11B [2]=12C [3]=12B &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What you see there is lowish ambient signals (radio waves? spirits?) being picked up by the analog-in pins 11,12,13,14. &lt;br /&gt;
&lt;br /&gt;
This is the HDR8 ANALOG IO header.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board (LD1-LD8. see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;detail of board. gpio header closeup with ports b and c labelled&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.&lt;br /&gt;
&lt;br /&gt;
[[File:Io demo led action sample 2.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The board lights the LEDs in numeric sequence, 1-8, then repeats; looping until a key is pressed.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3092</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3092"/>
		<updated>2014-01-03T21:39:51Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Usage Example. A/D Demo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|InProgress(12.05.13-12:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of SOM-150ES carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC [http://www.emacinc.com/som/som150es.htm SOM-150ES] carrier board. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
[[File:know_your_som_150.jpg|frame|left|SOM-150ES carrier board with GPIO, LEDs and analog IO indicated.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a detail of the '''HDR1 PLD &amp;amp; BUFFERED GPIO''' header. Pin 49 is hot. The bottom pins: 2,4,6...46,48,50; are all ground. Port A is pins 1,3,5,7,9,11,13,15. Port B is pins 17,19,21,23,25,27,29,31. Port C is pins 33,35,37,39,41,43,45,47. &lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''-a'''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: a&lt;br /&gt;
&lt;br /&gt;
A/D Demo&lt;br /&gt;
[0]=126 [1]=11B [2]=12C [3]=12B &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What you see there is lowish ambient signals (radio waves? spirits?) being picked up by the analog-in pins 11,12,13,14. &lt;br /&gt;
&lt;br /&gt;
This is the HDR8 ANALOG IO header.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board (LD1-LD8. see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;detail of board. gpio header closeup with ports b and c labelled&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.&lt;br /&gt;
&lt;br /&gt;
[[File:Io demo led action sample 2.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The board lights the LEDs in numeric sequence, 1-8, then repeats; looping until a key is pressed.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=File:Know_your_som_150.jpg&amp;diff=3087</id>
		<title>File:Know your som 150.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=File:Know_your_som_150.jpg&amp;diff=3087"/>
		<updated>2014-01-03T20:04:26Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3086</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3086"/>
		<updated>2014-01-03T20:03:56Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Know Your Carrier Board */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|InProgress(12.05.13-12:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of SOM-150ES carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC [http://www.emacinc.com/som/som150es.htm SOM-150ES] carrier board. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
[[File:know_your_som_150.jpg|frame|left|SOM-150ES carrier board with GPIO, LEDs and analog IO indicated.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a detail of the '''HDR1 PLD &amp;amp; BUFFERED GPIO''' header. Pin 49 is hot. The bottom pins: 2,4,6...46,48,50; are all ground. Port A is pins 1,3,5,7,9,11,13,15. Port B is pins 17,19,21,23,25,27,29,31. Port C is pins 33,35,37,39,41,43,45,47. &lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''-a'''.&lt;br /&gt;
&lt;br /&gt;
did somebody say something about there already being an analog out built right onto the carrier board?&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board (LD1-LD8. see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;detail of board. gpio header closeup with ports b and c labelled&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.&lt;br /&gt;
&lt;br /&gt;
[[File:Io demo led action sample 2.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The board lights the LEDs in numeric sequence, 1-8, then repeats; looping until a key is pressed.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3083</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3083"/>
		<updated>2014-01-03T19:25:08Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Know Your Carrier Board */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|InProgress(12.05.13-12:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of SOM-150ES carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC [http://www.emacinc.com/som/som150es.htm SOM-150ES] carrier board. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
[[File:portABC_gpio_header_and_LEDs_location.jpg|frame|left|SOM-150ES carrier board with GPIO, LEDs and analog IO indicated.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a detail of the '''HDR1 PLD &amp;amp; BUFFERED GPIO''' header. Pin 49 is hot. The bottom pins: 2,4,6...46,48,50; are all ground. Port A is pins 1,3,5,7,9,11,13,15. Port B is pins 17,19,21,23,25,27,29,31. Port C is pins 33,35,37,39,41,43,45,47. &lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''-a'''.&lt;br /&gt;
&lt;br /&gt;
did somebody say something about there already being an analog out built right onto the carrier board?&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board (LD1-LD8. see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;detail of board. gpio header closeup with ports b and c labelled&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.&lt;br /&gt;
&lt;br /&gt;
[[File:Io demo led action sample 2.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The board lights the LEDs in numeric sequence, 1-8, then repeats; looping until a key is pressed.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3082</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3082"/>
		<updated>2014-01-03T19:24:44Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Know Your Carrier Board */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|InProgress(12.05.13-12:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of SOM-150ES carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC [http://www.emacinc.com/som/som150es.htm SOM-150ES] carrier board. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
[[File:portABC_gpio_header_and_LEDs_location.jpg|frame|left|SOM-150ES carrier board with GPIO, LEDs and analog IO indicated.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a detail of the HDR1 PLD &amp;amp; BUFFERED GPIO header. Pin 49 is hot. The bottom pins: 2,4,6...46,48,50; are all ground. Port A is pins 1,3,5,7,9,11,13,15. Port B is pins 17,19,21,23,25,27,29,31. Port C is pins 33,35,37,39,41,43,45,47. &lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''-a'''.&lt;br /&gt;
&lt;br /&gt;
did somebody say something about there already being an analog out built right onto the carrier board?&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board (LD1-LD8. see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;detail of board. gpio header closeup with ports b and c labelled&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.&lt;br /&gt;
&lt;br /&gt;
[[File:Io demo led action sample 2.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The board lights the LEDs in numeric sequence, 1-8, then repeats; looping until a key is pressed.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3081</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3081"/>
		<updated>2014-01-03T19:22:55Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Know Your Carrier Board */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|InProgress(12.05.13-12:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of SOM-150ES carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC [http://www.emacinc.com/som/som150es.htm SOM-150ES] carrier board. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
[[File:portABC_gpio_header_and_LEDs_location.jpg|frame|left|SOM-150ES carrier board with GPIO, LEDs and analog IO indicated.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a detail of the GPIO header. Pin 49 is hot. The bottom pins: 2,4,6...46,48,50; are all ground. Port A is pins 1,3,5,7,9,11,13,15. Port B is pins 17,19,21,23,25,27,29,31. Port C is pins 33,35,37,39,41,43,45,47. &lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''-a'''.&lt;br /&gt;
&lt;br /&gt;
did somebody say something about there already being an analog out built right onto the carrier board?&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board (LD1-LD8. see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;detail of board. gpio header closeup with ports b and c labelled&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.&lt;br /&gt;
&lt;br /&gt;
[[File:Io demo led action sample 2.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The board lights the LEDs in numeric sequence, 1-8, then repeats; looping until a key is pressed.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3080</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3080"/>
		<updated>2014-01-03T19:22:23Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Know Your Carrier Board */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|InProgress(12.05.13-12:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of SOM-150ES carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC [http://www.emacinc.com/som/som150es.htm SOM-150ES] carrier board. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
[[File:portABC_gpio_header_and_LEDs_location.jpg|frame|left|SOM-150ES carrier board with GPIO, LEDs and analog IO indicated.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a detail of the GPIO header. Pin 49 is hot. The bottom pins 2,4,6...46,48,50 are all ground. Port A is pins 1,3,5,7,9,11,13,15. Port B is pins 17,19,21,23,25,27,29,31. Port C is pins 33,35,37,39,41,43,45,47. &lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''-a'''.&lt;br /&gt;
&lt;br /&gt;
did somebody say something about there already being an analog out built right onto the carrier board?&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board (LD1-LD8. see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;detail of board. gpio header closeup with ports b and c labelled&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.&lt;br /&gt;
&lt;br /&gt;
[[File:Io demo led action sample 2.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The board lights the LEDs in numeric sequence, 1-8, then repeats; looping until a key is pressed.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3079</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3079"/>
		<updated>2014-01-03T19:19:00Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Know Your Carrier Board */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|InProgress(12.05.13-12:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of SOM-150ES carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC [http://www.emacinc.com/som/som150es.htm SOM-150ES] carrier board. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
[[File:portABC_gpio_header_and_LEDs_location.jpg|frame|left|SOM-150ES carrier board with GPIO, LEDs and analog IO indicated.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''-a'''.&lt;br /&gt;
&lt;br /&gt;
did somebody say something about there already being an analog out built right onto the carrier board?&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board (LD1-LD8. see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;detail of board. gpio header closeup with ports b and c labelled&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.&lt;br /&gt;
&lt;br /&gt;
[[File:Io demo led action sample 2.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The board lights the LEDs in numeric sequence, 1-8, then repeats; looping until a key is pressed.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3078</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3078"/>
		<updated>2014-01-03T19:16:13Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|InProgress(12.05.13-12:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of SOM-150ES carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC [http://www.emacinc.com/som/som150es.htm SOM-150ES] carrier board. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
'''TODO do this with just 1 board picture (and one or two diagrams). indicate GPIO, LEDs, analog IO'''&lt;br /&gt;
&lt;br /&gt;
'''HEY MIKE, I COULD HAVE PICTURES OF ALL THE CARRIER BOARDS WITH ALL THE RELEVANT STUFF LABELLED (WITH ARROWS ETC). WHAT DO YOU THINK?'''&lt;br /&gt;
&lt;br /&gt;
[[File:som150_with_SoM.jpg|frame|left|This is a SOM-150ES carrier board carrying a SoM]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:portABC_gpio_header_and_LEDs_location.jpg|frame|left|This is the SOM-150ES that we used for testing. Other carrier boards will have a similar layout.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''-a'''.&lt;br /&gt;
&lt;br /&gt;
did somebody say something about there already being an analog out built right onto the carrier board?&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board (LD1-LD8. see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;detail of board. gpio header closeup with ports b and c labelled&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.&lt;br /&gt;
&lt;br /&gt;
[[File:Io demo led action sample 2.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The board lights the LEDs in numeric sequence, 1-8, then repeats; looping until a key is pressed.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3077</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3077"/>
		<updated>2014-01-03T19:15:08Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Hardware Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|InProgress(12.05.13-12:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC [http://www.emacinc.com/som/som150es.htm SOM-150ES] carrier board. &amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
'''TODO do this with just 1 board picture (and one or two diagrams). indicate GPIO, LEDs, analog IO'''&lt;br /&gt;
&lt;br /&gt;
'''HEY MIKE, I COULD HAVE PICTURES OF ALL THE CARRIER BOARDS WITH ALL THE RELEVANT STUFF LABELLED (WITH ARROWS ETC). WHAT DO YOU THINK?'''&lt;br /&gt;
&lt;br /&gt;
[[File:som150_with_SoM.jpg|frame|left|This is a SOM-150ES carrier board carrying a SoM]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:portABC_gpio_header_and_LEDs_location.jpg|frame|left|This is the SOM-150ES that we used for testing. Other carrier boards will have a similar layout.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''-a'''.&lt;br /&gt;
&lt;br /&gt;
did somebody say something about there already being an analog out built right onto the carrier board?&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board (LD1-LD8. see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;detail of board. gpio header closeup with ports b and c labelled&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.&lt;br /&gt;
&lt;br /&gt;
[[File:Io demo led action sample 2.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The board lights the LEDs in numeric sequence, 1-8, then repeats; looping until a key is pressed.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3074</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3074"/>
		<updated>2014-01-03T19:10:52Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Usage Example. A/D Demo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|InProgress(12.05.13-12:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC carrier board: [http://www.emacinc.com/som/som150es.htm SOM-150ES], [http://www.emacinc.com/som/som200es.htm SOM-200ES], [http://www.emacinc.com/som/som210es.htm SOM-210ES], [http://www.emacinc.com/som/som212es.htm SOM-212ES] or [http://www.emacinc.com/som/som250es.htm SOM-250ES].&amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
'''TODO do this with just 1 board picture (and one or two diagrams). indicate GPIO, LEDs, analog IO'''&lt;br /&gt;
&lt;br /&gt;
'''HEY MIKE, I COULD HAVE PICTURES OF ALL THE CARRIER BOARDS WITH ALL THE RELEVANT STUFF LABELLED (WITH ARROWS ETC). WHAT DO YOU THINK?'''&lt;br /&gt;
&lt;br /&gt;
[[File:som150_with_SoM.jpg|frame|left|This is a SOM-150ES carrier board carrying a SoM]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:portABC_gpio_header_and_LEDs_location.jpg|frame|left|This is the SOM-150ES that we used for testing. Other carrier boards will have a similar layout.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''-a'''.&lt;br /&gt;
&lt;br /&gt;
did somebody say something about there already being an analog out built right onto the carrier board?&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board (LD1-LD8. see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;detail of board. gpio header closeup with ports b and c labelled&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.&lt;br /&gt;
&lt;br /&gt;
[[File:Io demo led action sample 2.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The board lights the LEDs in numeric sequence, 1-8, then repeats; looping until a key is pressed.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3071</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3071"/>
		<updated>2014-01-03T19:03:05Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Opening, Building and Uploading the Project Files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|InProgress(12.05.13-12:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC carrier board: [http://www.emacinc.com/som/som150es.htm SOM-150ES], [http://www.emacinc.com/som/som200es.htm SOM-200ES], [http://www.emacinc.com/som/som210es.htm SOM-210ES], [http://www.emacinc.com/som/som212es.htm SOM-212ES] or [http://www.emacinc.com/som/som250es.htm SOM-250ES].&amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
'''TODO do this with just 1 board picture (and one or two diagrams). indicate GPIO, LEDs, analog IO'''&lt;br /&gt;
&lt;br /&gt;
'''HEY MIKE, I COULD HAVE PICTURES OF ALL THE CARRIER BOARDS WITH ALL THE RELEVANT STUFF LABELLED (WITH ARROWS ETC). WHAT DO YOU THINK?'''&lt;br /&gt;
&lt;br /&gt;
[[File:som150_with_SoM.jpg|frame|left|This is a SOM-150ES carrier board carrying a SoM]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:portABC_gpio_header_and_LEDs_location.jpg|frame|left|This is the SOM-150ES that we used for testing. Other carrier boards will have a similar layout.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
did somebody say something about there already being an analog out built right onto the carrier board?&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board (LD1-LD8. see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;detail of board. gpio header closeup with ports b and c labelled&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.&lt;br /&gt;
&lt;br /&gt;
[[File:Io demo led action sample 2.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The board lights the LEDs in numeric sequence, 1-8, then repeats; looping until a key is pressed.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3070</id>
		<title>Example io demo</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_io_demo&amp;diff=3070"/>
		<updated>2014-01-03T19:02:46Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Opening, Building and Uploading the Project Files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|InProgress(12.05.13-12:47-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;io demo&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project provides four examples of carrier board IO:&amp;lt;br /&amp;gt;&lt;br /&gt;
* An analog-to-digital converter demo.&lt;br /&gt;
* A counter demo.    &lt;br /&gt;
* An input-to-output demo.&lt;br /&gt;
* A ring demo.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;io_demo&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;1. Open the C/C++ editing perspective.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
== Usage and Behaviour ==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
To use the '''io demo''' program you will need the following hardware.&lt;br /&gt;
&lt;br /&gt;
* An EMAC carrier board: [http://www.emacinc.com/som/som150es.htm SOM-150ES], [http://www.emacinc.com/som/som200es.htm SOM-200ES], [http://www.emacinc.com/som/som210es.htm SOM-210ES], [http://www.emacinc.com/som/som212es.htm SOM-212ES] or [http://www.emacinc.com/som/som250es.htm SOM-250ES].&amp;lt;br /&amp;gt;&lt;br /&gt;
* A compatible EMAC SoM for that carrier board ([http://www.emacinc.com/products/system_on_module/SoM-9260M SOM-9260M], [http://www.emacinc.com/products/system_on_module/som-9G20m SOM-9G20M] and [http://www.emacinc.com/products/system_on_module/som-9x25 SOM-9X25] are all compatible and available from EMAC).&amp;lt;br /&amp;gt;&lt;br /&gt;
* A multimeter or oscilloscope. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] and  [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Count_Demo Usage Example. Count Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
* A ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [http://wikidev.emacinc.com/wiki/Example_io_demo#Usage_Example._Input_to_Output_Demo Usage Example. Input to Output Demo] for details.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Know Your Carrier Board====&lt;br /&gt;
&lt;br /&gt;
'''TODO do this with just 1 board picture (and one or two diagrams). indicate GPIO, LEDs, analog IO'''&lt;br /&gt;
&lt;br /&gt;
'''HEY MIKE, I COULD HAVE PICTURES OF ALL THE CARRIER BOARDS WITH ALL THE RELEVANT STUFF LABELLED (WITH ARROWS ETC). WHAT DO YOU THINK?'''&lt;br /&gt;
&lt;br /&gt;
[[File:som150_with_SoM.jpg|frame|left|This is a SOM-150ES carrier board carrying a SoM]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:portABC_gpio_header_and_LEDs_location.jpg|frame|left|This is the SOM-150ES that we used for testing. Other carrier boards will have a similar layout.]]&lt;br /&gt;
&amp;lt;br clear=all&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:gpio_header_detail.png]]&lt;br /&gt;
&lt;br /&gt;
===Usage for io_demo===&lt;br /&gt;
&lt;br /&gt;
Run '''io demo''' from the console. It takes no parameters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ./io_demo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This brings up a menu of demos.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;console&amp;quot;&amp;gt;&lt;br /&gt;
****************************&lt;br /&gt;
     Demo Menu              &lt;br /&gt;
                            &lt;br /&gt;
A/D Demo             - a    &lt;br /&gt;
Count Demo           - c    &lt;br /&gt;
Input to Output Demo - i    &lt;br /&gt;
Ring Demo            - r    &lt;br /&gt;
                            &lt;br /&gt;
Exit                 - x    &lt;br /&gt;
                            &lt;br /&gt;
Enter Selection: &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can press '''a''', '''c''', '''i''' or '''r''' to run a demo; or '''x''' to exit.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. A/D Demo===&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
did somebody say something about there already being an analog out built right onto the carrier board?&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Count Demo===&lt;br /&gt;
&lt;br /&gt;
From the demo menu press '''c'''.&lt;br /&gt;
&lt;br /&gt;
The system counts from 0 to 255 in binary. It takes about 15 seconds to complete.&amp;lt;br /&amp;gt;&lt;br /&gt;
The steps of this process are reflected in the GPIO PortC header pins (see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). As each bit in our 8bit register is set to 1, the corresponding pin in the PortC header momentarily registers 5 volts (easily detected with a multimeter or oscilloscope).&lt;br /&gt;
&lt;br /&gt;
More visibly, the counting process is also reflected in the strip of 8 LEDs on the board (LD1-LD8. see [http://wikidev.emacinc.com/wiki/Example_io_demo#Know_Your_Carrier_Board Know Your Carrier Board], above). A lit LED indicates a 1 in our 8 bit register and an unlit LED indicates a 0. When the counting process is finished all 8 LEDs are lit (255).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Input to Output Demo===&lt;br /&gt;
&lt;br /&gt;
In this usage example the carrier board talks to itself. We send an 8bit data stream directly from Port B to Port C via a short piece of ribbon cable. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;detail of board. gpio header closeup with ports b and c labelled&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the ribbon cable that we made for our input-to-output demo. Note that we connect PortC:pin0 to PortB:pin0; PortC:pin1 to PortB:pin1; etc.&amp;lt;br /&amp;gt;&lt;br /&gt;
[[File:iodemo_homemaderibboncable.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Here's our cable plugged into the GPIO header. You see that PortC:pin0 outputs to PortB:pin0; PortC:pin1 outputs to PortB:pin1; etc.&lt;br /&gt;
[[File:iodemo_homemaderibboncable_closeup.jpg|500px|border|]]&lt;br /&gt;
&lt;br /&gt;
Our data stream for each pin is 1,0,1,0,1,0... That is to say: all pins are set to 1, then they are all set to 0, then to 1 again, etc. We observe our data stream in the strip of 8 LEDs on the carrier board. They blink in unison.&lt;br /&gt;
&lt;br /&gt;
'''Note''' The blinking may get a little out of synch after a few seconds. This is normal.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Ring Demo===&lt;br /&gt;
&lt;br /&gt;
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.&lt;br /&gt;
&lt;br /&gt;
[[File:Io demo led action sample 2.png | 500px]]&lt;br /&gt;
&lt;br /&gt;
The board lights the LEDs in numeric sequence, 1-8, then repeats; looping until a key is pressed.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3053</id>
		<title>Example socket</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3053"/>
		<updated>2014-01-03T18:37:47Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|Review(01.03.14-12:37-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
This application demonstrates how to set up sockets for host and client nodes on an ethernet network.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
==Usage and Behavior==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project will run just fine on any system for which it can be compiled.&lt;br /&gt;
&lt;br /&gt;
===Using &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
 ./socket -sc [ADDRESS] PORT&lt;br /&gt;
&lt;br /&gt;
;-s:Create a ''server'', specify the PORT to listen to.  &lt;br /&gt;
;-c:Create a ''client'', specify the server's ADDRESS and PORT.&lt;br /&gt;
&lt;br /&gt;
For our demonstration we create a ''server'' and a ''client''. Upon activation the server waits for a connection. Upon activation the client connects with the server. When the server detects the client's connection it sends a message to the client. Then the client sends that message right back to the server. The server compares the message it sent to the client with the message it just got from the client. If they match then we have performed a successful transmission.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. One machine===&lt;br /&gt;
&lt;br /&gt;
We're going to create a ''server'' and ''client'' on the same machine. The machine will talk to itself.&lt;br /&gt;
&lt;br /&gt;
Create the server&lt;br /&gt;
&lt;br /&gt;
'''Note''' We're using port ''9999''. It's arbitrarily chosen and assumed to be free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
Starting server&lt;br /&gt;
Making socket&lt;br /&gt;
Binding to port 9999opened socket as fd (3) on port (9999) for stream i/o&lt;br /&gt;
Server&lt;br /&gt;
			sin_family        = 2&lt;br /&gt;
			sin_addr.s_addr   = 0&lt;br /&gt;
			sin_port          = 9999&lt;br /&gt;
&lt;br /&gt;
Making a listen queue of 5 elements&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...and it's waiting for a connection. Note that you can't do anything else in this console because it's occupied with the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program. So open another console and, if necessary, log-on.&lt;br /&gt;
&lt;br /&gt;
Create the client.&lt;br /&gt;
&lt;br /&gt;
'''Note''' We're using port ''9999'', the same port for which the server is configured; and the localhost address: 127.0.0.1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -c 127.0.0.1 9999&lt;br /&gt;
&lt;br /&gt;
Making a socket&lt;br /&gt;
Connecting to 127.0.0.1 on port 9999&lt;br /&gt;
Received &amp;quot;Message from the socket server&amp;quot; from server&lt;br /&gt;
&lt;br /&gt;
Writing &amp;quot;Message from the socket server&amp;quot; to server&lt;br /&gt;
Closing socket&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is what happened: The server started up and waited for a connection. Then we started the client and it immediately connected to the server. The server noticed that connection and sent a message to the client: &amp;quot;Message from the socket server&amp;quot;. The client received the message and sent it right back to the server. The server compared the two messages to check the accuracy of the transmission. The messages matched so the transmission was successful.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Two machines===&lt;br /&gt;
&lt;br /&gt;
Get 2 machines. They can be ARM machines, PCs or whatever (in our example we're using a SoM9g20 and a SoM 9g45). We're going to refer to our machines as ''MACHINE0'' and ''MACHINE1''.&amp;lt;br \&amp;gt;&lt;br /&gt;
Compile and upload the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; executable to each of them.&amp;lt;br \&amp;gt;&lt;br /&gt;
Connect them both to the same ethernet network.&amp;lt;br \&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program.'''&lt;br /&gt;
 som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
Note that we specified '''-s''', thus configuring MACHINE0 as a server. ''9999'' is an arbitrarily chosen (and assumed to be free) port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
So now MACHINE0 has been configured as a server and it's waiting for a connection...&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program.'''&lt;br /&gt;
 som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
Note that we specified '''-c''', thus configuring MACHINE1 as a '''client'''. ''10.0.2.204'' is the host machine's address (this will need to be determined. Use ''minicom'' or something similar). ''9999'' is the port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
Starting server&lt;br /&gt;
Making socket&lt;br /&gt;
Binding to port 9999opened socket as fd (3) on port (9999) for stream i/o&lt;br /&gt;
Server&lt;br /&gt;
                        sin_family        = 2&lt;br /&gt;
                        sin_addr.s_addr   = 0&lt;br /&gt;
                        sin_port          = 9999&lt;br /&gt;
&lt;br /&gt;
Making a listen queue of 5 elements&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&lt;br /&gt;
Got a connection&lt;br /&gt;
Sending &amp;quot;Message from the socket server&amp;quot; to client&lt;br /&gt;
The messages match&lt;br /&gt;
Closing the socket&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
&lt;br /&gt;
Making a socket&lt;br /&gt;
Connecting to 10.0.2.204 on port 9999&lt;br /&gt;
Received &amp;quot;Message from the socket server&amp;quot; from server&lt;br /&gt;
&lt;br /&gt;
Writing &amp;quot;Message from the socket server&amp;quot; to server&lt;br /&gt;
Closing socket&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is what happened: MACHINE0 (the server) was configured as a server and waited for a connection. MACHINE1 (the client) connected to MACHINE0. MACHINE0 noticed the connection and sent a message to MACHINE1: &amp;quot;Message from the socket server&amp;quot;. MACHINE1 received the message and sent it right back. MACHINE0 compared the two messages to check the accuracy of the transmission. The messages matched so the transmission was successful.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project demonstrates how to set up host and client node sockets on an ethernet network.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3052</id>
		<title>Example socket</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3052"/>
		<updated>2014-01-03T18:36:24Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Usage Example. Two machines */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|Review(01.02.14-15:25-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
This application demonstrates how to set up sockets for host and client nodes on an ethernet network.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
==Usage and Behavior==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project will run just fine on any system for which it can be compiled.&lt;br /&gt;
&lt;br /&gt;
===Using &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
 ./socket -sc [ADDRESS] PORT&lt;br /&gt;
&lt;br /&gt;
;-s:Create a ''server'', specify the PORT to listen to.  &lt;br /&gt;
;-c:Create a ''client'', specify the server's ADDRESS and PORT.&lt;br /&gt;
&lt;br /&gt;
For our demonstration we create a ''server'' and a ''client''. Upon activation the server waits for a connection. Upon activation the client connects with the server. When the server detects the client's connection it sends a message to the client. Then the client sends that message right back to the server. The server compares the message it sent to the client with the message it just got from the client. If they match then we have performed a successful transmission.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. One machine===&lt;br /&gt;
&lt;br /&gt;
We're going to create a ''server'' and ''client'' on the same machine. The machine will talk to itself.&lt;br /&gt;
&lt;br /&gt;
Create the server&lt;br /&gt;
&lt;br /&gt;
'''Note''' We're using port ''9999''. It's arbitrarily chosen and assumed to be free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
Starting server&lt;br /&gt;
Making socket&lt;br /&gt;
Binding to port 9999opened socket as fd (3) on port (9999) for stream i/o&lt;br /&gt;
Server&lt;br /&gt;
			sin_family        = 2&lt;br /&gt;
			sin_addr.s_addr   = 0&lt;br /&gt;
			sin_port          = 9999&lt;br /&gt;
&lt;br /&gt;
Making a listen queue of 5 elements&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...and it's waiting for a connection. Note that you can't do anything else in this console because it's occupied with the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program. So open another console and, if necessary, log-on.&lt;br /&gt;
&lt;br /&gt;
Create the client.&lt;br /&gt;
&lt;br /&gt;
'''Note''' We're using port ''9999'', the same port for which the server is configured; and the localhost address: 127.0.0.1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -c 127.0.0.1 9999&lt;br /&gt;
&lt;br /&gt;
Making a socket&lt;br /&gt;
Connecting to 127.0.0.1 on port 9999&lt;br /&gt;
Received &amp;quot;Message from the socket server&amp;quot; from server&lt;br /&gt;
&lt;br /&gt;
Writing &amp;quot;Message from the socket server&amp;quot; to server&lt;br /&gt;
Closing socket&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is what happened: The server started up and waited for a connection. Then we started the client and it immediately connected to the server. The server noticed that connection and sent a message to the client: &amp;quot;Message from the socket server&amp;quot;. The client received the message and sent it right back to the server. The server compared the two messages to check the accuracy of the transmission. The messages matched so the transmission was successful.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Two machines===&lt;br /&gt;
&lt;br /&gt;
Get 2 machines. They can be ARM machines, PCs or whatever (in our example we're using a SoM9g20 and a SoM 9g45). We're going to refer to our machines as ''MACHINE0'' and ''MACHINE1''.&amp;lt;br \&amp;gt;&lt;br /&gt;
Compile and upload the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; executable to each of them.&amp;lt;br \&amp;gt;&lt;br /&gt;
Connect them both to the same ethernet network.&amp;lt;br \&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program.'''&lt;br /&gt;
 som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
Note that we specified '''-s''', thus configuring MACHINE0 as a server. ''9999'' is an arbitrarily chosen (and assumed to be free) port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
So now MACHINE0 has been configured as a server and it's waiting for a connection...&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program.'''&lt;br /&gt;
 som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
Note that we specified '''-c''', thus configuring MACHINE1 as a '''client'''. ''10.0.2.204'' is the host machine's address (this will need to be determined. Use ''minicom'' or something similar). ''9999'' is the port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
Starting server&lt;br /&gt;
Making socket&lt;br /&gt;
Binding to port 9999opened socket as fd (3) on port (9999) for stream i/o&lt;br /&gt;
Server&lt;br /&gt;
                        sin_family        = 2&lt;br /&gt;
                        sin_addr.s_addr   = 0&lt;br /&gt;
                        sin_port          = 9999&lt;br /&gt;
&lt;br /&gt;
Making a listen queue of 5 elements&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&lt;br /&gt;
Got a connection&lt;br /&gt;
Sending &amp;quot;Message from the socket server&amp;quot; to client&lt;br /&gt;
The messages match&lt;br /&gt;
Closing the socket&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
&lt;br /&gt;
Making a socket&lt;br /&gt;
Connecting to 10.0.2.204 on port 9999&lt;br /&gt;
Received &amp;quot;Message from the socket server&amp;quot; from server&lt;br /&gt;
&lt;br /&gt;
Writing &amp;quot;Message from the socket server&amp;quot; to server&lt;br /&gt;
Closing socket&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is what happened: MACHINE0 (the server) was configured as a server and waited for a connection. MACHINE1 (the client) connected to MACHINE0. MACHINE0 noticed the connection and sent a message to MACHINE1: &amp;quot;Message from the socket server&amp;quot;. MACHINE1 received the message and sent it right back. MACHINE0 compared the two messages to check the accuracy of the transmission. The messages matched so the transmission was successful.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project demonstrates how to set up host and client node sockets on an ethernet network.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3049</id>
		<title>Example socket</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3049"/>
		<updated>2014-01-03T18:34:15Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Usage Example. One machine */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|Review(01.02.14-15:25-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
This application demonstrates how to set up sockets for host and client nodes on an ethernet network.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
==Usage and Behavior==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project will run just fine on any system for which it can be compiled.&lt;br /&gt;
&lt;br /&gt;
===Using &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
 ./socket -sc [ADDRESS] PORT&lt;br /&gt;
&lt;br /&gt;
;-s:Create a ''server'', specify the PORT to listen to.  &lt;br /&gt;
;-c:Create a ''client'', specify the server's ADDRESS and PORT.&lt;br /&gt;
&lt;br /&gt;
For our demonstration we create a ''server'' and a ''client''. Upon activation the server waits for a connection. Upon activation the client connects with the server. When the server detects the client's connection it sends a message to the client. Then the client sends that message right back to the server. The server compares the message it sent to the client with the message it just got from the client. If they match then we have performed a successful transmission.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. One machine===&lt;br /&gt;
&lt;br /&gt;
We're going to create a ''server'' and ''client'' on the same machine. The machine will talk to itself.&lt;br /&gt;
&lt;br /&gt;
Create the server&lt;br /&gt;
&lt;br /&gt;
'''Note''' We're using port ''9999''. It's arbitrarily chosen and assumed to be free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
Starting server&lt;br /&gt;
Making socket&lt;br /&gt;
Binding to port 9999opened socket as fd (3) on port (9999) for stream i/o&lt;br /&gt;
Server&lt;br /&gt;
			sin_family        = 2&lt;br /&gt;
			sin_addr.s_addr   = 0&lt;br /&gt;
			sin_port          = 9999&lt;br /&gt;
&lt;br /&gt;
Making a listen queue of 5 elements&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...and it's waiting for a connection. Note that you can't do anything else in this console because it's occupied with the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program. So open another console and, if necessary, log-on.&lt;br /&gt;
&lt;br /&gt;
Create the client.&lt;br /&gt;
&lt;br /&gt;
'''Note''' We're using port ''9999'', the same port for which the server is configured; and the localhost address: 127.0.0.1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -c 127.0.0.1 9999&lt;br /&gt;
&lt;br /&gt;
Making a socket&lt;br /&gt;
Connecting to 127.0.0.1 on port 9999&lt;br /&gt;
Received &amp;quot;Message from the socket server&amp;quot; from server&lt;br /&gt;
&lt;br /&gt;
Writing &amp;quot;Message from the socket server&amp;quot; to server&lt;br /&gt;
Closing socket&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is what happened: The server started up and waited for a connection. Then we started the client and it immediately connected to the server. The server noticed that connection and sent a message to the client: &amp;quot;Message from the socket server&amp;quot;. The client received the message and sent it right back to the server. The server compared the two messages to check the accuracy of the transmission. The messages matched so the transmission was successful.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Two machines===&lt;br /&gt;
&lt;br /&gt;
Get 2 machines. They can be ARM machines, PCs or whatever. We're going to refer to our machines as ''MACHINE0'' and ''MACHINE1''.&amp;lt;br \&amp;gt;&lt;br /&gt;
Compile and upload the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; executable to each of them.&amp;lt;br \&amp;gt;&lt;br /&gt;
Connect them both to the same ethernet network.&amp;lt;br \&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program.'''&lt;br /&gt;
 som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
Note that we specified '''-s''', thus configuring MACHINE0 as a server. ''9999'' is an arbitrarily chosen (and assumed to be free) port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
So now MACHINE0 has been configured as a server and it's waiting for a connection...&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program.'''&lt;br /&gt;
 som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
Note that we specified '''-c''', thus configuring MACHINE1 as a '''client'''. ''10.0.2.204'' is the host machine's address (this will need to be determined. Use ''minicom'' or something similar). ''9999'' is the port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
Starting server&lt;br /&gt;
Making socket&lt;br /&gt;
Binding to port 9999opened socket as fd (3) on port (9999) for stream i/o&lt;br /&gt;
Server&lt;br /&gt;
                        sin_family        = 2&lt;br /&gt;
                        sin_addr.s_addr   = 0&lt;br /&gt;
                        sin_port          = 9999&lt;br /&gt;
&lt;br /&gt;
Making a listen queue of 5 elements&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&lt;br /&gt;
Got a connection&lt;br /&gt;
Sending &amp;quot;Message from the socket server&amp;quot; to client&lt;br /&gt;
The messages match&lt;br /&gt;
Closing the socket&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
&lt;br /&gt;
Making a socket&lt;br /&gt;
Connecting to 10.0.2.204 on port 9999&lt;br /&gt;
Received &amp;quot;Message from the socket server&amp;quot; from server&lt;br /&gt;
&lt;br /&gt;
Writing &amp;quot;Message from the socket server&amp;quot; to server&lt;br /&gt;
Closing socket&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is what happened: MACHINE0 (the server) was configured as a server and waited for a connection. MACHINE1 (the client) connected to MACHINE0. MACHINE0 noticed the connection and sent a message to MACHINE1: &amp;quot;Message from the socket server&amp;quot;. MACHINE1 received the message and sent it right back. MACHINE0 compared the two messages to check the accuracy of the transmission. The messages matched so the transmission was successful.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project demonstrates how to set up host and client node sockets on an ethernet network.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3044</id>
		<title>Example socket</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3044"/>
		<updated>2014-01-03T18:30:47Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Usage Example. Two machines */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|Review(01.02.14-15:25-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
This application demonstrates how to set up sockets for host and client nodes on an ethernet network.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
==Usage and Behavior==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project will run just fine on any system for which it can be compiled.&lt;br /&gt;
&lt;br /&gt;
===Using &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
 ./socket -sc [ADDRESS] PORT&lt;br /&gt;
&lt;br /&gt;
;-s:Create a ''server'', specify the PORT to listen to.  &lt;br /&gt;
;-c:Create a ''client'', specify the server's ADDRESS and PORT.&lt;br /&gt;
&lt;br /&gt;
For our demonstration we create a ''server'' and a ''client''. Upon activation the server waits for a connection. Upon activation the client connects with the server. When the server detects the client's connection it sends a message to the client. Then the client sends that message right back to the server. The server compares the message it sent to the client with the message it just got from the client. If they match then we have performed a successful transmission.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. One machine===&lt;br /&gt;
&lt;br /&gt;
We're going to create a ''server'' and ''client'' on the same machine. The machine will talk to itself.&lt;br /&gt;
&lt;br /&gt;
Create the server&lt;br /&gt;
&lt;br /&gt;
'''Note''' We're using port ''9999''. It's arbitrarily chosen and assumed to be free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
Starting server&lt;br /&gt;
Making socket&lt;br /&gt;
Binding to port 9999opened socket as fd (3) on port (9999) for stream i/o&lt;br /&gt;
Server&lt;br /&gt;
			sin_family        = 2&lt;br /&gt;
			sin_addr.s_addr   = 0&lt;br /&gt;
			sin_port          = 9999&lt;br /&gt;
&lt;br /&gt;
Making a listen queue of 5 elements&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...and it's waiting for a connection. Note that you can't do anything else in this console because it's occupied with the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program. So open another console and, if necessary, log-on.&lt;br /&gt;
&lt;br /&gt;
Create the client.&lt;br /&gt;
&lt;br /&gt;
'''Note''' We're using port ''9999'', the same port for which the server is configured; and the localhost address: 127.0.0.1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -c 127.0.0.1 9999&lt;br /&gt;
&lt;br /&gt;
Making a socket&lt;br /&gt;
Connecting to 127.0.0.1 on port 9999&lt;br /&gt;
Received &amp;quot;Message from the socket server&amp;quot; from server&lt;br /&gt;
&lt;br /&gt;
Writing &amp;quot;Message from the socket server&amp;quot; to server&lt;br /&gt;
Closing socket&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Two machines===&lt;br /&gt;
&lt;br /&gt;
Get 2 machines. They can be ARM machines, PCs or whatever. We're going to refer to our machines as ''MACHINE0'' and ''MACHINE1''.&amp;lt;br \&amp;gt;&lt;br /&gt;
Compile and upload the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; executable to each of them.&amp;lt;br \&amp;gt;&lt;br /&gt;
Connect them both to the same ethernet network.&amp;lt;br \&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program.'''&lt;br /&gt;
 som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
Note that we specified '''-s''', thus configuring MACHINE0 as a server. ''9999'' is an arbitrarily chosen (and assumed to be free) port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
So now MACHINE0 has been configured as a server and it's waiting for a connection...&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program.'''&lt;br /&gt;
 som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
Note that we specified '''-c''', thus configuring MACHINE1 as a '''client'''. ''10.0.2.204'' is the host machine's address (this will need to be determined. Use ''minicom'' or something similar). ''9999'' is the port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
Starting server&lt;br /&gt;
Making socket&lt;br /&gt;
Binding to port 9999opened socket as fd (3) on port (9999) for stream i/o&lt;br /&gt;
Server&lt;br /&gt;
                        sin_family        = 2&lt;br /&gt;
                        sin_addr.s_addr   = 0&lt;br /&gt;
                        sin_port          = 9999&lt;br /&gt;
&lt;br /&gt;
Making a listen queue of 5 elements&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&lt;br /&gt;
Got a connection&lt;br /&gt;
Sending &amp;quot;Message from the socket server&amp;quot; to client&lt;br /&gt;
The messages match&lt;br /&gt;
Closing the socket&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
&lt;br /&gt;
Making a socket&lt;br /&gt;
Connecting to 10.0.2.204 on port 9999&lt;br /&gt;
Received &amp;quot;Message from the socket server&amp;quot; from server&lt;br /&gt;
&lt;br /&gt;
Writing &amp;quot;Message from the socket server&amp;quot; to server&lt;br /&gt;
Closing socket&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is what happened: MACHINE0 (the server) was configured as a server and waited for a connection. MACHINE1 (the client) connected to MACHINE0. MACHINE0 noticed the connection and sent a message to MACHINE1: &amp;quot;Message from the socket server&amp;quot;. MACHINE1 received the message and sent it right back. MACHINE0 compared the two messages to check the accuracy of the transmission. The messages matched so the transmission was successful.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project demonstrates how to set up host and client node sockets on an ethernet network.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3042</id>
		<title>Example socket</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3042"/>
		<updated>2014-01-03T18:29:15Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Usage Example. One Machine */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|Review(01.02.14-15:25-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
This application demonstrates how to set up sockets for host and client nodes on an ethernet network.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
==Usage and Behavior==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project will run just fine on any system for which it can be compiled.&lt;br /&gt;
&lt;br /&gt;
===Using &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
 ./socket -sc [ADDRESS] PORT&lt;br /&gt;
&lt;br /&gt;
;-s:Create a ''server'', specify the PORT to listen to.  &lt;br /&gt;
;-c:Create a ''client'', specify the server's ADDRESS and PORT.&lt;br /&gt;
&lt;br /&gt;
For our demonstration we create a ''server'' and a ''client''. Upon activation the server waits for a connection. Upon activation the client connects with the server. When the server detects the client's connection it sends a message to the client. Then the client sends that message right back to the server. The server compares the message it sent to the client with the message it just got from the client. If they match then we have performed a successful transmission.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. One machine===&lt;br /&gt;
&lt;br /&gt;
We're going to create a ''server'' and ''client'' on the same machine. The machine will talk to itself.&lt;br /&gt;
&lt;br /&gt;
Create the server&lt;br /&gt;
&lt;br /&gt;
'''Note''' We're using port ''9999''. It's arbitrarily chosen and assumed to be free.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
Starting server&lt;br /&gt;
Making socket&lt;br /&gt;
Binding to port 9999opened socket as fd (3) on port (9999) for stream i/o&lt;br /&gt;
Server&lt;br /&gt;
			sin_family        = 2&lt;br /&gt;
			sin_addr.s_addr   = 0&lt;br /&gt;
			sin_port          = 9999&lt;br /&gt;
&lt;br /&gt;
Making a listen queue of 5 elements&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...and it's waiting for a connection. Note that you can't do anything else in this console because it's occupied with the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program. So open another console and, if necessary, log-on.&lt;br /&gt;
&lt;br /&gt;
Create the client.&lt;br /&gt;
&lt;br /&gt;
'''Note''' We're using port ''9999'', the same port for which the server is configured; and the localhost address: 127.0.0.1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -c 127.0.0.1 9999&lt;br /&gt;
&lt;br /&gt;
Making a socket&lt;br /&gt;
Connecting to 127.0.0.1 on port 9999&lt;br /&gt;
Received &amp;quot;Message from the socket server&amp;quot; from server&lt;br /&gt;
&lt;br /&gt;
Writing &amp;quot;Message from the socket server&amp;quot; to server&lt;br /&gt;
Closing socket&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Two machines===&lt;br /&gt;
&lt;br /&gt;
Get 2 machines. We're going to refer to our machines as ''MACHINE0'' and ''MACHINE1''.&amp;lt;br \&amp;gt;&lt;br /&gt;
Compile and upload the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; executable to each of them.&amp;lt;br \&amp;gt;&lt;br /&gt;
Connect them both to the same ethernet network.&amp;lt;br \&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program.'''&lt;br /&gt;
 som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
Note that we specified '''-s''', thus configuring MACHINE0 as a server. ''9999'' is an arbitrarily chosen (and assumed to be free) port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
So now MACHINE0 has been configured as a server and it's waiting for a connection...&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program.'''&lt;br /&gt;
 som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
Note that we specified '''-c''', thus configuring MACHINE1 as a '''client'''. ''10.0.2.204'' is the host machine's address (this will need to be determined. Use ''minicom'' or something similar). ''9999'' is the port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
Starting server&lt;br /&gt;
Making socket&lt;br /&gt;
Binding to port 9999opened socket as fd (3) on port (9999) for stream i/o&lt;br /&gt;
Server&lt;br /&gt;
                        sin_family        = 2&lt;br /&gt;
                        sin_addr.s_addr   = 0&lt;br /&gt;
                        sin_port          = 9999&lt;br /&gt;
&lt;br /&gt;
Making a listen queue of 5 elements&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&lt;br /&gt;
Got a connection&lt;br /&gt;
Sending &amp;quot;Message from the socket server&amp;quot; to client&lt;br /&gt;
The messages match&lt;br /&gt;
Closing the socket&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
&lt;br /&gt;
Making a socket&lt;br /&gt;
Connecting to 10.0.2.204 on port 9999&lt;br /&gt;
Received &amp;quot;Message from the socket server&amp;quot; from server&lt;br /&gt;
&lt;br /&gt;
Writing &amp;quot;Message from the socket server&amp;quot; to server&lt;br /&gt;
Closing socket&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is what happened: MACHINE0 (the server) was configured as a server and waited for a connection. MACHINE1 (the client) connected to MACHINE0. MACHINE0 noticed the connection and sent a message to MACHINE1: &amp;quot;Message from the socket server&amp;quot;. MACHINE1 received the message and sent it right back. MACHINE0 compared the two messages to check the accuracy of the transmission. The messages matched so the transmission was successful.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project demonstrates how to set up host and client node sockets on an ethernet network.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3040</id>
		<title>Example socket</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3040"/>
		<updated>2014-01-03T18:24:21Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Usage Example. One Machine */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|Review(01.02.14-15:25-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
This application demonstrates how to set up sockets for host and client nodes on an ethernet network.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
==Usage and Behavior==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project will run just fine on any system for which it can be compiled.&lt;br /&gt;
&lt;br /&gt;
===Using &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
 ./socket -sc [ADDRESS] PORT&lt;br /&gt;
&lt;br /&gt;
;-s:Create a ''server'', specify the PORT to listen to.  &lt;br /&gt;
;-c:Create a ''client'', specify the server's ADDRESS and PORT.&lt;br /&gt;
&lt;br /&gt;
For our demonstration we create a ''server'' and a ''client''. Upon activation the server waits for a connection. Upon activation the client connects with the server. When the server detects the client's connection it sends a message to the client. Then the client sends that message right back to the server. The server compares the message it sent to the client with the message it just got from the client. If they match then we have performed a successful transmission.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. One Machine===&lt;br /&gt;
&lt;br /&gt;
We're going to create a ''server'' and ''client'' on the same machine. The machine will talk to itself.&lt;br /&gt;
&lt;br /&gt;
Create the server (given ''9999'', an arbitrarily chosen and assumed to be free port address)...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
Starting server&lt;br /&gt;
Making socket&lt;br /&gt;
Binding to port 9999opened socket as fd (3) on port (9999) for stream i/o&lt;br /&gt;
Server&lt;br /&gt;
			sin_family        = 2&lt;br /&gt;
			sin_addr.s_addr   = 0&lt;br /&gt;
			sin_port          = 9999&lt;br /&gt;
&lt;br /&gt;
Making a listen queue of 5 elements&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...and it's waiting for a connection. Note that you can't do anything else in this console because it's occupied with the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program. So open another console and, if necessary, log-on.&lt;br /&gt;
&lt;br /&gt;
Create the client.&lt;br /&gt;
&lt;br /&gt;
 som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Two machines===&lt;br /&gt;
&lt;br /&gt;
Get 2 machines. We're going to refer to our machines as ''MACHINE0'' and ''MACHINE1''.&amp;lt;br \&amp;gt;&lt;br /&gt;
Compile and upload the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; executable to each of them.&amp;lt;br \&amp;gt;&lt;br /&gt;
Connect them both to the same ethernet network.&amp;lt;br \&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program.'''&lt;br /&gt;
 som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
Note that we specified '''-s''', thus configuring MACHINE0 as a server. ''9999'' is an arbitrarily chosen (and assumed to be free) port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
So now MACHINE0 has been configured as a server and it's waiting for a connection...&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program.'''&lt;br /&gt;
 som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
Note that we specified '''-c''', thus configuring MACHINE1 as a '''client'''. ''10.0.2.204'' is the host machine's address (this will need to be determined. Use ''minicom'' or something similar). ''9999'' is the port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
Starting server&lt;br /&gt;
Making socket&lt;br /&gt;
Binding to port 9999opened socket as fd (3) on port (9999) for stream i/o&lt;br /&gt;
Server&lt;br /&gt;
                        sin_family        = 2&lt;br /&gt;
                        sin_addr.s_addr   = 0&lt;br /&gt;
                        sin_port          = 9999&lt;br /&gt;
&lt;br /&gt;
Making a listen queue of 5 elements&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&lt;br /&gt;
Got a connection&lt;br /&gt;
Sending &amp;quot;Message from the socket server&amp;quot; to client&lt;br /&gt;
The messages match&lt;br /&gt;
Closing the socket&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
&lt;br /&gt;
Making a socket&lt;br /&gt;
Connecting to 10.0.2.204 on port 9999&lt;br /&gt;
Received &amp;quot;Message from the socket server&amp;quot; from server&lt;br /&gt;
&lt;br /&gt;
Writing &amp;quot;Message from the socket server&amp;quot; to server&lt;br /&gt;
Closing socket&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is what happened: MACHINE0 (the server) was configured as a server and waited for a connection. MACHINE1 (the client) connected to MACHINE0. MACHINE0 noticed the connection and sent a message to MACHINE1: &amp;quot;Message from the socket server&amp;quot;. MACHINE1 received the message and sent it right back. MACHINE0 compared the two messages to check the accuracy of the transmission. The messages matched so the transmission was successful.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project demonstrates how to set up host and client node sockets on an ethernet network.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3038</id>
		<title>Example socket</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3038"/>
		<updated>2014-01-03T18:22:30Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Usage Example. One Machine */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|Review(01.02.14-15:25-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
This application demonstrates how to set up sockets for host and client nodes on an ethernet network.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
==Usage and Behavior==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project will run just fine on any system for which it can be compiled.&lt;br /&gt;
&lt;br /&gt;
===Using &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
 ./socket -sc [ADDRESS] PORT&lt;br /&gt;
&lt;br /&gt;
;-s:Create a ''server'', specify the PORT to listen to.  &lt;br /&gt;
;-c:Create a ''client'', specify the server's ADDRESS and PORT.&lt;br /&gt;
&lt;br /&gt;
For our demonstration we create a ''server'' and a ''client''. Upon activation the server waits for a connection. Upon activation the client connects with the server. When the server detects the client's connection it sends a message to the client. Then the client sends that message right back to the server. The server compares the message it sent to the client with the message it just got from the client. If they match then we have performed a successful transmission.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. One Machine===&lt;br /&gt;
&lt;br /&gt;
We're going to create a ''server'' and ''client'' on the same machine. The machine will talk to itself.&lt;br /&gt;
&lt;br /&gt;
Create the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
Starting server&lt;br /&gt;
Making socket&lt;br /&gt;
Binding to port 9999opened socket as fd (3) on port (9999) for stream i/o&lt;br /&gt;
Server&lt;br /&gt;
			sin_family        = 2&lt;br /&gt;
			sin_addr.s_addr   = 0&lt;br /&gt;
			sin_port          = 9999&lt;br /&gt;
&lt;br /&gt;
Making a listen queue of 5 elements&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...and it's waiting for a connection. Note that you can't do anything else in this console because it's occupied with the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program. So open another console and, if necessary, log-on.&lt;br /&gt;
&lt;br /&gt;
'''-s''' means that this instance of &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; is configured as a server. ''9999'' is an arbitrarily chosen (and assumed to be free) port address.&lt;br /&gt;
&lt;br /&gt;
Create the client.&lt;br /&gt;
&lt;br /&gt;
 som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Two machines===&lt;br /&gt;
&lt;br /&gt;
Get 2 machines. We're going to refer to our machines as ''MACHINE0'' and ''MACHINE1''.&amp;lt;br \&amp;gt;&lt;br /&gt;
Compile and upload the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; executable to each of them.&amp;lt;br \&amp;gt;&lt;br /&gt;
Connect them both to the same ethernet network.&amp;lt;br \&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program.'''&lt;br /&gt;
 som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
Note that we specified '''-s''', thus configuring MACHINE0 as a server. ''9999'' is an arbitrarily chosen (and assumed to be free) port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
So now MACHINE0 has been configured as a server and it's waiting for a connection...&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program.'''&lt;br /&gt;
 som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
Note that we specified '''-c''', thus configuring MACHINE1 as a '''client'''. ''10.0.2.204'' is the host machine's address (this will need to be determined. Use ''minicom'' or something similar). ''9999'' is the port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
Starting server&lt;br /&gt;
Making socket&lt;br /&gt;
Binding to port 9999opened socket as fd (3) on port (9999) for stream i/o&lt;br /&gt;
Server&lt;br /&gt;
                        sin_family        = 2&lt;br /&gt;
                        sin_addr.s_addr   = 0&lt;br /&gt;
                        sin_port          = 9999&lt;br /&gt;
&lt;br /&gt;
Making a listen queue of 5 elements&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&lt;br /&gt;
Got a connection&lt;br /&gt;
Sending &amp;quot;Message from the socket server&amp;quot; to client&lt;br /&gt;
The messages match&lt;br /&gt;
Closing the socket&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
&lt;br /&gt;
Making a socket&lt;br /&gt;
Connecting to 10.0.2.204 on port 9999&lt;br /&gt;
Received &amp;quot;Message from the socket server&amp;quot; from server&lt;br /&gt;
&lt;br /&gt;
Writing &amp;quot;Message from the socket server&amp;quot; to server&lt;br /&gt;
Closing socket&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is what happened: MACHINE0 (the server) was configured as a server and waited for a connection. MACHINE1 (the client) connected to MACHINE0. MACHINE0 noticed the connection and sent a message to MACHINE1: &amp;quot;Message from the socket server&amp;quot;. MACHINE1 received the message and sent it right back. MACHINE0 compared the two messages to check the accuracy of the transmission. The messages matched so the transmission was successful.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project demonstrates how to set up host and client node sockets on an ethernet network.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3033</id>
		<title>Example socket</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3033"/>
		<updated>2014-01-03T18:04:52Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Opening, Building and Uploading the Project Files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|Review(01.02.14-15:25-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
This application demonstrates how to set up sockets for host and client nodes on an ethernet network.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
==Usage and Behavior==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project will run just fine on any system for which it can be compiled.&lt;br /&gt;
&lt;br /&gt;
===Using &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
 ./socket -sc [ADDRESS] PORT&lt;br /&gt;
&lt;br /&gt;
;-s:Create a ''server'', specify the PORT to listen to.  &lt;br /&gt;
;-c:Create a ''client'', specify the server's ADDRESS and PORT.&lt;br /&gt;
&lt;br /&gt;
For our demonstration we create a ''server'' and a ''client''. Upon activation the server waits for a connection. Upon activation the client connects with the server. When the server detects the client's connection it sends a message to the client. Then the client sends that message right back to the server. The server compares the message it sent to the client with the message it just got from the client. If they match then we have performed a successful transmission.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. One Machine===&lt;br /&gt;
&lt;br /&gt;
We're going to create a ''server'' and ''client'' on the same machine. The machine will talk to itself.&lt;br /&gt;
&lt;br /&gt;
Create the server:&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Two machines===&lt;br /&gt;
&lt;br /&gt;
Get 2 machines. We're going to refer to our machines as ''MACHINE0'' and ''MACHINE1''.&amp;lt;br \&amp;gt;&lt;br /&gt;
Compile and upload the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; executable to each of them.&amp;lt;br \&amp;gt;&lt;br /&gt;
Connect them both to the same ethernet network.&amp;lt;br \&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program.'''&lt;br /&gt;
 som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
Note that we specified '''-s''', thus configuring MACHINE0 as a server. ''9999'' is an arbitrarily chosen (and assumed to be free) port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
So now MACHINE0 has been configured as a server and it's waiting for a connection...&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program.'''&lt;br /&gt;
 som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
Note that we specified '''-c''', thus configuring MACHINE1 as a '''client'''. ''10.0.2.204'' is the host machine's address (this will need to be determined. Use ''minicom'' or something similar). ''9999'' is the port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
Starting server&lt;br /&gt;
Making socket&lt;br /&gt;
Binding to port 9999opened socket as fd (3) on port (9999) for stream i/o&lt;br /&gt;
Server&lt;br /&gt;
                        sin_family        = 2&lt;br /&gt;
                        sin_addr.s_addr   = 0&lt;br /&gt;
                        sin_port          = 9999&lt;br /&gt;
&lt;br /&gt;
Making a listen queue of 5 elements&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&lt;br /&gt;
Got a connection&lt;br /&gt;
Sending &amp;quot;Message from the socket server&amp;quot; to client&lt;br /&gt;
The messages match&lt;br /&gt;
Closing the socket&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
&lt;br /&gt;
Making a socket&lt;br /&gt;
Connecting to 10.0.2.204 on port 9999&lt;br /&gt;
Received &amp;quot;Message from the socket server&amp;quot; from server&lt;br /&gt;
&lt;br /&gt;
Writing &amp;quot;Message from the socket server&amp;quot; to server&lt;br /&gt;
Closing socket&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is what happened: MACHINE0 (the server) was configured as a server and waited for a connection. MACHINE1 (the client) connected to MACHINE0. MACHINE0 noticed the connection and sent a message to MACHINE1: &amp;quot;Message from the socket server&amp;quot;. MACHINE1 received the message and sent it right back. MACHINE0 compared the two messages to check the accuracy of the transmission. The messages matched so the transmission was successful.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project demonstrates how to set up host and client node sockets on an ethernet network.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3032</id>
		<title>Example socket</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3032"/>
		<updated>2014-01-03T18:03:14Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Usage Example. Two machines */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|Review(01.02.14-15:25-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
This application demonstrates how to set up sockets for host and client nodes on an ethernet network.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;1. Open the C/C++ editing perspective.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;2. Open the project files.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;3. Build the project.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;4. Upload the executables to the target system.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
==Usage and Behavior==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project will run just fine on any system for which it can be compiled.&lt;br /&gt;
&lt;br /&gt;
===Using &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
 ./socket -sc [ADDRESS] PORT&lt;br /&gt;
&lt;br /&gt;
;-s:Create a ''server'', specify the PORT to listen to.  &lt;br /&gt;
;-c:Create a ''client'', specify the server's ADDRESS and PORT.&lt;br /&gt;
&lt;br /&gt;
For our demonstration we create a ''server'' and a ''client''. Upon activation the server waits for a connection. Upon activation the client connects with the server. When the server detects the client's connection it sends a message to the client. Then the client sends that message right back to the server. The server compares the message it sent to the client with the message it just got from the client. If they match then we have performed a successful transmission.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. One Machine===&lt;br /&gt;
&lt;br /&gt;
We're going to create a ''server'' and ''client'' on the same machine. The machine will talk to itself.&lt;br /&gt;
&lt;br /&gt;
Create the server:&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Two machines===&lt;br /&gt;
&lt;br /&gt;
Get 2 machines. We're going to refer to our machines as ''MACHINE0'' and ''MACHINE1''.&amp;lt;br \&amp;gt;&lt;br /&gt;
Compile and upload the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; executable to each of them.&amp;lt;br \&amp;gt;&lt;br /&gt;
Connect them both to the same ethernet network.&amp;lt;br \&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program.'''&lt;br /&gt;
 som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
Note that we specified '''-s''', thus configuring MACHINE0 as a server. ''9999'' is an arbitrarily chosen (and assumed to be free) port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
So now MACHINE0 has been configured as a server and it's waiting for a connection...&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program.'''&lt;br /&gt;
 som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
Note that we specified '''-c''', thus configuring MACHINE1 as a '''client'''. ''10.0.2.204'' is the host machine's address (this will need to be determined. Use ''minicom'' or something similar). ''9999'' is the port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
Starting server&lt;br /&gt;
Making socket&lt;br /&gt;
Binding to port 9999opened socket as fd (3) on port (9999) for stream i/o&lt;br /&gt;
Server&lt;br /&gt;
                        sin_family        = 2&lt;br /&gt;
                        sin_addr.s_addr   = 0&lt;br /&gt;
                        sin_port          = 9999&lt;br /&gt;
&lt;br /&gt;
Making a listen queue of 5 elements&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&lt;br /&gt;
Got a connection&lt;br /&gt;
Sending &amp;quot;Message from the socket server&amp;quot; to client&lt;br /&gt;
The messages match&lt;br /&gt;
Closing the socket&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
&lt;br /&gt;
Making a socket&lt;br /&gt;
Connecting to 10.0.2.204 on port 9999&lt;br /&gt;
Received &amp;quot;Message from the socket server&amp;quot; from server&lt;br /&gt;
&lt;br /&gt;
Writing &amp;quot;Message from the socket server&amp;quot; to server&lt;br /&gt;
Closing socket&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is what happened: MACHINE0 (the server) was configured as a server and waited for a connection. MACHINE1 (the client) connected to MACHINE0. MACHINE0 noticed the connection and sent a message to MACHINE1: &amp;quot;Message from the socket server&amp;quot;. MACHINE1 received the message and sent it right back. MACHINE0 compared the two messages to check the accuracy of the transmission. The messages matched so the transmission was successful.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project demonstrates how to set up host and client node sockets on an ethernet network.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3031</id>
		<title>Example socket</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3031"/>
		<updated>2014-01-03T18:02:24Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Usage Example. One Machine */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|Review(01.02.14-15:25-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
This application demonstrates how to set up sockets for host and client nodes on an ethernet network.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;1. Open the C/C++ editing perspective.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;2. Open the project files.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;3. Build the project.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;4. Upload the executables to the target system.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
==Usage and Behavior==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project will run just fine on any system for which it can be compiled.&lt;br /&gt;
&lt;br /&gt;
===Using &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
 ./socket -sc [ADDRESS] PORT&lt;br /&gt;
&lt;br /&gt;
;-s:Create a ''server'', specify the PORT to listen to.  &lt;br /&gt;
;-c:Create a ''client'', specify the server's ADDRESS and PORT.&lt;br /&gt;
&lt;br /&gt;
For our demonstration we create a ''server'' and a ''client''. Upon activation the server waits for a connection. Upon activation the client connects with the server. When the server detects the client's connection it sends a message to the client. Then the client sends that message right back to the server. The server compares the message it sent to the client with the message it just got from the client. If they match then we have performed a successful transmission.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. One Machine===&lt;br /&gt;
&lt;br /&gt;
We're going to create a ''server'' and ''client'' on the same machine. The machine will talk to itself.&lt;br /&gt;
&lt;br /&gt;
Create the server:&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Two machines===&lt;br /&gt;
&lt;br /&gt;
Get 2 machines. We're going to refer to our machines as ''MACHINE0'' and ''MACHINE1''.&amp;lt;br \&amp;gt;&lt;br /&gt;
Compile and upload the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; executable to each of them.&amp;lt;br \&amp;gt;&lt;br /&gt;
Connect them both to the same ethernet network.&amp;lt;br \&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program like this:'''&lt;br /&gt;
 som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
Note that we specified '''-s''', thus configuring MACHINE0 as a server. ''9999'' is an arbitrarily chosen (and assumed to be free) port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
So now MACHINE0 has been configured as a server and it's waiting for a connection...&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program like this:'''&lt;br /&gt;
 som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
Note that we specified '''-c''', thus configuring MACHINE1 as a '''client'''. ''10.0.2.204'' is the host machine's address (this will need to be determined. Use ''minicom'' or something similar). ''9999'' is the port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
Starting server&lt;br /&gt;
Making socket&lt;br /&gt;
Binding to port 9999opened socket as fd (3) on port (9999) for stream i/o&lt;br /&gt;
Server&lt;br /&gt;
                        sin_family        = 2&lt;br /&gt;
                        sin_addr.s_addr   = 0&lt;br /&gt;
                        sin_port          = 9999&lt;br /&gt;
&lt;br /&gt;
Making a listen queue of 5 elements&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&lt;br /&gt;
Got a connection&lt;br /&gt;
Sending &amp;quot;Message from the socket server&amp;quot; to client&lt;br /&gt;
The messages match&lt;br /&gt;
Closing the socket&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
&lt;br /&gt;
Making a socket&lt;br /&gt;
Connecting to 10.0.2.204 on port 9999&lt;br /&gt;
Received &amp;quot;Message from the socket server&amp;quot; from server&lt;br /&gt;
&lt;br /&gt;
Writing &amp;quot;Message from the socket server&amp;quot; to server&lt;br /&gt;
Closing socket&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is what happened: MACHINE0 (the server) was configured as a server and waited for a connection. MACHINE1 (the client) connected to MACHINE0. MACHINE0 noticed the connection and sent a message to MACHINE1: &amp;quot;Message from the socket server&amp;quot;. MACHINE1 received the message and sent it right back. MACHINE0 compared the two messages to check the accuracy of the transmission. The messages matched so the transmission was successful.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project demonstrates how to set up host and client node sockets on an ethernet network.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3030</id>
		<title>Example socket</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3030"/>
		<updated>2014-01-03T18:01:18Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Using socket */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|Review(01.02.14-15:25-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
This application demonstrates how to set up sockets for host and client nodes on an ethernet network.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;1. Open the C/C++ editing perspective.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;2. Open the project files.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;3. Build the project.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;4. Upload the executables to the target system.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
==Usage and Behavior==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project will run just fine on any system for which it can be compiled.&lt;br /&gt;
&lt;br /&gt;
===Using &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
 ./socket -sc [ADDRESS] PORT&lt;br /&gt;
&lt;br /&gt;
;-s:Create a ''server'', specify the PORT to listen to.  &lt;br /&gt;
;-c:Create a ''client'', specify the server's ADDRESS and PORT.&lt;br /&gt;
&lt;br /&gt;
For our demonstration we create a ''server'' and a ''client''. Upon activation the server waits for a connection. Upon activation the client connects with the server. When the server detects the client's connection it sends a message to the client. Then the client sends that message right back to the server. The server compares the message it sent to the client with the message it just got from the client. If they match then we have performed a successful transmission.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. One Machine===&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Two machines===&lt;br /&gt;
&lt;br /&gt;
Get 2 machines. We're going to refer to our machines as ''MACHINE0'' and ''MACHINE1''.&amp;lt;br \&amp;gt;&lt;br /&gt;
Compile and upload the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; executable to each of them.&amp;lt;br \&amp;gt;&lt;br /&gt;
Connect them both to the same ethernet network.&amp;lt;br \&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program like this:'''&lt;br /&gt;
 som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
Note that we specified '''-s''', thus configuring MACHINE0 as a server. ''9999'' is an arbitrarily chosen (and assumed to be free) port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
So now MACHINE0 has been configured as a server and it's waiting for a connection...&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program like this:'''&lt;br /&gt;
 som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
Note that we specified '''-c''', thus configuring MACHINE1 as a '''client'''. ''10.0.2.204'' is the host machine's address (this will need to be determined. Use ''minicom'' or something similar). ''9999'' is the port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
Starting server&lt;br /&gt;
Making socket&lt;br /&gt;
Binding to port 9999opened socket as fd (3) on port (9999) for stream i/o&lt;br /&gt;
Server&lt;br /&gt;
                        sin_family        = 2&lt;br /&gt;
                        sin_addr.s_addr   = 0&lt;br /&gt;
                        sin_port          = 9999&lt;br /&gt;
&lt;br /&gt;
Making a listen queue of 5 elements&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&lt;br /&gt;
Got a connection&lt;br /&gt;
Sending &amp;quot;Message from the socket server&amp;quot; to client&lt;br /&gt;
The messages match&lt;br /&gt;
Closing the socket&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
&lt;br /&gt;
Making a socket&lt;br /&gt;
Connecting to 10.0.2.204 on port 9999&lt;br /&gt;
Received &amp;quot;Message from the socket server&amp;quot; from server&lt;br /&gt;
&lt;br /&gt;
Writing &amp;quot;Message from the socket server&amp;quot; to server&lt;br /&gt;
Closing socket&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is what happened: MACHINE0 (the server) was configured as a server and waited for a connection. MACHINE1 (the client) connected to MACHINE0. MACHINE0 noticed the connection and sent a message to MACHINE1: &amp;quot;Message from the socket server&amp;quot;. MACHINE1 received the message and sent it right back. MACHINE0 compared the two messages to check the accuracy of the transmission. The messages matched so the transmission was successful.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project demonstrates how to set up host and client node sockets on an ethernet network.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3029</id>
		<title>Example socket</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3029"/>
		<updated>2014-01-03T17:59:15Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Using socket */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|Review(01.02.14-15:25-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
This application demonstrates how to set up sockets for host and client nodes on an ethernet network.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;1. Open the C/C++ editing perspective.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;2. Open the project files.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;3. Build the project.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;4. Upload the executables to the target system.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
==Usage and Behavior==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project will run just fine on any system for which it can be compiled.&lt;br /&gt;
&lt;br /&gt;
===Using &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
 ./socket -sc [ADDRESS] PORT&lt;br /&gt;
&lt;br /&gt;
;-s:Create a ''server'' and specify the PORT to listen to.  &lt;br /&gt;
;-c:Create a ''client'', specify the server's ADDRESS and PORT.&lt;br /&gt;
&lt;br /&gt;
For our demonstration we create a ''server'' and a ''client''. Upon activation the server waits for a connection. Upon activation the client connects with the server. When the server detects the client's connection it sends a message to the client. Then the client sends that message right back to the server. The server compares the message it sent to the client with the message it just got from the client. If they match then we have performed a successful transmission.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Two machines===&lt;br /&gt;
&lt;br /&gt;
Get 2 machines. We're going to refer to our machines as ''MACHINE0'' and ''MACHINE1''.&amp;lt;br \&amp;gt;&lt;br /&gt;
Compile and upload the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; executable to each of them.&amp;lt;br \&amp;gt;&lt;br /&gt;
Connect them both to the same ethernet network.&amp;lt;br \&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program like this:'''&lt;br /&gt;
 som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
Note that we specified '''-s''', thus configuring MACHINE0 as a server. ''9999'' is an arbitrarily chosen (and assumed to be free) port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
So now MACHINE0 has been configured as a server and it's waiting for a connection...&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program like this:'''&lt;br /&gt;
 som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
Note that we specified '''-c''', thus configuring MACHINE1 as a '''client'''. ''10.0.2.204'' is the host machine's address (this will need to be determined. Use ''minicom'' or something similar). ''9999'' is the port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
Starting server&lt;br /&gt;
Making socket&lt;br /&gt;
Binding to port 9999opened socket as fd (3) on port (9999) for stream i/o&lt;br /&gt;
Server&lt;br /&gt;
                        sin_family        = 2&lt;br /&gt;
                        sin_addr.s_addr   = 0&lt;br /&gt;
                        sin_port          = 9999&lt;br /&gt;
&lt;br /&gt;
Making a listen queue of 5 elements&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&lt;br /&gt;
Got a connection&lt;br /&gt;
Sending &amp;quot;Message from the socket server&amp;quot; to client&lt;br /&gt;
The messages match&lt;br /&gt;
Closing the socket&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
&lt;br /&gt;
Making a socket&lt;br /&gt;
Connecting to 10.0.2.204 on port 9999&lt;br /&gt;
Received &amp;quot;Message from the socket server&amp;quot; from server&lt;br /&gt;
&lt;br /&gt;
Writing &amp;quot;Message from the socket server&amp;quot; to server&lt;br /&gt;
Closing socket&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is what happened: MACHINE0 (the server) was configured as a server and waited for a connection. MACHINE1 (the client) connected to MACHINE0. MACHINE0 noticed the connection and sent a message to MACHINE1: &amp;quot;Message from the socket server&amp;quot;. MACHINE1 received the message and sent it right back. MACHINE0 compared the two messages to check the accuracy of the transmission. The messages matched so the transmission was successful.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project demonstrates how to set up host and client node sockets on an ethernet network.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3028</id>
		<title>Example socket</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3028"/>
		<updated>2014-01-03T17:58:54Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Using socket */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|Review(01.02.14-15:25-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
This application demonstrates how to set up sockets for host and client nodes on an ethernet network.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;1. Open the C/C++ editing perspective.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;2. Open the project files.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;3. Build the project.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;4. Upload the executables to the target system.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
==Usage and Behavior==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project will run just fine on any system for which it can be compiled.&lt;br /&gt;
&lt;br /&gt;
===Using &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
 ./socket -sc [ADDRESS] PORT&lt;br /&gt;
&lt;br /&gt;
;-s:Create a ''server'' and specify the PORT to listen to.  &lt;br /&gt;
;-c:Create a ''client'', specify the server's ADDRESS and PORT.&lt;br /&gt;
&lt;br /&gt;
For our demonstration we create a ''server'' and a ''client''. Upon activation the server waits for a connection. Upon activation the client connects with the server. When the server detects the client's connection it sends a message to the client. Then the client sends that message right back to the server. The server compares the message it sent to the client with the message it just got from the client. If they match then we have perfomed a successful transmission.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Two machines===&lt;br /&gt;
&lt;br /&gt;
Get 2 machines. We're going to refer to our machines as ''MACHINE0'' and ''MACHINE1''.&amp;lt;br \&amp;gt;&lt;br /&gt;
Compile and upload the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; executable to each of them.&amp;lt;br \&amp;gt;&lt;br /&gt;
Connect them both to the same ethernet network.&amp;lt;br \&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program like this:'''&lt;br /&gt;
 som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
Note that we specified '''-s''', thus configuring MACHINE0 as a server. ''9999'' is an arbitrarily chosen (and assumed to be free) port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
So now MACHINE0 has been configured as a server and it's waiting for a connection...&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program like this:'''&lt;br /&gt;
 som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
Note that we specified '''-c''', thus configuring MACHINE1 as a '''client'''. ''10.0.2.204'' is the host machine's address (this will need to be determined. Use ''minicom'' or something similar). ''9999'' is the port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
Starting server&lt;br /&gt;
Making socket&lt;br /&gt;
Binding to port 9999opened socket as fd (3) on port (9999) for stream i/o&lt;br /&gt;
Server&lt;br /&gt;
                        sin_family        = 2&lt;br /&gt;
                        sin_addr.s_addr   = 0&lt;br /&gt;
                        sin_port          = 9999&lt;br /&gt;
&lt;br /&gt;
Making a listen queue of 5 elements&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&lt;br /&gt;
Got a connection&lt;br /&gt;
Sending &amp;quot;Message from the socket server&amp;quot; to client&lt;br /&gt;
The messages match&lt;br /&gt;
Closing the socket&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
&lt;br /&gt;
Making a socket&lt;br /&gt;
Connecting to 10.0.2.204 on port 9999&lt;br /&gt;
Received &amp;quot;Message from the socket server&amp;quot; from server&lt;br /&gt;
&lt;br /&gt;
Writing &amp;quot;Message from the socket server&amp;quot; to server&lt;br /&gt;
Closing socket&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is what happened: MACHINE0 (the server) was configured as a server and waited for a connection. MACHINE1 (the client) connected to MACHINE0. MACHINE0 noticed the connection and sent a message to MACHINE1: &amp;quot;Message from the socket server&amp;quot;. MACHINE1 received the message and sent it right back. MACHINE0 compared the two messages to check the accuracy of the transmission. The messages matched so the transmission was successful.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project demonstrates how to set up host and client node sockets on an ethernet network.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3027</id>
		<title>Example socket</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3027"/>
		<updated>2014-01-03T17:58:12Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Using socket */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|Review(01.02.14-15:25-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
This application demonstrates how to set up sockets for host and client nodes on an ethernet network.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;1. Open the C/C++ editing perspective.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;2. Open the project files.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;3. Build the project.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;4. Upload the executables to the target system.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
==Usage and Behavior==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project will run just fine on any system for which it can be compiled.&lt;br /&gt;
&lt;br /&gt;
===Using &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
 ./socket -sc [ADDRESS] PORT&lt;br /&gt;
&lt;br /&gt;
;-s:Create a ''server'' and specify the PORT to listen to.  &lt;br /&gt;
;-c:Create a ''client'', specify the server ADDRESS and PORT.&lt;br /&gt;
&lt;br /&gt;
For our demonstration we create a ''server'' and a ''client''. Upon activation the server waits for a connection. Upon activation the client connects with the server. When the server detects the client's connection it sends a message to the client. Then the client sends that message right back to the server. The server compares the message it sent to the client with the message it just got from the client. If they match then we have perfomed a successful transmission.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Two machines===&lt;br /&gt;
&lt;br /&gt;
Get 2 machines. We're going to refer to our machines as ''MACHINE0'' and ''MACHINE1''.&amp;lt;br \&amp;gt;&lt;br /&gt;
Compile and upload the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; executable to each of them.&amp;lt;br \&amp;gt;&lt;br /&gt;
Connect them both to the same ethernet network.&amp;lt;br \&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program like this:'''&lt;br /&gt;
 som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
Note that we specified '''-s''', thus configuring MACHINE0 as a server. ''9999'' is an arbitrarily chosen (and assumed to be free) port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
So now MACHINE0 has been configured as a server and it's waiting for a connection...&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program like this:'''&lt;br /&gt;
 som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
Note that we specified '''-c''', thus configuring MACHINE1 as a '''client'''. ''10.0.2.204'' is the host machine's address (this will need to be determined. Use ''minicom'' or something similar). ''9999'' is the port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
Starting server&lt;br /&gt;
Making socket&lt;br /&gt;
Binding to port 9999opened socket as fd (3) on port (9999) for stream i/o&lt;br /&gt;
Server&lt;br /&gt;
                        sin_family        = 2&lt;br /&gt;
                        sin_addr.s_addr   = 0&lt;br /&gt;
                        sin_port          = 9999&lt;br /&gt;
&lt;br /&gt;
Making a listen queue of 5 elements&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&lt;br /&gt;
Got a connection&lt;br /&gt;
Sending &amp;quot;Message from the socket server&amp;quot; to client&lt;br /&gt;
The messages match&lt;br /&gt;
Closing the socket&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
&lt;br /&gt;
Making a socket&lt;br /&gt;
Connecting to 10.0.2.204 on port 9999&lt;br /&gt;
Received &amp;quot;Message from the socket server&amp;quot; from server&lt;br /&gt;
&lt;br /&gt;
Writing &amp;quot;Message from the socket server&amp;quot; to server&lt;br /&gt;
Closing socket&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is what happened: MACHINE0 (the server) was configured as a server and waited for a connection. MACHINE1 (the client) connected to MACHINE0. MACHINE0 noticed the connection and sent a message to MACHINE1: &amp;quot;Message from the socket server&amp;quot;. MACHINE1 received the message and sent it right back. MACHINE0 compared the two messages to check the accuracy of the transmission. The messages matched so the transmission was successful.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project demonstrates how to set up host and client node sockets on an ethernet network.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3026</id>
		<title>Example socket</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3026"/>
		<updated>2014-01-03T17:57:38Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Using socket */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|Review(01.02.14-15:25-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
This application demonstrates how to set up sockets for host and client nodes on an ethernet network.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;1. Open the C/C++ editing perspective.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;2. Open the project files.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;3. Build the project.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;4. Upload the executables to the target system.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
==Usage and Behavior==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project will run just fine on any system for which it can be compiled.&lt;br /&gt;
&lt;br /&gt;
===Using &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;===&lt;br /&gt;
./socket -sc [ADDRESS] PORT&lt;br /&gt;
&lt;br /&gt;
;-s:Create a ''server'' and specify the PORT to listen to.  &lt;br /&gt;
;-c:Create a ''client'', specify the server ADDRESS and PORT.&lt;br /&gt;
&lt;br /&gt;
For our demonstration we create a ''server'' and a ''client''. Upon activation the server waits for a connection. Upon activation the client connects with the server. When the server detects the client's connection it sends a message to the client. Then the client sends that message right back to the server. The server compares the message it sent to the client with the message it just got from the client. If they match then we have perfomed a successful transmission.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Two machines===&lt;br /&gt;
&lt;br /&gt;
Get 2 machines. We're going to refer to our machines as ''MACHINE0'' and ''MACHINE1''.&amp;lt;br \&amp;gt;&lt;br /&gt;
Compile and upload the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; executable to each of them.&amp;lt;br \&amp;gt;&lt;br /&gt;
Connect them both to the same ethernet network.&amp;lt;br \&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program like this:'''&lt;br /&gt;
 som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
Note that we specified '''-s''', thus configuring MACHINE0 as a server. ''9999'' is an arbitrarily chosen (and assumed to be free) port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
So now MACHINE0 has been configured as a server and it's waiting for a connection...&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program like this:'''&lt;br /&gt;
 som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
Note that we specified '''-c''', thus configuring MACHINE1 as a '''client'''. ''10.0.2.204'' is the host machine's address (this will need to be determined. Use ''minicom'' or something similar). ''9999'' is the port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
Starting server&lt;br /&gt;
Making socket&lt;br /&gt;
Binding to port 9999opened socket as fd (3) on port (9999) for stream i/o&lt;br /&gt;
Server&lt;br /&gt;
                        sin_family        = 2&lt;br /&gt;
                        sin_addr.s_addr   = 0&lt;br /&gt;
                        sin_port          = 9999&lt;br /&gt;
&lt;br /&gt;
Making a listen queue of 5 elements&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&lt;br /&gt;
Got a connection&lt;br /&gt;
Sending &amp;quot;Message from the socket server&amp;quot; to client&lt;br /&gt;
The messages match&lt;br /&gt;
Closing the socket&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
&lt;br /&gt;
Making a socket&lt;br /&gt;
Connecting to 10.0.2.204 on port 9999&lt;br /&gt;
Received &amp;quot;Message from the socket server&amp;quot; from server&lt;br /&gt;
&lt;br /&gt;
Writing &amp;quot;Message from the socket server&amp;quot; to server&lt;br /&gt;
Closing socket&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is what happened: MACHINE0 (the server) was configured as a server and waited for a connection. MACHINE1 (the client) connected to MACHINE0. MACHINE0 noticed the connection and sent a message to MACHINE1: &amp;quot;Message from the socket server&amp;quot;. MACHINE1 received the message and sent it right back. MACHINE0 compared the two messages to check the accuracy of the transmission. The messages matched so the transmission was successful.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project demonstrates how to set up host and client node sockets on an ethernet network.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3025</id>
		<title>Example socket</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_socket&amp;diff=3025"/>
		<updated>2014-01-03T17:51:12Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Using socket */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|Review(01.02.14-15:25-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
This application demonstrates how to set up sockets for host and client nodes on an ethernet network.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;1. Open the C/C++ editing perspective.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;2. Open the project files.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;3. Build the project.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;4. Upload the executables to the target system.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stub&lt;br /&gt;
&lt;br /&gt;
==Usage and Behavior==&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project will run just fine on any system for which it can be compiled.&lt;br /&gt;
&lt;br /&gt;
===Using &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
We create a ''server'' and a ''client''. Upon activation the server waits for a connection. Upon activation the client connects with the server. When the server detects the client's connection it sends a message to the client. Then the client sends that message right back to the server. The server compares the message it sent to the client with the message it just got from the client. If they match then we have a successful transmission.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Two machines===&lt;br /&gt;
&lt;br /&gt;
Get 2 machines. We're going to refer to our machines as ''MACHINE0'' and ''MACHINE1''.&amp;lt;br \&amp;gt;&lt;br /&gt;
Compile and upload the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; executable to each of them.&amp;lt;br \&amp;gt;&lt;br /&gt;
Connect them both to the same ethernet network.&amp;lt;br \&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program like this:'''&lt;br /&gt;
 som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
Note that we specified '''-s''', thus configuring MACHINE0 as a server. ''9999'' is an arbitrarily chosen (and assumed to be free) port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
So now MACHINE0 has been configured as a server and it's waiting for a connection...&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 run the &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; program like this:'''&lt;br /&gt;
 som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
Note that we specified '''-c''', thus configuring MACHINE1 as a '''client'''. ''10.0.2.204'' is the host machine's address (this will need to be determined. Use ''minicom'' or something similar). ''9999'' is the port address on the host machine.&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE0 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
som9g45:/tmp# ./socket -s 9999&lt;br /&gt;
&lt;br /&gt;
Starting server&lt;br /&gt;
Making socket&lt;br /&gt;
Binding to port 9999opened socket as fd (3) on port (9999) for stream i/o&lt;br /&gt;
Server&lt;br /&gt;
                        sin_family        = 2&lt;br /&gt;
                        sin_addr.s_addr   = 0&lt;br /&gt;
                        sin_port          = 9999&lt;br /&gt;
&lt;br /&gt;
Making a listen queue of 5 elements&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&lt;br /&gt;
Got a connection&lt;br /&gt;
Sending &amp;quot;Message from the socket server&amp;quot; to client&lt;br /&gt;
The messages match&lt;br /&gt;
Closing the socket&lt;br /&gt;
Waiting for a connection&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''On MACHINE1 you will see something like this:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./socket -c 10.0.2.204 9999&lt;br /&gt;
&lt;br /&gt;
Making a socket&lt;br /&gt;
Connecting to 10.0.2.204 on port 9999&lt;br /&gt;
Received &amp;quot;Message from the socket server&amp;quot; from server&lt;br /&gt;
&lt;br /&gt;
Writing &amp;quot;Message from the socket server&amp;quot; to server&lt;br /&gt;
Closing socket&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is what happened: MACHINE0 (the server) was configured as a server and waited for a connection. MACHINE1 (the client) connected to MACHINE0. MACHINE0 noticed the connection and sent a message to MACHINE1: &amp;quot;Message from the socket server&amp;quot;. MACHINE1 received the message and sent it right back. MACHINE0 compared the two messages to check the accuracy of the transmission. The messages matched so the transmission was successful.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
The &amp;lt;code&amp;gt;socket&amp;lt;/code&amp;gt; C example project demonstrates how to set up host and client node sockets on an ethernet network.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.emacinc.com/index.php?title=Example_watchdog&amp;diff=3022</id>
		<title>Example watchdog</title>
		<link rel="alternate" type="text/html" href="https://wiki.emacinc.com/index.php?title=Example_watchdog&amp;diff=3022"/>
		<updated>2014-01-03T17:34:20Z</updated>

		<summary type="html">&lt;p&gt;Jgreene: /* Usage Example. Enabling watchdog */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{todo|Review(01.03.14-11:32-&amp;gt;JG+)|Jgreene|project=oe 4,oe 5,jg,md,Review}}&lt;br /&gt;
This is a guide to the &amp;lt;code&amp;gt;watchdog&amp;lt;/code&amp;gt; C example project included in the EMAC OE SDK.&lt;br /&gt;
&lt;br /&gt;
A '''watchdog timer''' (WDT) is a hardware circuit that can reset the computer system in case of a software fault. This is an example test for the Linux watchdog API. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;watchdog&amp;lt;/code&amp;gt; project builds one executable: &amp;lt;code&amp;gt;watchdog-test&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Opening, Building and Uploading the Project Files ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;stubbooo&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Usage and Behavior==&lt;br /&gt;
&lt;br /&gt;
A '''watchdog timer''' is a hardware circuit that can reset the computer system in case of a software fault.  The &amp;lt;code&amp;gt;watchdog-test&amp;lt;/code&amp;gt; application can enable, disable, activate, configure and interrupt the '''watchdog timer'''. &lt;br /&gt;
{{imbox|type=content|textstyle=font-weight:bold;|text= Activating watchdog invokes system reset (after timeout)}}&lt;br /&gt;
&lt;br /&gt;
===Hardware Requirements===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;watchdog&amp;lt;/code&amp;gt; will run on any system for which it can be compiled and implements the standard Linux &amp;lt;code&amp;gt;watchdog&amp;lt;/code&amp;gt; API.&lt;br /&gt;
&lt;br /&gt;
===&amp;lt;code&amp;gt;watchdog&amp;lt;/code&amp;gt; Usage===&lt;br /&gt;
&lt;br /&gt;
 ./watchdog-test [-det]&lt;br /&gt;
&lt;br /&gt;
;-d:Disable watchdog.&lt;br /&gt;
;-e:Enable watchdog.&lt;br /&gt;
;-t:Set the watchdog timeout (to a value specified in code. Default is five seconds).&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Activating &amp;lt;code&amp;gt;watchdog&amp;lt;/code&amp;gt; with a periodic interrupt===&lt;br /&gt;
&lt;br /&gt;
This will activate &amp;lt;code&amp;gt;watchdog&amp;lt;/code&amp;gt; and initiate a periodic interrupt to keep it from timing out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./watchdog-test &lt;br /&gt;
Watchdog Ticking Away!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We have activated &amp;lt;code&amp;gt;watchdog&amp;lt;/code&amp;gt; and now it is counting down to computer reset - or rather it would be if we didn't keep resetting it's timer. That's the LED on the SoM blinking at about 1 Hz. Every second &amp;lt;code&amp;gt;watchdog-test&amp;lt;/code&amp;gt; is sending an IOCTL to the watchdog driver, which in turn ticks &amp;lt;code&amp;gt;watchdog&amp;lt;/code&amp;gt; to reset its internal timer so it doesn't timeout and trigger a system reset.&lt;br /&gt;
&lt;br /&gt;
Now we will stop interrupting &amp;lt;code&amp;gt;watchdog&amp;lt;/code&amp;gt; and let it trigger a computer reset. Hit CTRL-C.&lt;br /&gt;
&lt;br /&gt;
...and the system resets.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Disabling &amp;lt;code&amp;gt;watchdog&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./watchdog-test -d&lt;br /&gt;
Watchdog card disabled.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...and the program exits normally.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Enabling &amp;lt;code&amp;gt;watchdog&amp;lt;/code&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
This will enable and activate &amp;lt;code&amp;gt;watchdog&amp;lt;/code&amp;gt; but it won't perform a periodic timeout interrupt (see the first usage example, above). So when you run it the program activates &amp;lt;code&amp;gt;watchdog&amp;lt;/code&amp;gt; and then &amp;lt;code&amp;gt;watchdog&amp;lt;/code&amp;gt; resets the system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./watchdog-test -e&lt;br /&gt;
Watchdog card enabled.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...and the system resets.&lt;br /&gt;
&lt;br /&gt;
===Usage Example. Setting &amp;lt;code&amp;gt;watchdog&amp;lt;/code&amp;gt; timeout===&lt;br /&gt;
&lt;br /&gt;
This will activate &amp;lt;code&amp;gt;watchdog&amp;lt;/code&amp;gt; and set it to timeout in 5 seconds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@som9g20:/tmp# ./watchdog-test -t&lt;br /&gt;
Watchdog timeout set to 5 seconds!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...the program exits normally, then 5 seconds elapse, and then the system resets.&lt;br /&gt;
&lt;br /&gt;
==Summary==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;watchdog&amp;lt;/code&amp;gt; C example project demonstrates how to use the '''watchdog timer'''. We provide examples of how to enable, disable, activate, configure and interrupt the &amp;lt;code&amp;gt;watchdog&amp;lt;/code&amp;gt; hardware circuit.&lt;/div&gt;</summary>
		<author><name>Jgreene</name></author>
		
	</entry>
</feed>