Difference between revisions of "Example mcp4922 test"

From wiki.emacinc.com
Jump to: navigation, search
(Using mcp4922_test)
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{todo|InProgress(11.14.13-15:09->JG+)|Jgreene|project=oe 4,oe 5,jg,md,InProgress}}
+
{{todo|SEOKWREV (12.31.13-11:48->JG+);(12.31-13-12:25->MD+);(12.31.13-12:50->KY+);(04.07.14-09:50->BS+);(04.10.14-10:50->BS+)|Jgreene|project=oe 4,oe 5,jg,md,SEOKWREV,ky,bs}}
 +
 
 +
{{#seo:
 +
|title=mcp4922 test
 +
|titlemode=append
 +
|keywords=mcp4922,DAC example,DAC sine,DAC function
 +
|description=This is a guide to the <code>mcp4922_test</code> C example project included in the EMAC OE SDK.
 +
}}
 
This is a guide to the <code>mcp4922_test</code> C example project included in the EMAC OE SDK.
 
This is a guide to the <code>mcp4922_test</code> C example project included in the EMAC OE SDK.
  
This is an example application for accessing the EMAC interface for the on-board DtoA of the SoM-150ES. This interface uses the EMAC ioex class to provide a GPIO-like interface (see also the [http://wikidev.emacinc.com/wiki/Example_egpc egpc project]). This application outputs a sine wave on channel 0 and a cosine wave on channel 1.
+
This is an example application for accessing the EMAC interface for the on-board D/A of the SoM-150ES. This interface uses the EMAC ioex class to provide a GPIO-like interface (see also the [http://wikidev.emacinc.com/wiki/Example_egpc egpc project]). This application outputs a sine wave on channel 0 and a cosine wave on channel 1.
  
 
The <code>mcp4922_test</code> project builds one executable: <code>mcp4922_test</code>.
 
The <code>mcp4922_test</code> project builds one executable: <code>mcp4922_test</code>.
Line 8: Line 15:
 
== Opening, Building and Uploading the Project Files ==
 
== Opening, Building and Uploading the Project Files ==
  
<big>1. Open the C/C++ editing perspective.</big>
+
For information on opening the project from within Eclipse, please see [[Importing the EMAC OE SDK Projects with Eclipse]]. Then, follow [[Using the EMAC OE SDK Projects with Eclipse]] for information on how to build, upload and execute the example.
  
stub
+
Alternatively, the <code>Makefile</code> can be used with the <code>make</code> command from the commandline to build and upload the example.  For more information on this method, please see [[Using EMAC OE SDK Example Projects]].
 
 
<big>2. Open the project files.</big>
 
 
 
stub
 
 
 
<big>3. Build the project.</big>
 
 
 
stub
 
 
 
<big>4. Upload the executables to the target system.</big>
 
 
 
stub
 
  
 
==Usage and Behavior==
 
==Usage and Behavior==
Line 38: Line 33:
 
  ./mcp4922_test
 
  ./mcp4922_test
  
Regard the HDR ANALOG I/O HEADER on your foo foo board.  
+
Regard the EMAC SoM-150ES carrier board. Locate the HDR8 ANALOG I/O HEADER (circled).
  
<pic of header>
+
[[File:hdr8_analog_io_header_location.jpg]]
  
 
Pin 15 is analog out 0 and pin 16 is analog out 1. Pins 1, 2, 17 and 18 are all ground.  
 
Pin 15 is analog out 0 and pin 16 is analog out 1. Pins 1, 2, 17 and 18 are all ground.  
Line 46: Line 41:
 
[[File:hdr8_analog_io_header_detail.jpg]]
 
[[File:hdr8_analog_io_header_detail.jpg]]
  
When we execute <code>mcp4922_test</code> we get a 5v sine signal on pin 15 and a cosine on pin 16. We can watch the signals on an oscilloscope or listen to them on a speaker.
+
When we execute <code>mcp4922_test</code> we get a 5v sine wave on pin 15 and a cosine on pin 16. We can watch the signals on an oscilloscope or listen to them on a speaker.
 +
 
 +
==Summary==
 +
 
 +
The <code>mcp4922_test</code> C example project demonstrates how to access the on-board DtoA of an EMAC SoM-150ES carrier board.

Latest revision as of 09:52, 10 April 2014

TODO: {{#todo:SEOKWREV (12.31.13-11:48->JG+);(12.31-13-12:25->MD+);(12.31.13-12:50->KY+);(04.07.14-09:50->BS+);(04.10.14-10:50->BS+)|Jgreene|oe 4,oe 5,jg,md,SEOKWREV,ky,bs}}

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

This is an example application for accessing the EMAC interface for the on-board D/A of the SoM-150ES. This interface uses the EMAC ioex class to provide a GPIO-like interface (see also the egpc project). This application outputs a sine wave on channel 0 and a cosine wave on channel 1.

The mcp4922_test project builds one executable: mcp4922_test.

Opening, Building and Uploading the Project Files

For information on opening the project from within Eclipse, please see Importing the EMAC OE SDK Projects with Eclipse. Then, follow Using the EMAC OE SDK Projects with Eclipse for information on how to build, upload and execute the example.

Alternatively, the Makefile can be used with the make command from the commandline to build and upload the example. For more information on this method, please see Using EMAC OE SDK Example Projects.

Usage and Behavior

mcp4922_test outputs a sine wave on channel 0 and a cosine wave on channel 1.

Hardware Requirements

The mcp4922_test C example project requires an EMAC SoM-150ES carrier board.

Using mcp4922_test

Run it from the console...

./mcp4922_test

Regard the EMAC SoM-150ES carrier board. Locate the HDR8 ANALOG I/O HEADER (circled).

Hdr8 analog io header location.jpg

Pin 15 is analog out 0 and pin 16 is analog out 1. Pins 1, 2, 17 and 18 are all ground.

Hdr8 analog io header detail.jpg

When we execute mcp4922_test we get a 5v sine wave on pin 15 and a cosine on pin 16. We can watch the signals on an oscilloscope or listen to them on a speaker.

Summary

The mcp4922_test C example project demonstrates how to access the on-board DtoA of an EMAC SoM-150ES carrier board.