Propeller Question...
xnederlandx
Posts: 4
Hi,
I've read the manuals etc. it says something about Analog to Digital Conversion (CTRA/CTRB ?), but not in much detail
Can the propeller do Analog to Digital Conversion, and If so how many bit is it?
Would you have any coding examples (for Spin)?
Thanks in advance.
Post Edited (xnederlandx) : 6/7/2008 9:28:40 AM GMT
I've read the manuals etc. it says something about Analog to Digital Conversion (CTRA/CTRB ?), but not in much detail
Can the propeller do Analog to Digital Conversion, and If so how many bit is it?
Would you have any coding examples (for Spin)?
Thanks in advance.
Post Edited (xnederlandx) : 6/7/2008 9:28:40 AM GMT
Comments
en.wikipedia.org/wiki/Delta-sigma_modulation
Chip shows an example here of both ADC and DAC.
http://forums.parallax.com/showthread.php?p=576575
Taken from my thread index which you may find helpful:
http://forums.parallax.com/showthread.php?p=609066
Graham
Thanks again for that, I read your SPIN EXAMPLES for BEGINNERS GUIDE, its great and has taught me a lot !
I have a 12bit ADC In...
I've been looking at Objects with floating point (?) calculation but they're all so complex to me...
How can I find the square root of the 16bit ADC in (with decimal)?
Sorry for asking so many questions... [noparse]:([/noparse] I'm new to the propeller and the SPIN language.
Thanks again.
Post Edited (xnederlandx) : 6/7/2008 8:20:41 AM GMT
result := ^^( ADCvalue * 100)
If you want the square root to 2 decimal places (as a scaled integer), you'd do:
result := ^^( ADCvalue * 10000)
Similarly, three decimal places would be:
result := ^^( ADCvalue * 1000000)
Note that this last case will only work for a 12 bit ADC value because of overflow of the 32 bit intermediate result