Parallel Port & Microcontroller

Status
Not open for further replies.

Omar.M

Member
Hello!
I would like to try some simple room automation projects, and use the parallel port to allow me to control different aspects of my room.
I think I could pull it off simply enough; wait for port.x to be high, and when it is (after receiving signal from parallel port), do a set of actions.

I am aware that I will need a level converter, and this would be easy enough if I was using a serial port with the max232 chip. However, I have no idea which chip I would use in order to adequately communicate with the PIC using the parallel port.

The reason I am stuck with the parallel port is because my computer (that is in my room) does not have a RS-232 port. And just for some background information: I will use a PIC16F628A to play around with this at the beginning, but may move up to a PIC16F871 if I am in need of more pins.

Thank you very much for your help,
-Omar
 
If you are interested in using USB take a look at the **broken link removed**. You can build one or buy one from sparkfun.com.

On the PC the drivers emulate a COM port.

The author has some nice examples on how to use it.
 
Thank you.
Currently, I'd like to keep this as simple as possible while using the parallel port.
I figure if there are some chips that are made for this, I can pick them up for a few dollars each, instead of the kit for 20 dollars + shipping.

I'd like to make the module you linked, but I do not think that my programmer can program that USB PIC chip!
Once again, thank you for the suggestion!
-Omar
 
Last edited:
Omar.M said:
Hello!

I am aware that I will need a level converter, and this would be easy enough if I was using a serial port with the max232 chip.

-Omar
The parallel port logic levels are +5V and 0V. No level converter is needed.
 
Hi Omar,
If you wish I could post a test program and information for the parallel port.

Eric

EDIT:

Attached zip for PC port.
You require the Visual Basic 5 runtime files from the web, they are free.
Let me know if you have a problem
 
Last edited:
Thank you very much, Eric.
I haven't had a chance to try the softare out (I do not have that DLL-- must go on a hunt soon to find it), but I think it will do.

3v0-- that is great news, thank you! Does that mean that I can connect the parallel port ground to the microcontroller's ground, and just connect the parallel port pin to the microcontroller pin and they should interface fine?
-Omar
 
Omar.M said:
3v0-- that is great news, thank you! Does that mean that I can connect the parallel port ground to the microcontroller's ground, and just connect the parallel port pin to the microcontroller pin and they should interface fine?
-Omar
Yes, see Eric's code to determine how to hook it up.

EDIT: Eric's zip has a .doc file with all the info you should need. He suggests you buffer the lines if the cable is over a meter.
 
Last edited:

hi,
There are two DDL's usually required for the PC if the operating system is WinXP. ie: inpout32.dll [thats in the zip] and Dllport.dll from the web.
Place these two DLL's in the Windows/System directory.

The VB5 runtime files are available from a number of sites on the web.
They are not included in my zip as they are > 1MByte.
Its a good idea to have the runtime files loaded as many web downloads expect to find them on your PC.

Feel free to use/edit/distribute the VB source code as you wish.

Eric
 
Thank you very much both of you.
I have the breadboard hooked up, and my LED lighting test is working (after receiving a 1 on the pin, microcontroller turns LED on).
This will open up a window of opportunity for me, and I thank you both very much for your help.

-Omar
 
3v0 said:
The parallel port logic levels are +5V and 0V. No level converter is needed.
Funny, ISTR hearing that though they used to be that, they aren't nowadays on modern PCs (assuming modern PCs still have the things), but are 3.3V instead. I might have got my wires crossed I suppose, but...

The first PIC programmer circuit I tried to build used the parallel port (someone else's design). DIDN'T go well. I was able to have a slightly modified version of the circuit turn (current-limited) LEDs on and off fine from the computer, but AFAICT it was messing up when it came to using the lines for actual high-speed communication, as it always failed with programming. I've heard other people opine that the parallel port has become horrible to work with, unfortunately.

(FWIW, I'm nowadays working on a serial-port based design of my own instead for various reasons, so no worries about advising me on that parallel version! I could never be entirely certain what was at fault as there were too many unknown quantities involved, and there were other problems with that programmer, so this makes more sense to me)

Anyway, good luck Omar, hope your project goes better than mine did
 
hi Tomble.

>>>Funny, ISTR hearing that though they used to be that, they aren't nowadays on modern PCs (assuming modern PCs still have the things), but are 3.3V instead. I might have got my wires crossed I suppose, but...

You havn't got your wires crossed, the parallel port pins are typically +0.4/+3.5V.
I have found if the cable is over a metre long you can have edge problems.

Its recommended that you use buffer ic's on the I/O lines, this will give very reliable performance.

Eric
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…