Let’s take a quick look at what it takes to read from the ADC inputs of a i.MX28 based embedded system using example C code provided by Technologic Systems. Now, while this can be generically applied to many i.MX28 based embedded systems, we’ll be working with a TS-7680. Right, let’s get started!
This guide aims to get you through the basic steps of getting your TS-7400-V2 up and running so you can begin development. It’s mostly an extrapolation of the official TS-7400-V2 Manual, but provides a more practical and casual approach in setting up connections, networking, and general environment.
Here’s an example program our engineers might find useful. Kris Bahnsen, a long time engineer for Technologic Systems, wrote this simple program to get the voltage input (Vin) on the 8 – 28 VDC power rail on the TS-7670(Rev. D or later) or TS-7400-V2 (Rev. B or later). Without going into too much detail about implementation of the on-board supervisory microcontroller, there is a register which is used to store various ADC values, including Vin. This example program basically polls this 4byte register via I2C interface, accounts for the voltage divider (see TS-7670 schematic or TS-7400-V2 schematic), and spits out the Vin value. So, without further ado, here’s the code: