Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Computer port control, but which 1?

Status
Not open for further replies.

crazymonkey

New Member
Hi guys, i'm interested in the field of robotics. I have done some research into electronic control and now want to venture into making computer controled robots. Could anyone who is experienced in this field please tell me which port (parallel, usb etc.) is easiest to build an interface for and how to do it. Thanks.
 
Its good to start whith the printer port since you have 12 outputs (5 inputs) so you yust wire some tranisitors on it and thas it.USB is wery comlicated.As for the serial port you need some kind of a cip if you want more than 1 ouput.
 
The first easy port to control is COM (serial port). You only need to set some parameters to control the port, and it needs no driver to control it. For parallel port, it will be more difficult if you use it in win 2000 or higher versions. However, as you use parallel port, it's as simple as you directly control a MC.

USB is difficult with driver chips, and those chips are so expensive (bout 20 - 40USD). It can get very high speed of transceiving.

In each specific application, you need to use suitable communications. In PIC 16f877, there are enough standard of communication such as parallel slave, serial interface, and I2C. I've ever tried with USB. If anyone have done USB interface project with PIC pls send it to meeh. Thanks muchies.
 
Try www.beyondlogic.org. In my opinion the printer port is the easiest. At work I used it to turn on a motor using only a Solid State Relay and an AC motor. You may want to use a card printer port, not the one on your motherboard.

Debug
out 378,1 pin # 2 turn on
out 378,0 pin # 2 turns off

Qbasic
out &H378,1
out &H378,1
Use a meter to test. Vbasic takes a little more. See Jan Axelson's "Parallel Port Complete."
 
Yeah, the only problem to parallel port is when you use higher windows version. As I use XP and programming on .NET, I have to change some default files of system32/dllcache folders.

Besides, as writing program for LTP, you have many choices that make you confused, and usually, it's like a closeloop control because you can have feedback signal at next instruction.

But if you use COM, there are only one byte to move out or in. You can drive the LTP upto 12 outputs and 9 inputs nearly at the same time. For bidirectional port, you have 8 inputs for more. Well, I don't think programming is easy in this way. But because LTP is as simple as TTL standard, you can use it nearly a MC, and maybe because of that, you feel the LTP is easier. It's oki.

COM to meeh is easier, because they did write many routine on it, you only have to copy and paste to your program, and it run. You don't have to care about anything else.
 
Parallel Port under Windows XP

I needed to use my parallel port in a project i was doing under windows XP, so i hade to make a program that can help me out do so, it's a very simple prog, no fancy stuff, only controls the data bits..

here's the link..

http://www.geocities.com/khaluda_5/misc/k/_sgt/m1m1_1.htm

N.B. you need MS framework for that to work (you'll find a link at the web site)

:wink: enjoy!
 
Sorry, Because of Vietnamese firewall, I cannot view your program. (I cannot visit www.geocities.com....

But if you wanna use parallel port in win XP, you can follow this steps:

1) You only can do it if your XP run under FAT32

2) Boot your PC under DOS

3) Use NC to rename Windows\System32\Dllcache folder to Windows\System32\Backup_dll (for example)

4) Go to this site www.lvr.com and download .dll file and copy it to system32 folder.

Why you have to do so?

1) .dll files in dllcache folder are the files used to backup XP's .dll files as it is changed. It's automatically done. You will see that if you copy portio.dll to system32, you can use it only one times, after you restart the PC, you cannot use it again.

2) As you rename dllcache folder to backup_dll, XP cannot recognize this folder and cannot backup .dll files

3) But XP do not allow you to rename this folder in windows, you have to boot your PC under DOS to do so

4) As you don't want to use portio.dll, you can easily rename backup_dll folder to dllcache folder. XP will automatically backup all .dll files unexpected by XP.

Goodluck.
 
I think the parallel port is easier to work with. Well i guess im biased since its the only port ive ever used in my robotics apps, but doesnt the user have to consider baud rate and handshaking when programming for the serial port ?
 
Yeah, but I said, if you had done a serial communication once, you can use it ... forever. If you wanna change the baud rate, you only have to change some parameters. As communicating via serial, you don't have such many choices as parallel. For beginners, they can come to some page as the link I gave above, and download for standard 9600 bauds interfacing. And they can use it at any baud rates by changing the parameters.

But to parallel, as you use it, you have many choices and it depends on our applications. and to a given application, you have to think how to use parallel port more carefully than use with COM for a good design. It's the difficulty, I think so. Because the problem is not the first time you use the port, but how you use it forever.


As I began with computer interfacing, I think parallel port is the easiest port to use, because it is TTL standard, and we can use it identically as a MC, but now, if someone try with serial interface once, just one times, it's enough for him to use the serial port forever. But the first time of use is now easy, because people wrote many subroutines and posted them online, just copy and paste, beginners can use it with ease (they wrote in many programming language Basic, C, Pascal..... )
 
parallel or serial?

i think parallel is best way to start as well. it's parallel data transfer, works with 5V, and it's breaking training on communications. rs232 has many more factors to consider.
 
If cost is a consideration, that also rules out the serial port you need a decoder, and for proper useage you need a MAX232 or similar to bump up the signal to +-12v true RS232 levels, The parallel needs nothing at all to begin interfacing

