Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 20th March 2008, 09:33 PM   #1
Default Parallel port, vb.net and PIC16f877A

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.
Mortalo is offline  
Old 21st March 2008, 08:43 AM   #2
Default

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?.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 21st March 2008, 08:43 AM   #3
Default

Quote:
Originally Posted by Mortalo
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.
__________________
Eric " Good enough is Perfect "
I will NOT answer PM's requesting technical help, please use the Forum
PIC tutorials: Nigel's www.winpicprog.co.uk/ Bill's: www.blueroomelectronics.com/

Last edited by ericgibbs; 7th July 2008 at 12:23 PM.
ericgibbs is offline  
Old 21st March 2008, 11:31 AM   #4
Default

If you install GiveIO
http://sourceforge.net/project/showf...group_id=46487

You can use the Turbo C compiler with the DOS function outportb()
You can also use Python with a module called pyParallel.
colin mac is offline  
Old 25th March 2008, 11:54 AM   #5
Default

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.
Mortalo is offline  
Old 25th March 2008, 11:55 AM   #6
Default

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.
Mortalo is offline  
Old 25th October 2009, 01:59 PM   #7
Smile 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.
kavi1787 is offline  
Old 26th October 2009, 04:56 PM   #8
Default 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
gsuspradeep is offline  
Reply

Tags
parallel, pica, port, vbnet

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
Port A of PIC fried ? rngd Micro Controllers 10 9th March 2008 10:28 PM
Need Help! PIC16F877A Port Initialization Klitzie Micro Controllers 3 5th February 2008 05:42 PM
programmer serial port vs. laptop with usb port crys Micro Controllers 9 18th January 2008 01:52 PM
:: PORT C Woes When Using USART suby786 Micro Controllers 4 21st May 2007 03:09 AM
PIC16F877A interfacing with Serial Port jasbertfalutine Micro Controllers 10 18th June 2006 08:26 AM



All times are GMT. The time now is 06:01 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker