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

Status
Not open for further replies.

LOSTISLAND

Member level 3
Joined
Jun 8, 2010
Messages
54
Helped
6
Reputation
12
Reaction score
5
Trophy points
1,288
Activity points
1,682
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
 

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!!!
 
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
 

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...
 
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 :
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…