Previous in Forum: Installing Adobe CS3   Next in Forum: Why Would a File Grow?
Close
Close
Close
5 comments
Rate Comments: Nested
Anonymous Poster

Parallel Port Interfacing in Visual Basic

02/04/2010 7:34 AM

i want to interface may hard ware with parallelport. my hardware is made up of 8 leds which i connected these led with Do-D7. may problem is when i send

a bit pattern to the port everything that was there previously is cleared. This is a For example, what if i want bit 2 to always stay at 1, but want to turn bit 5 on and off in sequence, Every time we set bit 5, bit 2 is turned off, and vice versa.

i want that program in VB which keeping the state of one bit while changing the state of another.

Plz help me

Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.
Guru
Popular Science - Biology - New Member Hobbies - Musician - New Member APIX Pilot Plant Design Project - Member - New Member Hobbies - CNC - New Member Fans of Old Computers - ZX-81 - New Member

Join Date: Jan 2007
Location: Centurion, South Africa
Posts: 3921
Good Answers: 97
#1

Re: parallel port interfacing in Visual Basic

02/04/2010 7:55 AM

I don't do VB but the following may help.

The lines are turned on or off by printing a character.

Create a variable to store the current state.

You can then manipulate separate bits and output the changed character.

__________________
Never do today what you can put of until tomorrow - Student motto
Reply
Anonymous Poster
#2

Re: Parallel Port Interfacing in Visual Basic

02/04/2010 9:21 AM

http://www.lvr.com/parport.htm Jan Axelson's Parallel Port Complete book

Reply
Guru
Popular Science - Biology - New Member Hobbies - Musician - New Member APIX Pilot Plant Design Project - Member - New Member Hobbies - CNC - New Member Fans of Old Computers - ZX-81 - New Member

Join Date: Jan 2007
Location: Centurion, South Africa
Posts: 3921
Good Answers: 97
#3

Re: Parallel Port Interfacing in Visual Basic

02/04/2010 10:27 AM

If you use 3 of the control lines and only one data line and a 8 bit latch it will be possible to switch each of these LED's separately. You need a 3 x 8 address decoder and a 2 latches.

I have a splitter board here somewhere where 64 LEDs (8 lots of 8) can be switched.

__________________
Never do today what you can put of until tomorrow - Student motto
Reply
Anonymous Poster
#4

Re: Parallel Port Interfacing in Visual Basic

02/05/2010 3:45 AM

You have to do the VB equivalent of bit-masking and logic programming, ie.

Bit2 AND 223 will turn bit 5 off and leave the others as they are, and

Bit2 OR 32 will turn bit 5 on and leave the others as they are.

where Bit2 is your bit, 223 = 11011111 binary (bit 5 off) and 32 = 00100000 (bit 5 on).

Hope this helps.

Reply
Guru
Popular Science - Weaponology - New Member Safety - ESD - New Member Hobbies - Fishing - New Member

Join Date: Sep 2006
Location: Near Frankfurt am Main, Germany. 50.390866N, 8.884827E
Posts: 17996
Good Answers: 200
#5

Re: Parallel Port Interfacing in Visual Basic

02/05/2010 6:21 AM

Warning!

Be vary careful when connecting to the printer port, you can ONLY rely (unless you have the manual for that PC that states it differently and how much) on being able to source 2.6 ma and sink 24 ma. eg. A typical 7400 output.

Having dropper resistors of less than 2K Ohms (assuming a 5 volt output as some Laptops only have 3 volt outputs) to your LEDs MAY still cause damage.

Many diagrams on the web AND much professional equipment too use lower value resistors with the possibility of damaging the main-board.

Usage of a plug in PCB or PCMCIA Printer port which are both cheap and easily replaced is recommended.

The above warning will not fix the problems you are seeing at this time, (but may save you from other ones!) but the link to Jan Axelson's web page will help enormously.

Depending upon what you eventually want to do, you might want to join a Yahoo group like DIY-CNC-Interfacing to get even more infos and practical circuits you can build for CNC (stepper motor) or Robotics control or whatever....there are plenty of free programs running under DOS, Windows and Linux for such things, you don't need to re-invent the wheel!!

Keep us informed and up to date please.

__________________
"What others say about you reveals more about them, than it does you." Anon.
Reply
Reply to Forum Thread 5 comments
Copy to Clipboard

Users who posted comments:

Andy Germany (1); Anonymous Poster (2); Hendrik (2)

Previous in Forum: Installing Adobe CS3   Next in Forum: Why Would a File Grow?

Advertisement