vb6 to pic basic


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2004
    Posts
    74

    Talking vb6 to pic basic

    I have written a basic program in vb6 that sends serial data to a 2way radio. This software works fine, I then tried to do the same in pic basic but the serial comms does not appear to be working.The first line of code is the vb6 code that sends a connect command to the radio.

    MSComm1.Output = Chr$(8) + Chr$(0) + Chr$(181) + Chr$(0) + Chr$(0) + Chr$(0) + Chr$(1) + Chr$(6) + Chr$(196)

    Pic basic equivelent
    SerOut PORTA.0,n9600,[8,0,181,0,0,0,1,6,196]' logon as DTE

    the second line tellls the radio to transmit


    MSComm1.Output = Chr$(4) + Chr$(0) + Chr$(187) + Chr$(128) + Chr$(63)

    and the pic basic equivelent
    SerOut PORTA.0,n9600,[4,0,187,128,63]' transmitt

    is ther something wrong in my conversion here or maybe I have a problem elsewhere. I can see data comming out of the port when I look on a CRO.

  2. #2
    PBP_NeuBoi's Avatar
    PBP_NeuBoi Guest


    Did you find this post helpful? Yes | No

    Default Cool Project

    Hi

    Sorry I can't help, but am interested in controlling radio doing this myself in VB or VC++ and PBP or PIC C, or maybe even AVR so to use telemetry with a robot.

    Can you point me in the right direction to resources, etc? I have Visual Studio and plenty of uC C programming tools.

    Thanks

    Cheers

    |-]

    Dale

  3. #3
    Join Date
    Mar 2004
    Posts
    74


    Did you find this post helpful? Yes | No

    Default

    The radio that I am controlling is a Simoco SRM9000, but if you wish to send data over short distances try on of the many 433MHz modules as they are simple and they are cheap

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default Comms

    A simple thought that's tripped me up more than once...
    Is there a MAX232 type RS232 converter in the middle somewhere?
    Have you tried both SerOut with n9600 and then with t9600?
    The PIC's 5v serial comm's might not be enough to drive the radio's serial port input.
    But I'm guessing since I don't know anything about the radio itself...just mentioning something that's bitten me a number of times for a number of days only to have me kick my own butt for not thinking of it sooner!
    JDG

  5. #5
    Join Date
    Mar 2004
    Posts
    74


    Did you find this post helpful? Yes | No

    Default

    No this is not a max232 in the circuit, just direct connect, I have not tried any other baud rate (this is the default in the radio and works fine with simple vb6 program

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Well, if there's not a max232 in the middle, then you might be back to the 5v serial comm not being enough to drive the receivers inputs, which might want the +12/-12v that a real rs232 serial port would give you. The PicBasic code looks fine to me, no errors I can see. Hope this helps in some small way.
    JDG

  7. #7
    Join Date
    Mar 2004
    Posts
    74


    Did you find this post helpful? Yes | No

    Default

    Thanks for that but I have found that using a 10MHz crystal I had the fuse bit for XT set instead of HS. Thanks to Charles in another thread that I picked up on my mistake.

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    DOH! Good find...you're not alone on that one!
    JDG

Similar Threads

  1. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  2. Automatic VB6 to pic serial connection
    By arniepj in forum Code Examples
    Replies: 13
    Last Post: - 10th January 2008, 07:57
  3. using AND as an IF statement
    By dw_pic in forum mel PIC BASIC
    Replies: 27
    Last Post: - 8th June 2006, 18:05
  4. Pic 18F4550 & VB6
    By lentz in forum USB
    Replies: 1
    Last Post: - 5th April 2006, 00:55
  5. The Ultimate PIC Basic
    By picnaut in forum PBP Wish List
    Replies: 4
    Last Post: - 9th November 2004, 22:10

Members who have read this thread : 0

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