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
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
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 confusedMy (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: