Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Nut Counter!!! :)

Status
Not open for further replies.

Shadimania

Electrical
Feb 15, 2002
3
i am making a device which will be counting nuts (bolts) coming thorugh a optoreflector or an LED/LDR combination. and this would have to be connected to a parallel port. anyone here can help me understand how to send 1 and 0's to the computer parallel port to communicate and use the data in a program on the PC?

am sort of confused with what actually goes to the port when the circuit is broken (hypothetical circuit)

i would appreciate any help :)
thankyou
 
Replies continue below

Recommended for you

Search for the keyword &quot;parallel port&quot; <nbucska@pcperipherals.com>
 
PC parallel port does have a few bits that can be read in the printer status register. Just take whatever the number of bits you need to count your nuts, which may be defined as a leading edge plus a trailing edge (010.

Obviously the case of two or more nuts stick together must be considered.



 
I just wrote a program that controls the Parallel port. The command in QBasic is OUT Reg, Data and Data = INP (Reg). In 8086 assembly it is OUT Port, Reg and IN Reg, Port. Another freebee is that most parallel ports are located at either 378h (most common) and 278h. Also, make sure you are using a bi-directional parallel port (PS/2, EPP or ECP). The really old ports are output only (on the data bus). However, if you cannot get a hold of a bi-directional, you can always use the 4 control bits as inputs to read in values. Just a thought.

Hope this helps and keep us posted!!!

P.S. Make sure you do a search on Parallel Ports!!!!!
 
You may find the address of the parallel port at 0x0000:0x0408 (LSB-MSB) Usually it is 0x378 as Melona wrote. <nbucska@pcperipherals.com>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor