Connect with us

Parallel Port/ ADC0820 help!

Discussion in 'Electronic Basics' started by [email protected], Jun 22, 2006.

Scroll to continue with content
  1. Guest

    Hello All, I have a serious problem getting my circuit to work, and
    maybe someone here can help. I read threads here all the time, and
    have gotten some help one or twice (who knows, maybe someday ill be
    able to give advice).

    Anyway, I'm trying to interface a simple circuit to my PC's
    parallel port such that I can read 8-bits of data from an ADC. I have
    several ADC0820's (http://cache.national.com/ds/DC/ADC0820.pdf) lying
    around so I am going to try to use them. My current circuit is as
    follows:


    Pin 1: Vin
    Pin 2: Pin 2 of Parallel Port
    Pin 3: Pin 3 of Parallel Port
    Pin 4: Pin 4 of Parallel Port
    Pin 5: Pin 5 of Parallel Port
    Pin 6: Pin 1 of Parallel Port
    Pin 7: +5 volts
    Pin 8: Ground
    Pin 9: Not Connected
    Pin 10: Ground
    Pin 11: Ground
    Pin 12: +5 volts
    Pin 13: Ground
    Pin 14: Pin 6 of Parallel Port
    Pin 15: Pin 7 of Parallel Port
    Pin 16: Pin 8 of Parallel Port
    Pin 17: Pin 9 of Parallel Port
    Pin 18: Not Connected
    Pin 19: Not Connected
    Pin 20: +5 volts


    Note that I am not using resistors neither between my ADC and parallel
    port nor between Vin and my ADC. Also note, Vin does not exceed +5
    volts.


    I currently have a small program (Visual Studio .NET) to see if my
    circuit is working. Note that I am using Inpout32.dll
    (http://www.logix4u.net/inpout32.htm) to access the parallel port.


    What I would is when I touch a wire lead from Vin to +5 volts to see
    255 printed to my computer monitor, and when I touch the wire to ground

    to see 0 on the screen. What I DO see is 189 or 188 printed to the
    screen when I touch the wire to +5 volts and 3 or 4 when I touch the
    lead to ground. I am very confused


    My (pseudo) Code:


    Out(890,32); //Turn on "Bi-Directional" mode and set pin 1 (pin 6
    of ADC0820) high.


    while(1)
    {
    Out(890,33); //Set pin 1 (pin 6 of ADC0820) low while
    keeping bit 5 high.
    Out(890, 32); // Set pin 1 (pin 6 of ADC0820) high again.
    printf("%d\n", In(888) );
    }


    END OF CODE
    Note pin 1 of parallel port is inverted so a 1 sets the pin to low.

    Parallel Port Reference: http://www.logix4u.net/parallelport1.htm


    What ISN'T wrong. My parallel port is ECP mode and DOES support
    bi-directional functionality, the ACD0820 chip is in working condition,

    and my parallel port is in working condition. Anyway, I hope someone
    has some experience with these issues and could give me some advice. I

    would really really appreciate it. Thanks, Lucas McGill.
     
  2. I'd start by disconnecting all the data lines from the ADC and tying
    them high and low, to see if you then get 255 and 0, to see if it's a
    hardware or software problem.
     
  3. I'd start by disconnecting all the data lines from the ADC and tying
    them high and low, to see if you then get 255 and 0, to see if it's a
    hardware or software problem.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-