Shop OBEX P1 Docs P2 Docs Learn Events
Math! Analaogue or digital chips ? — Parallax Forums

Math! Analaogue or digital chips ?

ArchiverArchiver Posts: 46,084
edited 2004-04-07 04:47 in General Discussion
--- In basicstamps@yahoogroups.com, "Kristoffer M. Hain" <haink@k...>
wrote:
> First off, thanks for everyone's reply on my DIG problem...got that
working
> well. Now, what I'm trying to do is rather complex (for me!)
>
> I need my bs2p to crunch this:
>
> TEMP = ((2.294 + (255 - ADCVAL) * (1.5) / 255) - 2.294) / (0.01 /
1.8) - 40
>
> TEMP is going to be an output temperature, and it can be an integer
value,
> I'm not worried about 78.2 or something silly like that. 78 is
> fine. ADCVAL is a number from 0-255, coming from an ADC0831.
Is there
> a better way to do this? I'm using an LM335AZ Precision temp
sender with
> the ADC...which are both fairly common chips, and I have all the
code to
> SHIFTIN from the chip....just need to convert the 0-255 to a
useable
> temperature. I know the above formula will do what I want, because
I have
> that line in a VB program I wrote a while back that uses both of
those
> chips....
>
> Thanks!!
> Kris Hain


Odd, I think my first post got lost.....


The LM70 is a serial unit. offers higher resolution than the 8 bit
ADC and should be much easier as you need to use a serial comm to
talk to the ADC. With a serial temp sensor you only need to do the
serial.

Dave
Sign In or Register to comment.