Difference between revisions of "Example io demo"

From wiki.emacinc.com
Jump to: navigation, search
Line 4: Line 4:
 
'''IO''' is an acronym; it stands for ''Input Output''. It refers to data going in and data coming out. In and out of ''what'' you ask? Why your machine of course. In this case your machine is the SOM-150ES carrier board.  
 
'''IO''' is an acronym; it stands for ''Input Output''. It refers to data going in and data coming out. In and out of ''what'' you ask? Why your machine of course. In this case your machine is the SOM-150ES carrier board.  
  
'''Input''' is data going into your machine. Your machine is receiving data, via a port or header, from an external piece of hardware. Mouses, joysticks, keyboards, electronic rain-guages, digital telescopes, burglar alarms and the internet: these all produce streams of data that your machine can store, process, fold, weave and/or otherwise react to. What your machine does with the data, specifically, depends what software you've got running. The '''io demo''' is an example of such software.
+
'''Input''' is data going into your machine. Your machine is receiving data, via a port or header, from an external piece of hardware. Mouses, joysticks, keyboards, electronic rain-guages, digital telescopes, burglar alarms and the internet: these all produce streams of data that your machine can store, process, fold, weave and otherwise react to. What your machine does with the data, specifically, depends what software you've got running.
  
'''Output''' is data coming out of your machine. Your machine is sending data, via a port or header, to an external piece of hardware. It's telling that piece of hardware to do something: store some bytes of data, blink an LED, wiggle a robotic tentacle. What data gets sent depends on what software you've got running. The '''io demo''' is an example of such software.
+
'''Output''' is data coming out of your machine. Your machine is sending data, via a port or header, to an external piece of hardware. It's telling that piece of hardware to do something: store some bytes of data, blink an LED, wiggle a robotic tentacle. What data gets sent depends on what software you've got running.
  
 
Combined, that's '''IO'''. It's how your machine converses with the outside world and without which it is just a sexy paperweight.
 
Combined, that's '''IO'''. It's how your machine converses with the outside world and without which it is just a sexy paperweight.
  
The '''io demo''' gives us four nice demonstrations of SOM-150ES carrier board IO. We keep it simple. As you might imagine there are some extremely sophisticated IO technologies out there (USB, Ethernet...) but that's a discussion for another time. Here we're just going to work with a general purpose input output (gpio) header: an array of 2x25 pins that can read or render a binary value. It's straightforward stuff. Understanding the principals outlined here will equip you to hold meaningful digital conversations with anything from a toaster to a space shuttle.
+
The '''io demo''' gives us four nice demonstrations of SOM-150ES carrier board IO. We keep it simple. As you might imagine there are some extremely sophisticated IO technologies out there (USB, Ethernet...) but that's a discussion for another time. Here we're just going to work with a general purpose input output (GPIO) header. It's straightforward stuff. Understanding the principals outlined here will equip you to hold meaningful digital conversations with anything from a toaster to a space shuttle.
  
 
== Opening, Building and Uploading the Project Files ==
 
== Opening, Building and Uploading the Project Files ==
Line 67: Line 67:
 
Now we can press '''a''','''c''','''i''' or '''r''' to run a demo; or press '''x''' to exit.
 
Now we can press '''a''','''c''','''i''' or '''r''' to run a demo; or press '''x''' to exit.
  
===A/D Demo===
+
===Usage Example. A/D Demo===
  
[[File:Io demo terminal session sample 0.png]]
+
'''STUB. NEED AN ANALOG WAVEFORM GENERATOR TO USE THIS'''
  
===Count Demo===
+
===Usage Example. Count Demo===
 +
 
 +
From the demo menu press '''c'''.
  
 
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.
 
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.
Line 77: Line 79:
 
[[File:Io demo led action sample 0.png | 500px]]
 
[[File:Io demo led action sample 0.png | 500px]]
  
The board counts from 0 to 15 in binary, reflecting the steps of this operation in the LEDs. When it's finished LD1 and LD6 are lit.
+
The board counts from 0 to 255 in binary, reflecting the steps of this operation in the LEDs. When it's finished LD1 and LD6 are lit.
  
===Input to Output Demo===
+
===Usage Example. Input to Output Demo===
  
 
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.
 
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.
Line 89: Line 91:
 
The board lights all 8 LEDs.
 
The board lights all 8 LEDs.
  
===Ring Demo===
+
===Usage Example. Ring Demo===
  
 
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.
 
Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.

Revision as of 10:35, 4 December 2013

TODO: {{#todo:InProgress(11.27.13-14:10->JG+)|Jgreene|oe 4,oe 5,jg,md,Review}}

This is a guide to the io demo C example project included in the EMAC OE SDK.

IO is an acronym; it stands for Input Output. It refers to data going in and data coming out. In and out of what you ask? Why your machine of course. In this case your machine is the SOM-150ES carrier board.

Input is data going into your machine. Your machine is receiving data, via a port or header, from an external piece of hardware. Mouses, joysticks, keyboards, electronic rain-guages, digital telescopes, burglar alarms and the internet: these all produce streams of data that your machine can store, process, fold, weave and otherwise react to. What your machine does with the data, specifically, depends what software you've got running.

Output is data coming out of your machine. Your machine is sending data, via a port or header, to an external piece of hardware. It's telling that piece of hardware to do something: store some bytes of data, blink an LED, wiggle a robotic tentacle. What data gets sent depends on what software you've got running.

Combined, that's IO. It's how your machine converses with the outside world and without which it is just a sexy paperweight.

The io demo gives us four nice demonstrations of SOM-150ES carrier board IO. We keep it simple. As you might imagine there are some extremely sophisticated IO technologies out there (USB, Ethernet...) but that's a discussion for another time. Here we're just going to work with a general purpose input output (GPIO) header. It's straightforward stuff. Understanding the principals outlined here will equip you to hold meaningful digital conversations with anything from a toaster to a space shuttle.

Opening, Building and Uploading the Project Files

1. Open the C/C++ editing perspective.

stub

2. Open the io demo project files.

stub

3. Build the io demo project.

stub

4. Upload the io demo binary to the target machine.

stub

Usage and Behaviour

Hardware Requirements

To use the io demo program you will need the following hardware.

  • A SOM-150ES carrier board (Available from EMAC).
  • A compatible SoM for that carrier board (SOM-9260M, SOM-9G20M and SOM-9X25 are all compatible and available from EMAC).
  • A scrap of homestyle ribbon cable just long enough to reach from GPIO Port B to GPIO Port C. See [Usage Example. IO Demo] for details.
  • An analog signal generator. See [Usage Example. AD Demo] for details.

This is a SOM-150ES carrier board
File:Som150 with SoM.jpg

Usage for io_demo

Execute io demo from the console. It takes no parameters.

./io_demo

This brings up a menu of demos.

****************************
     Demo Menu              
                            
A/D Demo             - a    
Count Demo           - c    
Input to Output Demo - i    
Ring Demo            - r    
                            
Exit                 - x    
                            
Enter Selection:

Now we can press a,c,i or r to run a demo; or press x to exit.

Usage Example. A/D Demo

STUB. NEED AN ANALOG WAVEFORM GENERATOR TO USE THIS

Usage Example. Count Demo

From the demo menu press c.

Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.

500px

The board counts from 0 to 255 in binary, reflecting the steps of this operation in the LEDs. When it's finished LD1 and LD6 are lit.

Usage Example. Input to Output Demo

Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.

300px

500px

The board lights all 8 LEDs.

Usage Example. Ring Demo

Refer to the SOM-150ES carrier board surface mount LEDs LD1-LD8 for output.

500px

The board lights the LEDs in numeric sequence, 1-8, then repeats; looping until a key is pressed.