I try to use Eltima - Virtual Serial Port Driver, VB 2008 and Proteus Isis to simulate a serial communication between PC and 16f877.
VB code:
Code:
Public Class Form1
'Dim WithEvents Comm1 As New IO.Ports.SerialPort
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Comm1.PortName = "COM3"
Comm1.Parity = IO.Ports.Parity.None
Comm1.BaudRate = 2400
Comm1.DataBits = 8
Comm1.StopBits = 1
Comm1.Open()
If Comm1.IsOpen = True Then TextBox1.Text = " serial port COM3 is open"
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim I As Integer
For I = 1 To 10000
Comm1.Write("A", "A")
Next I
End Sub
End Class
Picbasic code:
Code:
Include "PROTON_4.INC"
Dim X As Byte
DelayMS 200
Cls
Again:
SerIn PORTC.7, 17197, [ Wait ("A"), X]
Print At 1,1 ,"X= ", X
GoTo Again
In ISIS Compim port is set to COM3
It does not seem to work...
|
Hi, its great to see you
visiting our forum. Why not try Proton Compiler for FREE?
Download the FREE version
of Proton Compiler, Its called Amicus18
and its available from HERE
|