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.

Parallel port, vb.net and PIC16f877A

Status
Not open for further replies.

Mortalo

New Member
Hi guys how's it going ?

I'm trying to do a project in vb.net and i want to send 8 bits or less trought the parallel port of my PC to make some comparations with that with my PIC16F877A.

Supossedly windows xp won't let me use the parallel port.So i'm asking if there's a way to send data that way.I can't use the serial port because i'm using it for another aplication in the same project.

Thanks.
 
You need a driver to do it, if you check my website below there's the one that WinPicProg uses you can download. However, have you considered using the serial port instead?, it's probably easier?.
 
Mortalo said:
Hi guys how's it going ?

I'm trying to do a project in vb.net and i want to send 8 bits or less trought the parallel port of my PC to make some comparations with that with my PIC16F877A.

Supossedly windows xp won't let me use the parallel port.So i'm asking if there's a way to send data that way.I can't use the serial port because i'm using it for another aplication in the same project.

Thanks.
hi,
You can control the PC's parallel port when using Win XP.

Unzip the paraport4.zip, attached folder, load the two DLL's into your Windows/system directory.
The other information in the zip will help you understand the port, also there is a VB5 source file.

Ask if you have any queries.:)
 
Last edited:
Hi guys Thank you for answering so fast.

I was looking for examples of how can i do what i want using vb.net 2005 and this is what i found...

'Port Testing
'Created by: phebejtsov@yahoo.com
'Date: Aug 09, 2006
'This simple program shows new/experience programers
'how to communicate via parallel port.
'When Button1 is clicked Data is written
'and read from on the 'data port' to confirm that data
'port works. When Button2 is clicked External data can
'be read through the “signal port”.


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


Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Out(&H378S, &HFFS) 'Print '1' to D7-D0 or 255 in Decimal
Dim Value1 As String 'String named Value1
Value1 = Inp(&H378S) 'Now Value1 has the values in 'data port'
MessageBox.Show(Value1) 'A popup will indicate the current value written

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

Dim Value2 As String 'String named Value2
Value2 = Inp(&H379S) 'Now Value2 has the values in 'signal port'
MessageBox.Show(Value2) 'A popup will indicate the current value written

End Sub


End Class

Using Parpot2.exe from the files that you gave me Ericgibbs i could not see the bits changing when i changed the value that i wanted so send on this line Out(&H378S, &HFFS), something im doing wrong ???

Thanks Colin i will try that to see how it goes.
Nigel whats up, cant do it with the serial, must be with the parallel port for now, but if this keeps giving me problems serial will be, vb.net have a serial class object anyways i think.
 
Hi guys Thank you for answering so fast.

I was looking for examples of how can i do what i want using vb.net 2005 and this is what i found...

'Port Testing
'Created by: phebejtsov@yahoo.com
'Date: Aug 09, 2006
'This simple program shows new/experience programers
'how to communicate via parallel port.
'When Button1 is clicked Data is written
'and read from on the 'data port' to confirm that data
'port works. When Button2 is clicked External data can
'be read through the “signal port”.

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


Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Out(&H378S, &HFFS)      'Print '1' to D7-D0 or 255 in Decimal
        Dim Value1 As String    'String named Value1
        Value1 = Inp(&H378S)    'Now Value1 has the values in 'data port'
        MessageBox.Show(Value1) 'A popup will indicate the current value written

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        Dim Value2 As String    'String named Value2
        Value2 = Inp(&H379S)    'Now Value2 has the values in 'signal port'
        MessageBox.Show(Value2) 'A popup will indicate the current value written

    End Sub


End Class

Using Parpot2.exe from the files that you gave me Ericgibbs i could not see the bits changing when i changed the value that i wanted so send on this line Out(&H378S, &HFFS), something im doing wrong ???

Thanks Colin i will try that to see how it goes.
Nigel whats up, cant do it with the serial, must be with the parallel port for now, but if this keeps giving me problems serial will be, vb.net have a serial class object anyways i think.
 
controlling electrical appliances..

Hi i am kavita . I want to develop an application which will controlling electrical appliances through parallel port using computer (like tube ,fan etc..).I want to do in java or .net. can any body have any idea.
please help me ...My email is: kavi1787@yahoo.com
Thanks in advance.
 
Parallel port Access

Mortola..

I too trying to do project like you by accessing the parallel port. I have seen you the example...In that pls explain What is &H378S and &H379S(is that port address)..If so how there can be two parallel ports...Also pls say how to define datas...If Data D0-D7 is 10101110 how to define is that in hex...

Regards
Pradeep.G
 
Status
Not open for further replies.

Latest threads

Back
Top