Example mcp4922 test
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.
mcp4922_test project builds one executable:
Opening, Building and Uploading the Project Files
1. Open the C/C++ editing perspective.
2. Open the project files.
3. Build the project.
4. Upload the executables to the target system.
Usage and Behavior
mcp4922_test outputs a sine wave on channel 0 and a cosine wave on channel 1.
mcp4922_test C example project requires an EMAC SoM-150ES carrier board.
Run it from the console...
Regard the EMAC SoM-150ES carrier board. Locate the HDR8 ANALOG I/O HEADER (circled).
Pin 15 is analog out 0 and pin 16 is analog out 1. Pins 1, 2, 17 and 18 are all ground.
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.
mcp4922_test C example project demonstrates how to access the on-board DtoA of an EMAC SoM-150ES carrier board.