(example: 1 led, 1 resistor, 2 lines of VB code = flashing led project", this would cost about 10p to do, doing the same thing on a COM/Serial port will cost at least £2)

The parrallel port is definatly the way to go for beginers, it is unbeliveably simple, and as for that whole WIN2000, XP thing - download INPOUT32 and its only one file and will control parallel port on ANY version of windows 95 or later. INC 2000 and XP.

BTW - The parallel port is also at least 10 times faster than serial, and USB is even faster, though USB is still serial, and hence costs more to do - also A LOT more software needed to drive a USB device.
 
Perhaps, we are discussing on the point of view on robotic applications, aren't we?

I saw the ease or the difficulty from the standpoint of a robot. As you program for transmitting and receiving data from a PC to a robot. If you use LPT, you have to determine which pin you are using, and how to control the combinations. But the serial, you "cannot" do this. However, as "cannot" you have advantages that you don't have to do anything else.

You will see that why parallel port is always slower than com port communication. and the serial communication nowaday is very fast.

In theory, parallel port is easier to control, because it's simple, and beginners can try it with any short program. However, step forward, we will get problems. You compute the price of using MAX232 with only 2$, but why don't you take in account with shift registers using on parallel port as communicating it with microcontrollers?

Yeah, as a direct control, parallel port can control TTL devices directly. However, it's used only for testing port, it's not really a project. You can use LPT to control a stepping for example. It's also good. It's a project.

And you will see, as using LPT to controll stepping motors, you should use a shift register for this. The fact that you can use LPT to control stepping motor directly, but it's not recommended. Goodluck.
 
crazymonkey said:
Hi guys, i'm interested in the field of robotics. I have done some research into electronic control and now want to venture into making computer controled robots. Could anyone who is experienced in this field please tell me which port (parallel, usb etc.) is easiest to build an interface for and how to do it. Thanks.

As stated by the crazymonkey, he/she is looking to control from a computer at this stage, and as such I stand by my argument that for starting out the LPT port is the way to go, Obviously as time goes on and this person develops skills/knowledge ect in the field of robotics/interfacing/microcontrollers, then yes I would agree that a serial interface would make more sense then, but as it stands just now, I would still reacomend the LPT port for starting and experamenting as its the easiest to get started with. Once the LPT port is too small then yes by all means move over to the serial ports, but by this the crazymonkey will have the skills and experience required to control the additional hardware.

(Side note - although todays serial ports are fast, they still cannot compete with a good parallel port)

I do undestand the advantages of using serial port interfacing such as longer cable runs, less wires to connect, and as has said here, it has routines built in to the operating system, but I still dont believe it is the way to start, you can easily build a 3-axis robot complete with feedback sensors on a single LPT port without running into prolems with the number of pins ect.
 
As a side note to above, someone stated parallel port was not accessable under Win(NT) versions. Not true anymore. There is a new version of "Inpout32.dll" (freeware) available that will work under all Windows versions including newest XP. It has a standard dll for win95-ME based versions and an includes .sys file for NT based versions. The dll checks OS version and loads the .sys if needed. Programming from VB, is then just a matter of executing an API call to the dll subroutines using the Out and Inp commands just as in earlier versions of Quick Basic. Piece of cake.
Dialtone
 
I'm using inpout32.dll on XP service package 1 and programming with C++.net. So you may try but I need to rename the dllcache folder to make it work. No problems with Basic, but you can try to work with my laptop and you will see the problems. However, if you do as I noted, it works in all computers. I'm sure that. And of course, my laptop now run under NTFS.

So what did I do?

- Change it to FAT32, do stuffs as I noted
- Change again to NTFS and it worked.

I found no problems here.

What we are discussing is that which port beginners should study? And I said that they should learn to use serial port first. It's all.
 
falleafd said:
I'm using inpout32.dll on XP service package 1 and programming with C++.net. So you may try but I need to rename the dllcache folder to make it work. No problems with Basic, but you can try to work with my laptop and you will see the problems. However, if you do as I noted, it works in all computers. I'm sure that. And of course, my laptop now run under NTFS.

So what did I do?

- Change it to FAT32, do stuffs as I noted
- Change again to NTFS and it worked.

I found no problems here.

What we are discussing is that which port beginners should study? And I said that they should learn to use serial port first. It's all.


Hi all,

You may get some info on parallel programming with DLL or activeX under Win Xp, Win 2K or NT ,

http://www.geocities.com/bagtool/parallel_access.html

free :wink:
 
falleafd said:
Sorry, Because of Vietnamese firewall, I cannot view your program. (I cannot visit www.geocities.com....

But if you wanna use parallel port in win XP, you can follow this steps:

1) You only can do it if your XP run under FAT32

2) Boot your PC under DOS

3) Use NC to rename Windows\System32\Dllcache folder to Windows\System32\Backup_dll (for example)

4) Go to this site www.lvr.com and download .dll file and copy it to system32 folder.

Why you have to do so?

1) .dll files in dllcache folder are the files used to backup XP's .dll files as it is changed. It's automatically done. You will see that if you copy portio.dll to system32, you can use it only one times, after you restart the PC, you cannot use it again.

2) As you rename dllcache folder to backup_dll, XP cannot recognize this folder and cannot backup .dll files

3) But XP do not allow you to rename this folder in windows, you have to boot your PC under DOS to do so

4) As you don't want to use portio.dll, you can easily rename backup_dll folder to dllcache folder. XP will automatically backup all .dll files unexpected by XP.

im running xp with ntfs and i find outputting data to the parralell port fine with c++
 
danielsmusic said:
im running xp with ntfs and i find outputting data to the parralell port fine with c++

But you're writing in DOS, not in Windows! - 32 bit Windows compilers can't directly access the ports as Windows NT blocks it - hence the need for drivers.

In Delphi the 32 bit compilers don't even include the commands to directly access the hardware, although the 16 bit version does - but the 16 bit versions (or even adding assembler routines to the Delphi code), won't work under 32 bit Windows.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top