Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

interfacing VB 6 with PIC 16f84

Status
Not open for further replies.

win_832001

Newbie level 3
Newbie level 3
Joined
Feb 21, 2006
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,316
hello.. i need help here...i'm trying to send the data using VB 6 to the PIC 16f84 through MScomm command...I've try to 'on' the LED at output...can anyone check my PIC program and my vb6 code..
PIC code:
INCLUDE "modedefs.bas" ' Include serial modes
DEFINE OSC 4

si VAR PORTA.4 '
loop VAR BYTE

start:
SerIn si,T2400,["255"],loop

IF loop Then led
led:

High PORTB.4
Pause 5000
GoTo start

End

vb 6 code:
Private Sub cmdsend_Click()


Dim PinState As Byte
' Get Pin State
If optState(0).Value = True Then
PinState = 0
Else
PinState = 1
End If

' Send Out Data
MSComm1.Output = Chr$(255)
End Sub



Private Sub Form_Load()

Dim Pins As Long
' Default to optState(0) being selected
optState(0).Value = True

' Use COM1
MSComm1.CommPort = 1

' 2400 baud, no parity, 8 data bits, 1 stop bit
MSComm1.Settings = "2400,N,8,1"

' Disable DTR
MSComm1.DTREnable = False

' Open the port
MSComm1.PortOpen = True
InputLen = 0
RThreshold = 0

End Sub

Private Sub Form_Unload(Cancel As Integer)
MSComm1.PortOpen = False
End Sub


i'm very need help here...tq
 

are you sure of the PIC youre using? 16f84 has no usart capability, so in short it's impossible for you to communicate the microcontroller thru vb and vice versa...
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top