Serial data to USB


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    Quote Originally Posted by cooksydesign View Post
    I have good working code to transmit serial data to and from a PIC 16F628A and a VB6 application. Now the request for a USB connection has come up. Has anyone played with a serial to USB converter? The board with the PIC has been made, I'm stuck with serial in, serial out, and ground for data transfer. The data is transfered at a blistering 4800bps, but for the small amount of data it's just fine.
    Two bytes are first sent from the VB application to the PIC. The PIC acknowledges with a byte, then transfers less than 50 bytes and it's over.
    Soooo, anyway, has anyone played with a serial to USB converter? I have seen one or two that are built into a cable, which would be sweet if that worked out.
    Thanks to all.

    Brad
    I have good luck with a Belkin F5U409.

    http://catalog.belkin.com/IWCatProdu...duct_Id=459431
    Last edited by mackrackit; - 28th October 2008 at 21:56.
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default

    I'd never ever had any kind of problem 'till now. BUUUUUUUUT, most USB-2-serial may access COM up to 255/255. VB6 original component is usually able to work within COM1:COM15 range. With VB6, So the only kind of limitation is if you can't modify the COM port that your converter use.

    You could find some info over the net to modify the VB6 control, or, i'll suggest you to move on newer .Net version (express work great).

    In .NET you also could build a list of available COM port in 2-3 code lines.

    Now, i use PIC with USB.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    May 2005
    Location
    Minnesota
    Posts
    31

    Default

    Mackrackit, what kind of handshaking is required with the Belkin cable?

    My '628A PIC is surface mount, the boards have been made. I think the boards were done before the PIC came out with USB, yep, a few years and I still have some stock.

    Many thanks.

    Brad

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default

    I'm not Mackrackit, but handshaking is really up to you. You could have DTR line connected to the MCLR and play with it in VB, so your PIC fall in a SerialCom Test or Bootloading procedure for XYZ delay.

    I usually use USART interrupt without MCLR.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default

    What he said and..

    When the serial/usb converter is installed on XP/Vista, you will have a virtual com port number ?? in device manager.

    This virtual com port will have all of the settings of a regular com port.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    May 2005
    Location
    Minnesota
    Posts
    31

    Default

    It has occured to me that VB6 does not support USB ports, right?
    .NET does?
    The PIC end of this has a three pin, 0.100 centers, header; Gnd, transmit, and receive. The end I need to mess with is the PC/VB side.

    Thanks again all.

    B

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default

    All language support USB, but there's no easy lunch

    If you have MicroCodeStudio, you should have a plug-in called EasyHID, this will create your code template for VB6. It will also give you a .DLL called mchid.dll or something like that, which is the core of the template.

    A while back, i've posted an example somewhere her called USBDemo. sure enough you will have everything to get you started with it.

    I also published here a Template to use VB.NET. Another guy on the net also used it, modified it a little bit and placed it on his website ( http://www.helmpcb.com/Software/USBHIDVB/USBHIDVB.aspx )


    I really suggest you to forget the outdated (but still usefull and workable) VB6, move on .NET. VBExpress is free to use.

    Jan Axelson's website also have tons of ressource and code template to work with HID devices.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  8. #8
    skimask's Avatar
    skimask Guest

    Default

    Quote Originally Posted by cooksydesign View Post
    It has occured to me that VB6 does not support USB ports, right?
    .NET does?
    The PIC end of this has a three pin, 0.100 centers, header; Gnd, transmit, and receive. The end I need to mess with is the PC/VB side.
    Thanks again all.
    B
    Ya could go with a CP2102/CP2103 type chip...
    http://www.sparkfun.com/commerce/pro...roducts_id=309
    Serial in one side, USB out the other side, virtual COM port on the PC.

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 05:47
  2. Data EEPROM gets clobbered during programming
    By BrianT in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 18th July 2008, 03:46
  3. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 03:21
  4. LCD + bar graph
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th October 2005, 15:50
  5. Sinus calculating !
    By Don Mario in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 29th November 2004, 00:56

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