send data from VB 6 to PIC 16f84


Closed Thread
Results 1 to 3 of 3
  1. #1
    win_832001's Avatar
    win_832001 Guest

    Default send data from VB 6 to PIC 16f84

    need help here...
    ive try to turn 'on' the LED through PIC 16f84
    can one help me:

    VB6 code :
    Private Sub Form_Load()

    ' 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
    MSComm1.Output = Chr$(255)
    End Sub

    from the coding the PIC shold receive the "255"

    and my PIC PRO Basic coding :

    INCLUDE "modedefs.bas" ' Include serial modes
    DEFINE OSC 4

    si VAR PORTA.4 ' Set portA.0 as our serial input pin
    loop VAR BYTE ' Define our storage location for the servo number to move.

    start:
    SerIn si,T2400,["255"],loop' Get the servo# and position for that servo.

    IF loop Then led

    led:

    High PORTB.4
    Pause 5000

    GoTo start

    End


    can anyone help me to solve the problem...i really need help..thank you

  2. #2
    Join Date
    Jul 2004
    Location
    CA
    Posts
    78

    Default VB - PIC Serial Communication

    I have successfully used the serial communication from the VB.NET 2003 (not VB6) and have the data be downloaded, onto a PIC. And it worked. I do not know how different VB6 is from VB.net. Here is the link I used, and I donwloaded the program onto my project and it worked perfectly. You may want to get yourself upgraded to VB.net.

    I changed this program around to fit my needs, I hope this helps.


    http://www.codeworks.it/net/VBNetRs232.htm


    Srig

  3. #3
    kadirozen's Avatar
    kadirozen Guest

    Smile this is your solution

    hi,
    if you change your code like this you will success

    start:
    SerIn si,T2400,["255"],loop' Get the servo# and position for that servo.

    IF loop = 255 Then
    Goto led
    else
    GOTO start
    endif

    led:

    High PORTB.4
    Pause 5000

    GoTo start

    End
    Last edited by kadirozen; - 9th March 2006 at 21:11.

Similar Threads

  1. Can't read sequential addresses in external EEPROM
    By tjkelly in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th February 2010, 14:46
  2. DS2760 Thermocouple Kit from Parallax in PicBasicPro
    By seanharmon in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th July 2008, 23:19
  3. PIC data sheets - not comprehensive for beginners
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 29th August 2006, 03:28
  4. send serial data to PIC 16f84 ausing VB6
    By win_832001 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 5th March 2006, 21:14
  5. how to send data from VB to PIC 16f84
    By win_832001 in forum Serial
    Replies: 0
    Last Post: - 25th February 2006, 16:15

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts