Shop OBEX P1 Docs P2 Docs Learn Events
serial 4-channel 8-bit A/D — Parallax Forums

serial 4-channel 8-bit A/D

MaxbMaxb Posts: 16
edited 2005-03-17 22:59 in Learn with BlocklyProp
hi,

I tryed many things
but it seems that nothing's working

Here's my problem:
I am using BS2, and a special pin (8-pin DIP)
made by students
at Morgan State University.

I checked with an oscilloscope, and everything
is well-connected. I even received a bit flow

I have got 2 analog sensors (proxi, and pressure)
but no signal appears on my screen with the debug command...
I don't know what's wrong..!?

I would appreciate a little help
Thanks a lot

Maxb


[noparse][[/noparse]code]



Proxi VAR BYTE 'proximity sensor
SteerL VAR BYTE ' pressure sensor


DIR7 =1 ' make P7 an output
DIR8 =0 ' serial input

OUT7=1
PAUSE 500 ' be sure in idle state


LOOP:


LOW 14

OUT7=0
OUT7=1 ' bring /GO momentarily low

SERIN 8, 84, 2000, LED, [noparse][[/noparse]HEX2 Proxi, SKIP 1, HEX2 SteerL, SKIP 1, HEX2 SteerW]

DEBUG HEX ?Proxi ' display the result in decimal
DEBUG HEX ?SteerL



PAUSE 5000
GOTO LOOP

LED:
HIGH 14
PAUSE 3000
GOTO Loop

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-03-10 19:18
    Maxb -

    I can find no mention of a 4-channel A/D chip on Professor Anderson's web site, which is what I presume you're speaking about when you mention Morgan State. I can only guess that it's a unit that has been discontinued and there is no documentation for it on his web site.

    If this chip operates in a similar manner to the way his 8-channel A/D chip operates, I suspect you can add the following line of code to your existing program, right before the existing SERIN statement in your program:
    SEROUT 8, 84, 'Send any character to begin the data conversion

    and that should start the data conversion process. Since I have no documentation, you're on you own after that, presuming that works as I hope it will.

    Regards,

    Bruce Bates
  • MaxbMaxb Posts: 16
    edited 2005-03-10 21:41
    thank you mr. Bates
    for your reply,
    I appreciate,

    I tryed what you said,
    but ....same thing,
    no debug messages

    I plugged and tryed to receive a signal from ADC 0831, and something strange happened. I decided to switch of program, to go back on the Morgan program, and for the first time
    while pressing the reset buttom,I received some results from my last program. After 5-10 sec. it stopped.
    My debug box shows " debugger pane", what does it mean?
  • MaxbMaxb Posts: 16
    edited 2005-03-10 22:48
    Yapidu : )

    I resolved my problem by replacing my "broken"
    BS2
    by another one from the lab..

    isn't that great..." !
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-03-10 22:52
    Maxb -

    You may want to take a look in the Parallax PBASIC Stamp Manual at how DEBUG operates. In order to see any output from the DEBUG command, you must have a DEBUG window OPEN. Once it is open, anything sent via the DEBUG command will appear in that window. Once the program completes, the DEBUG window can be closed.

    The manual can be downloaded from the following link and is free:
    http://www.parallax.com/html_pages/downloads/basicstamps/documentation_basic_stamp.asp

    Some further notes. When using the ADC0831 you must use SHIFTIN, not SERIN to access the data Thus, if the Morgan chip uses SERIN, those two chips are not interchangable without modification of the program. The ADC0831 is also just a single channel device.

    Regards,

    Bruce Bates
  • StuartttttStuarttttt Posts: 45
    edited 2005-03-17 22:11
    Bruce,

    When interfacing the temp sensor, whats the advantage of using an ADC0831 in the Industrial control experiments, rather than just using the RCtime command ?

    Regards
    Stuart
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-03-17 22:59
    Stuart -

    Without actually running a test case my best guess would be greater accuracy and faster response. Among other things there's no charge time required to wait for the capacitor to charge up when using RCTIME. That's not to say the results are instantaneous with an ADC, as there is a conversion time required as noted in the data sheet.

    Regards,

    Bruce Bates
Sign In or Register to comment.