PDA

View Full Version : ADC Programming



sameia
03-11-2010, 04:33 PM
http://forums.parallax.com/images/smilies/cry.gif·hi there,

i am a senior student and i has a project that need to be programmed in BS2, my problem is that i must use this program and i don't know how because our programming course was about C++ and visual basic so i am stuck now. so Plz i need an expert to dirct me and i wana now how to get the programming og ADC ..

need your experiance as soon as possible.

Bean
03-11-2010, 08:22 PM
I have recently used the MCP3204 http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/MCP3204/List/0/SortField/4/ProductID/574/Default.aspx
and have found it to be easy to program. The link above has the demo programs for the BS2.

Bean

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use BASIC on the Propeller with the speed of assembly language.

PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
·

sameia
03-11-2010, 09:53 PM
what i need is programming ADC0809 -8 bit by using BS2

with PIN= A,PIN2=ALE,PIN3=SC,PIN4=RD,PIN5=EOC

stamptrol
03-11-2010, 10:58 PM
If you've done VB, PBASIC will be very quick to pick up. And, since someone has told you the pins to use, it gives you something to aim for.

The a/d chosen is not very complicated and the datasheet is the place to start.

Hook it up, start writing and let us know the specific snags you run into.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk

http://www.siskconsult.com
·

Jimbo30
03-11-2010, 11:18 PM
You can also use the ADC0831 8 bit A to D.· It is really not as hard as you think.· If you are using a sensor, just make sure you know what type and if that sensor can be easily hooked up to the ADC & the Stamp.· For example, if you are using a resistive type sensor make sure you know the difference between linear and nonlinear because you will run into all kinds of issues with nonlinear types.·

sameia
03-16-2010, 10:35 PM
i started my programming but now i am stuck on what command i should use to wait for EOC=0

stamptrol
03-17-2010, 12:41 AM
Suppose you have the EOC (end of conversion) connected to pin 5. Check the data sheet to see when EOC changes state. Suppose it goes high at the end of conversion.
Also, check out the IF-THEN-ELSE construct as it may give some more flexibility in program flow.

main:
if IN5 = 1 then DOTHIS
···· do these steps if IN5 is still 0
goto main

dothis: ' label where you process data after the conversion is done
····· process the newest data
goto main

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk

http://www.siskconsult.com
·