Math Co-Processors

Go To Last Post
22 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I find myself needing the processing power similar to a DSP without the dsp[for now, which looks like it will change]; I've switched to an ARM7 platform and would still like to investigate what processing gains I can get from possibly tacking on a math processor. . .are there any small packaged suggestions[spi prefered] any of you can forward me?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What kind of calculations do you want the external processor to take care of?

Michael

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Multiply and divide of integers

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How fast do you need the calculations and how many bits are they? I'd be inclined to offload them to an FPGA, for real speed.

Leon

Leon Heller G1HSM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've seen articles on this Floating Point Co-Processor: uM-FPU, available from several sources, including this listing on Spark Fun: Here.

At $20 (USD) each it isn't cheap.

If you are doing integer math I'm not sure it will be of much benefit to you, but you can look at the data sheet.

It supports I2C, SPI, and serial interfaces.

Be sure to factor in the time to send it data, and read back the results, before deciding if it will gain you much.

I've never used the chip myself.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Most of these so called math co-processors are just pre-programmed micros. Handy if you're using a basic stamp but pretty useless otherwise. As the Doc mentions, the speed of getting the data in and out of the device limits your speed. Personally, I'd choose the most suitable processor for the job - if that's a dsp, then use a dsp - it's not like they're expensive these days or difficult to use. Something like an Analog Devices Blackfin BF537 zips along at 600MHz and can run uCLinux.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

uM-FPU, available from several sources, including this listing on Spark Fun

