Has anyone any idea where I can get a double precision maths library which will work with the Keil C51 compiler.
Unfortunately the hardware was designed when I arrived on the scene so I have to make the best of a bad situation. However, there is not much choice available when one wants a single chip with 24 bit adc, SIO, PIO, I2C and on board programming built in. As far as $5000 for a library is concerned, it is possible to buy a complete development system with full double floating point 'C' compile for a lot less than this.
The problem here is not just C.
The float implementation of C51 uses registers for float operations. It can do this because there are eight 1-byte registers and each float only uses 4 bytes. So, C51's implementation is actually pretty fast.
When you start to implement double operations, you need 8 bytes for each operand and 16 bytes for both. So, you can't do everything in registers. Assuming that you could do everything in registers, I'd expect most operations to be at least 4 times slower. Since you'll have to swap registers out to memory, a factor of 10x is probably not too bad.
Jon
We have considered using interpolation and thats the way we are now doing it. We have succeeded in using 64bit integer maths with that so there is no need to go to f.p.
Hello Jon Thanks for the explanation - that makes perfect sense. Coding now complete... into testing. best regards - Paul
"The processor (Cypress CY7C68013) was chosen becaus it has a built in USB2.0 engine." Presumably, that means that it'll be connected to a PC? Could you no send the "raw" data to the PC, have the PC do the number crunching, and perhaps send the results back? Or is it not always connected to a PC?
To change tracks now would costs fortune (re-designing & tooling a large multi-layer PCB). well a "fortune" IS a relative term, but changhing a processor would cost one hour for my layout person and ~$500 for 2 new prototype boards from the contract manufacturer. How must does it cost for you trying to find a way around the problem using the board you have? Erik
"Can you still buy those 8087 maths co-processors...?" How about these: http://www.dcd.pl/acore.php?idcore=13 http://www.dcd.pl/acore.php?idcore=14 http://www.dcd.pl/acore.php?idcore=28 http://www.dcd.pl/adatash.php