Skip navigation
Electronics Industry Search
Advertisement
RSS
Reprints/License
Print
Email

Micromega Chip Does the Math

Jon Titus, Contributing editor -- Design News, March 18, 2007

If you plan to design a small instrument that must accurately measure temperatures, you can use the types of sensors described in the past three columns. But, your microcontroller (MCU) may require some floating-point math operations to obtain real temperature values from “raw” digitized sensor information. You could use a direct-conversion look-up table or math operations found in most C/C++ compilers. Both approaches can chew up memory space and compiled math functions cut into processor time.

Recently, I experimented with a math IC that operates with floating-point and long-integer numbers. I used the eight-pin uM-FPU V2 chip from Micromega to communicate with a host MCU through a Serial Peripheral Interface (SPI) port. The V2 chip also works with Inter-IC (I2C or I²C) communications. If you need math capabilities, this chip and its new sophisticated uM-FPU V3 sibling require minimal programming. Both chips conform to the IEEE 754 floating-point standard.

In addition to performing standard math operations, the chips handle logarithms, exponentials, roots and trig functions. (The V3 chip also performs matrix operations.) Both chips offer plenty of temporary storage and preloaded constants such as e, pi, 1, 0 and so on. You also can program your own constants, which makes this chip particularly useful when you need polynomial equations and coefficients to “linearize” data from specific thermocouples, thermistors or RTDs to obtain real temperatures.

MCU vendors provide code libraries and documentation that ease the job of communicating with a uM-FPU chip through an SPI or I2C port. Thus you work with high-level commands rather than control MCU registers and bits. The uM-FPU chips accept data as strings of ASCII characters and commands as one- or two-byte operation codes, which simplifies programming. The LOG10 command (hex E2), for example, takes the base-10 log of a value and SQRT (hex E0) computes a square root. In C/C++ you predefine an op-code with a statement such as “#define SQRT 0xE0.” Then you can use the mnemonics to code uM-FPU-chip operations. The capability to work with numeric data as ASCII strings, rather than a mish-mash of hex codes and binary numbers, simplifies programming.

Because uM-FPU chips use many internal registers, it can take time to get used to how the chip manipulates values, handles operations and tracks data. But because Micromega provides a programming IDE, you can quickly develop code for several target processors. The code also creates uM-FPU “assembly language” listings for the chips, so you can translate them into the hexadecimal codes if you must go this route.

The listing above codes the equation as it would run in an uM-FPU chip. The LEFT and RIGHT commands properly handle the terms in parentheses. A complete uM-FPU listing would define constants and registers elsewhere.


Useful Links
Advertisement

Sponsored Content

Technology Marketplace

RSS
Reprints/License
Print
Email
Find a supplier on oemsuppliersearch.com

Talkback
Advertisement
Reed Business Information Resource Center

Featured Company


Advertisement

Design News Partner Zones

Light Matters: The Unsung Heroes of Modern Health Care
First, let's define "no-compromise." In an ideal configuration, this lamp would use a high-brightness LED (HBLED) that is built into a small, integrated package and is able to produce a large quantity of focused light, operate with a high level of reliability and generate no audible noise. Is this difficult? Yes, but it is possible.
Read More


Design Engineers' Portal for Sensing and Machine Safety
Whatever industry you're in, or whatever product you manufacture, the right sensors to automate your plant, and to improve your overall efficiency, quality and safety are a must. You'll find Banner Engineering to be an amazing resource of products, training and people with expertise.


Test & Measurement World Machine Vision & Inspection Report
Topics include machine-vision software, Power over Camera Link, thermal imaging and frame grabbers. Read More

Design News Partner Zone Directory »

Please visit these other Reed Business sites