interfacing ADC0841
charlieknox
Posts: 27
HI Folks· - anyone got experience or ideas on interfacing an ADC0841 analog to digital converter ( http://cache.national.com/ds/DC/ADC0841.pdf ) to the Basic Stamp 2?· I am familiar to and have used the ADC0831, but·need to use the 0841 if that is possible.· Any help in that regard would be much appreciated.
Thank you!
Charlie
Thank you!
Charlie
Comments
That said, based on the data sheet I would do this (connect the ADC0841 bus to P0 - P7):
Setup:
· HIGH AdcCS
· HIGH AdcWR
· HIGH AdCRd
Main:
· ' your code here
· GOTO Main
Get_ADC0841:
· LOW AdcCS··········· ' select device
· PULSOUT AdcWr, 1···· ' start conversion
· HIGH AdcCS
· PAUSE 0············· ' allow for conversion
· LOW AdcCS
· PULSOUT AdcRd, 1···· ' transfer value to outputs
· HIGH AdcCS
· adcVal = INL········ ' read value
· RETURN
Mind you this code is off the top of my head, very late at night (I should be in bed), and without the part to test with....
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
Post Edited (Jon Williams) : 4/12/2005 5:14:19 AM GMT
Thanks again,
Charlie