ADVERTISEMENT
You will be redirected to your destination in 10 seconds.
Electronics Industry Search
Advertisement
Email
Print
Reprints/License
RSS
Article tools sponsored by

Micromega Chip Does the Math

Jon Titus, Contributing editor -- Design News, March 19, 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

Email
Print
Reprints/License
RSS
Article tools sponsored by
Find a supplier on oemsuppliersearch.com

Talkback


We would love your feedback!


» Submit talk back
Advertisement

DN's Resource Center Get Free Information, Made Easy

Advertisement

Design News Partner Zones

AnarkCAD/CAE Model Clean-Up: Reduce Iterative Cycles
This webinar featured research and survey results related to problems associated with preparing CAD geometry for CAE applications.  We discussed how Recipe-Based Automation can help create "just-in-time" CAE-ready geometry each time a cad model is updated. Watch the Presentation


Light Matters: Systems Level Approach to HBLED illumination applications
Its good practice to apply a systems-level approach to high-brightness LED (HBLED) illumination applications. Minimally, the system includes the optical, thermal and electrical characteristics of the of the HBLED, the lens (if any) which is built-in to its package, secondary optics such as external plastic lenses/reflectors to direct the light as your application requires and power driver electronics. 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.

Design News Partner Zone Directory »

Please visit these other Reed Business sites