1
\$\begingroup\$

At present I am frustrated by the limitations of fixed-point arithmetic on a microcontroller for a quadrotor aircraft. The aircraft I am experimenting with is using an ATMEGA. I got to thinking, would it be possible to replace the ATMEGA with a single-point floating unit equipped DSP?

My requirements are:

  • 12 bit ADC
  • single percision FPU
  • 100 Hz control signal rates
  • would like gcc as a compiler toolchain

The existing control board has specifications listed online. It uses an ATMEGA1284P, and that is the part I am looking to replace. That would mean the CPU clock should be at least 20 MHz and there needs to be around 32 output pins, some of which support I2C.

If you have experience with DSP controllers and have some recommendations for this project. CPU part numbers that are available from digikey or online would be even better.

EDIT: latency changed to rate

\$\endgroup\$
  • \$\begingroup\$ I couldn't understand all your requirements but I suggest you to check Cortex-M4 ARM MCU's. For ex stm32f407. This is the MCU on ST's STM32F4-Discovery kit. \$\endgroup\$ – HeyYO Mar 8 '13 at 10:51
  • 2
    \$\begingroup\$ Hz is not a unit for expressing latency. You seem to have confused rate and period, which are the reciprocal of each other. \$\endgroup\$ – Olin Lathrop Mar 8 '13 at 15:26
  • 3
    \$\begingroup\$ Curious what exactly you mean by 32 "I2C" "output" pins. Most devices have only a couple of I2C transceiver blocks, though you can probably fake it with GPIOs at moderate speed. Do you literally mean I2C, or did you really just mean generic GPIO's? \$\endgroup\$ – Chris Stratton Mar 8 '13 at 16:02
  • \$\begingroup\$ Great comments, I've edited the question accordingly. \$\endgroup\$ – speciousfool Mar 10 '13 at 9:51
2
\$\begingroup\$

100 Hz is really slow for most micros. A dsPIC 33F or 24H, for example, can execute 400,000 instructions in that time.

Unless you are doing something unusual, you probably don't need hardware floating point. 400 k instruction is a lot, even if 100 or so at a time are used to perform individual floating point operations.

You probably don't really need what is traditionally cosidered "single precision". Note that "single precision" by itelf is a meaningless term in a absolute sense since it is machine and implementation dependent. Single is only meaningful relative to "double", with the only meaning that the latter has more precision and probably more range. Assuming you meant 24 bit mantissa, do you really need all that? As you say, measurements will be 12 bits, and the resulting outputs probably less than that. I often use a FP format with 16 mantissa bits in cases like this. That still leaves a few extra bits so that quantization errors from multiple operations stay below your original noise level, but generally maps better to available hardware and is therefore faster.

So instead of saying you need FP hardware, you should be saying what kind of operations you need to perform every 10 ms. There's a good chance to you don't need FP hardware to meet the spec. That leaves a much larger world of micros available to you, which can be useful for their other attributes, like a better PWM outputs to drive the motors, for example.

\$\endgroup\$
2
\$\begingroup\$

It sounds as if there's some optimization that needs to be done. But, in the end, if you still need floating point you can consider using Cortex M4 Microcontroller that has an FPU unit. There are many manufacturers for these such as Texas Instruments (LM4F), ST Micro (STM32F3, STM32F4), NXP, Freescale, etc.

DSP design is inherently more difficult than microcontroller design, so it depends on your experience level.

There's nothing nicer than avoiding having to convert floating point to fixed point.

\$\endgroup\$
  • \$\begingroup\$ Some good leads there. How is the GCC toolchain for the LM4F or ST32F4? \$\endgroup\$ – speciousfool Mar 15 '13 at 0:57
  • \$\begingroup\$ @speciousfool: it's good. I've used them and works pretty nice, especially for the price :D \$\endgroup\$ – Gustavo Litovsky Mar 15 '13 at 4:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.