Difference between revisions of "Example mcp4922 test"

From wiki.emacinc.com
Jump to: navigation, search
(Using mcp4922_test)
Line 33: Line 33:
  
 
===Using <code>mcp4922_test</code>===
 
===Using <code>mcp4922_test</code>===
 +
 +
Run it from the console...
  
 
  ./mcp4922_test
 
  ./mcp4922_test
  
You'll get the signal on the analog out port. Pin 15 is analog out 0 and pin 16 is analog out 1. GND is 1,2,17,18. Range is 5V. You'll need an oscilloscope and a board schematic.
+
Regard the HDR ANALOG I/O HEADER on your foo foo board.  
 +
 
 +
<pic of header>
 +
 
 +
Pin 15 is analog out 0 and pin 16 is analog out 1. Pins 1, 2, 17 and 18 are all ground.
 +
 
 +
[[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.

Revision as of 11:23, 31 December 2013

TODO: {{#todo:InProgress(11.14.13-15:09->JG+)|Jgreene|oe 4,oe 5,jg,md,InProgress}}

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 DtoA 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

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

stub

2. Open the project files.

stub

3. Build the project.

stub

4. Upload the executables to the target system.

stub

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 HDR ANALOG I/O HEADER on your foo foo board.

<pic of header>

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 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.