Parallel port Pin Configuration

Parallel port Pin Configuration
Pins

Tuesday, June 16, 2009

C code for parallel port

include
#include
#include
#include

#define base 0x378 /* printer port base address */
#define value 255 /* numeric value to send to printer port */

main(int argc, char **argv)
{
if (ioperm(base,1,1))
fprintf(stderr, "Couldn't get the port at %x\n", base), exit(1);

outb(value, base);
}

Electronic Circuit for Our Parrallel port ( for Testing our programe)

You can make simple circuit for driving a small led through PC parallel port. The only components needed are one LED and one 470 ohm resistors. You simply connect the diode and resistor in series. The resistors is needed to limit the current taken from parallel port to a value which light up acceptably normal LEDs and is still safe value (not overloading the parallel port chip). In practical case the output current will be few milliampres for the LED, which will cause a typical LED to somewhat light up visibly, but not get the full brightness.

Sunday, June 7, 2009

How to use imported .dll file in our program.

**************************************************

Out(&H378, 255)

' &H378 is the port address
' 255 is the decimal value of 11111111 binary value
' in this case it will pass current to every data pin

**************************************************

Friday, June 5, 2009

How To Program to the Parallel Port In Windows XP

Parallel port interfacing DLL/OCX (WIN9X / WIN NT/2000/XP ) A
versatile Dynamic Link Library for parallel port interfacing.
Can be used on both WIN9X and WIN NT/2000/XP machines. It is
free and comes with source code

**********************
Option Strict Off

Option Explicit On

Module InpOut32_Declarations

'Inp and Out declarations for port I/O using inpout32.dll.

Public Declare Function Inp Lib "inpout32.dll" Alias "Inp32" (ByVal PortAddress As Short) As Short

Public Declare Sub Out Lib "inpout32.dll" Alias "Out32" (ByVal PortAddress As Short, ByVal Value As Short)

End Module

*****************************