+ Post New Thread
Results 1 to 5 of 5
  1. #1
    Member level 3
    Points: 1,111, Level: 7

    Join Date
    Jun 2010
    Posts
    54
    Helped
    6 / 6
    Points
    1,111
    Level
    7

    Simple USB Communication,Source code(Visual Basic 6 and AVR)

    High All ,

    I want to connect an ATMega32 Micro to PC Through USB Port ,
    using Visual Basic 6 .
    I don't Want to use RS232 to USB or USB to RS232 or any other convertors .
    Just Direct connection .

    Is there any simple source code to do that ?
    I mean Visual basic 6 source code along side micro source code .
    I just want to send a command from PC to Micro and get a reply from micro .

    Thanks alot

    •   AltAdvertisment

        
       

  2. #2
    Advanced Member level 2
    Points: 6,608, Level: 19
    Kurenai_ryu's Avatar
    Join Date
    Jun 2006
    Location
    Bolivia
    Posts
    671
    Helped
    161 / 161
    Points
    6,608
    Level
    19

    Simple USB Communication,Source code(Visual Basic 6 and AVR)

    MAYBE you can use the V-USB (formerly AVR-USB) software libraries to simulate a RS232 converter (not implement one, but simulate it's behavior) so your ATMega32 will be recognized as an RS232 port.. so in Visual Basic you just need to communicate with a common serial port...

    other chance is to use V-USB to implement another kind of device, (maybe a HID Device (not necessarily a mouse or keyboard, but a HID compliant device)) but on Visual Basic you will need more code just to communicate with these custom HID device....

    just choose (also look for examples at V-usb site)
    ...




    What? do you want a link? just google it!!!


    2 members found this post helpful.

    •   AltAdvertisment

        
       

  3. #3
    Member level 3
    Points: 1,111, Level: 7

    Join Date
    Jun 2010
    Posts
    54
    Helped
    6 / 6
    Points
    1,111
    Level
    7

    Re: Simple USB Communication,Source code(Visual Basic 6 and

    Thanks Kurenai_ryu

    What a nice thing it is !
    I saw many projects done with vusb there .
    At the moment I don't have any idea about the speed limitation .
    I mean speed limitation in slow usb1 .
    By the way I think using AVR as virtual port is a good idea
    (ofcourse when speed does not matter)

    It's very strange in the projects presented with vusb , there is no PC software
    to communicate with the microcontroller .
    at least I have not been able to find any .

    Thanks alot



    •   AltAdvertisment

        
       

  4. #4
    Advanced Member level 2
    Points: 6,608, Level: 19
    Kurenai_ryu's Avatar
    Join Date
    Jun 2006
    Location
    Bolivia
    Posts
    671
    Helped
    161 / 161
    Points
    6,608
    Level
    19

    Simple USB Communication,Source code(Visual Basic 6 and AVR)

    oh, there is, at least for the HID part, (but in C with GCC) i suggest reading the USB-Serial Port (many projects use that basis...) when you get a working usb-COM Port (try testing it on Hyperterminal or another serial-terminal) you can use or search basic VB serial COM applications....

    V-USB simulates a 1.1 USB devicce SIE on a AVR microcontroller...
    depending on VCC it can work from 12MHz to 16MHZ (i think even more in the latest versions...)

    but the communication is done at 1.5MHz (USB low speed) even more, most of that speed is used in USB, packets- headers, checksums on more...
    you can spect a 800 bps on any hid application or just a 9.6 khz for an usb-COM

    here is the AVR__CDC application..
    http://www.recursion.jp/avrcdc/
    i remember the AVR- Doper (avr programmer) implemented a CDC-COM to communicate.. you can check that project too...

    then... search for simple VB serial port communication... it's easy this way...


    1 members found this post helpful.

  5. #5
    Member level 3
    Points: 1,111, Level: 7

    Join Date
    Jun 2010
    Posts
    54
    Helped
    6 / 6
    Points
    1,111
    Level
    7

    Re: Simple USB Communication,Source code(Visual Basic 6 and

    I think I've reached somewhere ,
    I think I must match these 2 together :
    Automator(avr firmware) & usbhidio2 (vb project) ,
    both downloadable in USB.rar here :


    4 members found this post helpful.

--[[ ]]--