Вы находитесь на странице: 1из 7

Using the Parallel port to connect the PC with a breadboard.

Operative System used: Ubuntu 8.04.4 LTS (Hardy Heron) Desktop PC (Intel x86). Information: http://releases.ubuntu.com/8.04/ Download: http://releases.ubuntu.com/8.04/ubuntu-8.04.4-desktop-i386.iso Update: Also works on Ubuntu 11.10 (Oneiric Ocelot) Desktop PC (Intel x86) Information and Download: http://releases.ubuntu.com/11.10/ MotherBoard: Asrock 945 GCM-S. Information: http://www.asrock.com/MB/overview.asp?Model=945GCM-S Parallel Port: PCI Manhattan Parallel Port. NetMos Technology 9865. Information & Driver (useless): http://www.manhattan-products.com/en-US/products/8225-parallel-pcicard Parallel Port Device Information (DB25 / IEEE 1284) & Development Information

IEEE 1284 https://en.wikipedia.org/wiki/IEEE_1284 Parallel Port https://en.wikipedia.org/wiki/Parallel_port Lava - IEEE 1284: Parallel Ports http://www.nor-tech.com/solutions/dox/ieee1284_parallel_ports.pdf Linux I/O port programming mini-HOWTO. Author: Riku Saikkonen http://www.faqs.org/docs/Linux-mini/IO-Port-Programming.html pyParalle 0.2: Author: pySerial http://pyserial.sourceforge.net/pyparallel.html http://sourceforge.net/projects/pyserial/files/pyparallel/

PORT NAME LPT1 LPT2 LPT3 Pin No (DB-25 pin) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18-25

Interrupt # IRQ 7 IRQ 5 IRQ 2 Pin No (36 pin) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 32 31 36 19-30,33,17,16 Signal name Strobe Data 0 Data 1 Data 2 Data 3 Data 4 Data 5 Data 6 Data 7 Ack Busy Paper-Out Select Linefeed Error Reset Select-Printer Ground

Starting I/0O 0x378 0x278 0x3bc Direction IN/OUT OUT OUT OUT OUT OUT OUT OUT OUT INI IN IN IN IN/OUT IN IN/OUT IN/OUT -----------

Ending I/O 0x37f 0x27f 0x3bf Register - bit CONTROL 0 DATA 0 DATA 1 DATA 2 DATA 3 DATA 4 DATA 5 DATA 6 DATA 7 STATUS 6 STATUS 7 STATUS 5 STATUS 4 CONTROL 1 STATUS 3 CONTROL 2 CONTROL 3 -----------Inverted YES NO NO NO NO NO NO NO NO NO YES NO NO YES NO NO YES -----------

Installation and development in Python using pyParallel Install Ubuntu Hardy Heron. No special configuration needed. After installation, turn off the PC and install the Parallel Port PCI card. Turn on the PC. Exit terminal and restart your PC. Enter the BIOS and look for the Parallel Port Options (SuperI0 Configuration). Select BI-DIRECTIONAL Mode. Save changes and EXIT. Access Ubuntu.

Open the Terminal and execute: $ sudo lspci -v (This will show you all the active interface. Look for the one that says Parallel Port NetMos Technology 9865. If the interface does not appear, check that the PCI card is correctly inserted.).

Now that the interface appears, copy the lines that say something like this: Region 0: I/O ports at ec00 [Size = 8] (At ec00 may vary from pc to pc). Region 1: I/O ports at e880 [SIze = 8]

Copy the region 0 address (ec00). Ill name it address A. A= ec00. Continue in the terminal: $ sudo cat /proc/ioports | grep parport $ sudo modprobe -r lp $ sudo modprobe -r parport_pc $ sudo lspci -v (Check Interfaces again) $ sudo modprobe parport_pc io=0xA (A = ec00) $ sudo modprobe lp $ sudo /etc/init.d/cups restart (This DID NOT worked on my PC. Works in Ubuntu 11.10) $ sudo nano /etc/modprobe.d/parport_pc Write: options parport_pc io = A (A=ec00) Press Ctrl + X Press key Y Press Enter You wil exit the interface

$ sudo nano /etc/modules (You will enter a new interface, look for the line that says lp and before it, write parport_pc). parport_pc lp Press Ctrl + X Press key Y Press Enter

Access Ubuntu and open the terminal: $ sudo apt-get install python-parallel When the installation is complete. Now we can test if this works. In the terminal: $ sudo rmmod lp (We stop the access of lp to the parallel port) $ sudo modprobe ppdev (We gain access to the port) $ sudo python (Start python)

In python: >> import parallel >> p = parallel.Parallel() >> p.setData (X) (Send 5V through the parallel port. Using 8 LEDs will turn them on using binary numbers. Example: 255 will turn on all the 8 LEDs.) (0<=X<=255) >>p.setData(0) (Stop sending data)

Basically, that is all. Twitter: @aerojun Reddit: aerojun

Im still looking for problems, but you can send me your doubts.

Jun Singht.

Research Information:
Python Parallel Port Programming on Ubuntu Linux. Author: Pl GD. theorieswithproblems.com/2008/ 04/22/python-parallel-port-programming-on-ubuntu-linux/ Python parallel port control. Author: Mike Szczys http://jumptuck.com/2011/11/14/python-parallel-port-control/ NetMos Technology PCI 9865 Parallel Controller card install how-to for Ubuntu. Author: joecrow http://ubuntuforums.org/showthread.php?t=1304178

Вам также может понравиться