Floating point math
Brian L
Posts: 60
1.) Is it worthwhile (meaning, would it speed things up?) to connect one of the uM-FPU coprocessors to a Prop, or are there objects in the library that allow the prop to handle floating point plenty fast on it's own already?
2.) Same question about connecting stand-alone ADC chips. I've seen references to the prop being able to do it's own ADC, but nothing very specific about it. I'd like to be pointed toward some documentation showing both hardware and software details how this is accomplished, and also hear some opinions about whether it is a fast and accurate way to do it, compared to a stand-alone ADC. And just how many bits of resolution can you get doing ADC on the prop anyway?
Thanks for any input,
Brian
( Witty catch phrase coming soon!! I just haven't thought of mine yet. )
2.) Same question about connecting stand-alone ADC chips. I've seen references to the prop being able to do it's own ADC, but nothing very specific about it. I'd like to be pointed toward some documentation showing both hardware and software details how this is accomplished, and also hear some opinions about whether it is a fast and accurate way to do it, compared to a stand-alone ADC. And just how many bits of resolution can you get doing ADC on the prop anyway?
Thanks for any input,
Brian
( Witty catch phrase coming soon!! I just haven't thought of mine yet. )
Comments
Re the ADC. You can find the AN001 document on the COG counters on the Parallax web site, downloads page, and it shows how to set up the sigma delta mode. This recent thread http://forums.parallax.com/showthread.php?p=677204 also gets into it and has links to earlier discussions. Again, it comes down to what you want to do. Dedicated chips can have a wealth of features that are not possible with the built-in mode. For example, if you want high input impedance or a differential input, you could add some analog circuitry, but at that point it might already be time to look at an offboard ADC. Or if you need lots of ADC channels, you might need a mux anyway. As sigma-delta converters go, the Prop version has only a first order loop filter and has noise issues and cannot match the high stability and resolution of a dedicated sigma-delta chip. In order to achieve the best results with the Prop ADC, one has to pay close attention to circuit layout. That said, the Prop ADC can be fast enough for low res audio as seen by many of the examples here, and it is be great for minimalist situations, or situations where special timing or programming is part of the ADC algorithm.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
(1) Speed: The (few) FloatMath functions (+,-,*,/) give you insight into how FP simulation is done. There is no speed to mention. I displaced my benchmark results I did half a year ago, but they work within miliseconds per operation.
Float32 is fine, and also quite complete wrt basic mathematical operations, also trigonometry; there are also variants of Float32 with many more quite specific functions (e.g. nautical!). Most work within 10µs per operation; using 6 oder seven COGs altogether the Propeller comes close to a 1Mega-FLOPS machine, which is quite remarkable...
The FPU Chip is a garden variety of a microcontroller and does nothing else. As it is not as powerful as the Propeller it is basically slower than Float32! However it is much more "intelligent", as all its code is dedicated to FP processing. However this "FPU's" working can completely (and faster!) be emulated on the Prop if you will take the time to code all algorithms in Propeller machine language!
(2) ADC We are nowadays accustomed to have an ADC integrated within an MCU without much scrutinizing its accuracy in the hobby scene... Stabilizing and calibrating high speed precision ADCs is still a challenge. I personally see it to be a good thing that you can (have to) choose your ADC from a transparent market rather than be bound to a MCU supplier's good taste...
Delta-Sigma modulation works fine, but it has to be adapted to each situation anew. You have to understand what you are doing!
(3) Documentation: All "objects" are undocumented and "as-is" wrt industrial standards. For accessing the FPU there is not even an interfacing object (I think..). The interface to many ADCs is wrapped into object, but generic Delta-Sigma modulation has to be adapted for each case.
You are not coming to a settled situation here! This is gold digging we are doing Be welcomed!
Post Edited (deSilva) : 12/22/2007 9:45:02 AM GMT
On the ADC issue:
I was already leaning toward the use of off-chip ADC, because I like (and need) the multiplexers and the sample-and-hold function that is included in many of those devices. However I'm still a little bit curious and confused about the Delta-Sigma method of AD conversion. Until I started reading about the Prop I'd never even heard of this. I already understand the successive approximation method used by the stand-alone ADC's, and I'm pretty impressed with how well it works. But I've just finished reading the AN001 Prop Counter document, and it didn't really give a very basic introduction into the operating principles of how Delta-Sigma works. I did however, notice a few remarks on page 17 that seem to throw doubts on the accuracy and noise immunity of Delta-Sigma.
So here's the new question:
Can anyone point me toward some introductory information about how Delta-Sigma AD conversion works? I suspect that it may prove useful in the future and I'd like to understand it, even though I probably won't use it right now.
Thanks.
Delta-Sigma modulation is neither new nor uncommon. You might have lived in the early period of CD players: They started with 10 to 11 bit accuracy, a good one had 12, then 14. After some years 16 bits was considered "high-end". Then it became "1-bit"
That was when the high frequencies (30 to 100 MHz) required for high resolution delta-sigma could be controlled in cheap consumer devices.
Delta-Sigma has nearly advantages only, Second or higher order delta.sigma has an extremely high signal/noise ratio. The drawback is, that is is very touchy to external effects and has to be built according to the best HF standards possible.
I generally recommend reading this www.beis.de/Elektronik/DeltaSigma/DeltaSigma.html
Edit:
I just see: Philldapill is giving some of those Delta-Sigma ADCs away www2.informatik.hu-berlin.de/~hochmuth/bvp/ads1210.pdf
in exchange of a simple SPI driver ...
Take your chance
Post Edited (deSilva) : 12/23/2007 10:44:47 PM GMT
Did you take a look at the threads on sigma-delta here on this forum? The principle behind it as implemented on the Propeller (or other microcontroller) is very simple. The complexities come from the higher order filters and sampling theory. There are also good tech notes on the Linear Technology web site. Successive approximation converters top out at 14 bits, maybe pushed to 16, most common at 12.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com