But that's just a PIC or an AVR that's been pre-programmed (presumably using a C compiler's runtime library?) to do a dedicated job. The actual performance is pretty dire. If fast maths it required the obvious candidate is some form of DSP. I've programmed the BF561 before now - it's rather cool having two of the 600MHz cores that Kartman mentions.

This is an interesting app note on the micromegacorp web site:

http://www.micromegacorp.com/dow...

The summary says:

Quote:
Execution time is improved by at least a factor of two for an Atmel AVR running at 16 MHz and by at
least a factor of four when running at 8 MHz

So there's a small gain in performance but it's not like it's orders of magnitude. If you ran a 32MHz Xmega I guess you'd be approaching parity.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Note the benchmark code in that application note:

a = 1000.0;
b = 0.001;
c = (a + b) / (a - b) * 100.0;
c = sin(a)
c = cos(a)
c = tan(a)
c = asin(b)
c = acos(b)
c = atan(b)
c = atan2(a, b)
c = exp(b)
c = log(b)
c = log10(b)
c = pow(a, b)
c = sqrt(b)

The code loads a couple of variables into the uM-FPU, and performs a series of operations on those variables, each returning one result. Each of the operations is something that would take many clock cycles on the AVR. The overhead of loading two variables, and returning one result for each operation, is not that high.

Contrast this with the case where you're looking to speed up a few integer multiplications/divisions which do not necessarily use a common set of parameters. Off-hand, I'd say there's no way you're going to see a performance improvement using a co-processor for this job. There's just too much information being pushed back and forth, and too little independent computation being done.

Michael

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Doesn't the ARM Cortex have a fpu ?

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There's no FPU on the Cortex! The OP wants integer arithmetic, anyway.

What's happened to the OP, anyway? Perhaps he's given up.

Leon.

Leon Heller G1HSM

Last Edited: Thu. Dec 18, 2008 - 09:51 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I agree that this one:

Quote:
Floating Point Co-Processor: uM-FPU
isn't high end. It is, however, well advertised and available, and "easy" to program. Hence enticing to those who haven't played with it. It won't begin to compete with dual 600MHz cores...

That said, one can sometimes gain an advantage IF you have other tasks for the main microcontroller to be doing while you offload the math tasks. If the main micro is just sitting there waiting for a result, then the "improvement" many be very disappointing, or even negative.

I think the later revisions of the above chip, or a similar one, also incorporate NMEA decoding. Feed it your GPS data stream and just quiry it for the parameters you want. Again, this can usually be done by the main micro, or by any chip you want to use as a data pre-processor.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

leon_heller wrote:
There's no FPU on the Cortex! The OP wants integer arithmetic, anyway.

What's happened to the OP, anyway? Perhaps he's given up.

Leon.

I'm still looking around. . .I plan to snag one of the TI DSP boards offered by Olimex as well as an ADI BlackFin to get a feel for the difference in # crunching ability as it applies to my application. . .thanks for all the replies, it's helped put things into perspective

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have used these from Al Williams. He is also a great guy with superb customer service (read: Newbie helper)

Just some guy

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I used a an ADI DSP for a similar application many years ago - we needed very fast integer arithmetic and some floating-point for Kalman tracking. The code was written in highly-optimised assembler.

They are now using a Blackfin.

Leon

Leon Heller G1HSM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

leon_heller wrote:
I used a an ADI DSP for a similar application many years ago - we needed very fast integer arithmetic and some floating-point for Kalman tracking. The code was written in highly-optimised assembler.

They are now using a Blackfin.

Leon

. . .and I'm guessing the performance was magnitudes greater than what could be expected of an AVR or ARM7?

Anybody have a feel for how the ARM9 stacks up against DSP processing?

At the moment, I'm proverbially creating my AVR/ARM/DSP/FPGA switch statement. . .

switch(ProjectRequirements)
     {
     case(Simple2ModerateIO)
            Chipset = Avr;
     break;

     case(ProcessingIntensive)
            if(____) <--trying to get a feel for this
                 Chipset = FPGA;
            else
                Chipset = DSP;
      break;
                .
                .
                .
      default: IdleAtAvrfreaks.net
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A dsp is used for digital filters and its ace up its sleeve is the multiply-accumulate instruction. Probably does both operations in one cycle. But any cpu with a hw multiplier outght to be able to do it in two instructions. I claim a 20mhz avr could do a digital filter using 8 bit coeficients (maybe some sort of 4.4 floating decimal or something) just as fast as a 20mhz arm. Furthermore, I bet the arm wins by a factor of two when everything goes to 16 bits.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've done some DSP for a v23 modem on an ARM7 and that chewed up half the cpu cycles. That was done in all integer and in C with only a moderate attempt at optimisation (algorthymic). If you want video, then you'll want something more specific.

The AVR32 purports to have some DSP support in the chip.

It's always a hard call to know what sort of performance you require for a given task - especially when you have no previous experience. These days, most micros have simulators and free tools, so to knock up a test scenario to get some real numbers usually doesn't require much cash outlay. Once you got some C code that does what you want, you try this on a number of candidates and see what 'fills the bill'. www.freertos.org has some benchmarks on a range of microcontrollers to give a relative 'feel' for what cpus are good in what areas.

Something new that might be of interest is the XMOS processor
www.xmos.com
it has 4 cores at 400MHz so it should do some swift calculations and in parallel. They even have a web based simulator.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

one of the TI DSP boards

Olimex only has one DSP board at the moment. What are you planning to use for software development? I envy you if you have the money for CCS and jtag.

Quote:

Something new that might be of interest is the XMOS processor

I was really excited about this processor and was about to order the development board until I realized it doesn’t have a single hardware peripheral. It goes the Parallax SX chip rout and says all peripherals (UART/I2C/Timers etc) should be implemented in software. Just doesn’t sit right with me even with such a high performance processor.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not having a single hardware peripheral is not entirely correct. The Xmos processor is a little different to most other processors you would've come across. Firstly it has direct hardware support for 8 threads per processor, each core has a high speed xlink to the other cores and to the outside world so data can be passed reasonably fast and the i/o is 'tightly coupled' - this differs from the usual 'loosely coupled' i/o peripherals you get with most micros - the peripheral sit on the cpu bus and the main method of communication is via interrupts ( and dma on some). The Xmos on the other hand, the i/o affects the processor. Each block of i/o has a timer associated with it that can do capture/compare type operations. If an operation is pending, it can suspend the execution of a thread until it completes or it can interrupt. So you need to think a little differently.
You would probably have one thread implement 8 uarts, another thread implement multiple counter/timers etc.

It's no the be all and end all, but nevertheless sits in the gap between standard style cpus and fpgas. There's also the Parallax Propellor cpu, but i think the Xmos trounces that in sheer performance and a classier architecture.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jheissjr wrote:
Quote:

one of the TI DSP boards

Olimex only has one DSP board at the moment. What are you planning to use for software development? I envy you if you have the money for CCS and jtag.

Quote:

Something new that might be of interest is the XMOS processor

I was really excited about this processor and was about to order the development board until I realized it doesn’t have a single hardware peripheral. It goes the Parallax SX chip rout and says all peripherals (UART/I2C/Timers etc) should be implemented in software. Just doesn’t sit right with me even with such a high performance processor.

It doesn't need hardware peripherals, that's the whole point. It can even do high-speed USB in software (480 Mb/s)!

Leon

Leon Heller G1HSM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I guess I am naive about the Xmos. Not having real hardware peripherals is not something I'm accustomed to but your information has enlighten me. Rethinking this, the Xmos really does seem like an awesome product. The only problem is its BGA :(

Edit:
Have you seen the Intellasys Seaforth? It is a 40 core processor that runs asynchronously (runs at the speed of the silicon, no actual MHz specified). I wonder what that entails.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It is possible to put the 144BGA part on a four-layer board, XMOS is working on a suitable fanout. I'm designing a six-layer board for a sort of XMOS Stamp.

The single core device will be available in QFN for $1 each in quantity. I'm quite sure that XMOS made the right choice, it's a very "clean" architecture.

I've got some Intellasys chips on order - over $60 each! They do have some peripherals. Their tools are crap, compared to XMOS.

I like playing with interesting hardware. 8-)

Leon

Leon Heller G1HSM