Home

Admin Ingo
Attachments
MCP3008_bb.png (286050 bytes)
MCP3008_schem.png (115840 bytes)
mcp3008.gif (55074 bytes)
There is a newer version of this page. You can find it here.

[ToC]

Hardware

This driver supports an A/D converter from Microchip technology inc. It is an SPI device, which features 4 or 8 analog channels, which are autonomously sampling the signals at a pretty high rate:

  • 75ksps at 2.7V
  • 200ksps at 5V

This is far beyond what we are able to read via Linux over SPI.

Prerequisits

You need to have the device description and driver library installed from the "MCP3008" project.

Usage

This driver can be used in a similar way as most other CODESYS devices. Except, that the outputs are not mapped through the I/O mapping, but they are privided as an output of the FB from the device tree.

Add the device

The device is named MCP3008 and has to be inserted below an SPI Master of your project.

  • Right click on SPI master
  • Add Device
  • Select the MCP3008

Configure the SPI port

The SPI port, which is configured at the SPI master has to be set to the SPI bus, where you connected the MCP3008.

  • Double Click on the SPI Master
  • Set the configuration parameters