Problem of communication between visual basic 6.0 and PIC16F

Hi…

I am doing a project that need to sent and received signal from Computer to PIC and i using RN41 to be my wireless connection.Unfrotunely, i meet a problem, when i success to connect the RN41 with my computer (which mean turn the red LED to Green LED) I unable to sent any data out.

The following is my VB doing

Visual Basic Coding


Private Sub Command1_Click()

If Command1.Caption = “Open” Then

MSComm1.CommPort = 1

MSComm1.PortOpen = True

Command1.Caption = “Close”

Frame1.Enabled = True

Else

MSComm1.PortOpen = False

Command1.Caption = “Open”

Frame1.Enabled = False

End If

End Sub

Private Sub Command2_Click()

MSComm1.Output = “K”

End Sub

Private Sub MSComm1_OnComm()

Dim data As String

If MSComm1.CommEvent = comEvReceive Then

data = MSComm1.Input

If data = “X” Then

Text1.Text = “”

ElseIf data = “Z” Then

Text1.Text = “”

End If

MSComm1.RThreshold = 0

MSComm1.InputLen = 0

End If

MSComm1.RThreshold = 1

MSComm1.InputLen = 1

End Sub


May i know is it my coding got any problem so i not able to sent data out??

Anyone any idea please tell me…

Thanks for advance.

For additional, anyone can contact me with my personal email as well.

reeve333@yahoo.com

Use a suitable terminal emulator (I use RealTerm) to check that things are working, before writing your own code.

Thanks for reply…

I will try to use RealTerm to check it first then back to this topic again.

Thanks for help…

The hardware should be fine…

but I still unable to sent the data out o…

do you know what happen i made??

I attachment the file i make here as well, so you may easy to know what i make mistake…

really thanks you help me…

I told you to test the program running on the PIC. Does that communicate with RealTerm?