AVR USB and VB6
AVR USB and VB6
Hi all...
Plz help me out this prob.
I want to communicate AVR-USB with VB6.
I am sending status of pins of MCU to PC.
I want to see that in an app made in VB.
How can I do that??
Also which mode of USB in AVR will give me Max data Xfer rate???
Tahnks 4 Help in advance.
Plz help me out this prob.
I want to communicate AVR-USB with VB6.
I am sending status of pins of MCU to PC.
I want to see that in an app made in VB.
How can I do that??
Also which mode of USB in AVR will give me Max data Xfer rate???
Tahnks 4 Help in advance.
Hi,
I'm trying to make a VB6 application to communicate with my device.
Here is the code of a little program I found in the internet:
With this program I can see how many devices are connected to usb, but is there a way to send data to my device over the libusb0.dll, or is there another API to do this?
Thank you.
Best regards,
Mario
I'm trying to make a VB6 application to communicate with my device.
Here is the code of a little program I found in the internet:
Code: Select all
Private Declare Sub usb_init Lib "libusb0.dll" ()
Private Declare Function usb_find_busses Lib "libusb0.dll" () As Integer
Private Declare Function usb_find_devices Lib "libusb0.dll" () As Integer
Private Sub Form_Initialize()
Call usb_init
End Sub
Private Sub Command1_Click()
nBusses = usb_find_busses()
nDevices = usb_find_devices()
Label1.Caption = "Devices " & nDevices
Label2.Caption = "Busses " & nBusses
End Sub
With this program I can see how many devices are connected to usb, but is there a way to send data to my device over the libusb0.dll, or is there another API to do this?
Thank you.
Best regards,
Mario
Using C, not VB anymore
Hello,
I did my program in C, using Dev-C++ and it works very well. I think there is no reason to do it in Visual Basic, because I saw that there is so much C code available to communicate with the AVR-USB. First I want to thank you for this. It is helping me more that I expected, to do my conclusion projekt for the university.
Now I have another question. I'm using a bootloader to copy my program to the ATmega16s memory. Both using the USB-firmwre solution (bootloader and main program). Is there a way to restart the USB enumeration by firmware, after jumping from the bootloader to the main programm? Or is there a bug in my firmware, and it should do it by himself? Now I have to disconnect the USB cable after jumping from the bootloader to the main program or do a hardware reset after a firmware update.
Thanks in advance for your help.
Best regards,
Mario
I did my program in C, using Dev-C++ and it works very well. I think there is no reason to do it in Visual Basic, because I saw that there is so much C code available to communicate with the AVR-USB. First I want to thank you for this. It is helping me more that I expected, to do my conclusion projekt for the university.
Now I have another question. I'm using a bootloader to copy my program to the ATmega16s memory. Both using the USB-firmwre solution (bootloader and main program). Is there a way to restart the USB enumeration by firmware, after jumping from the bootloader to the main programm? Or is there a bug in my firmware, and it should do it by himself? Now I have to disconnect the USB cable after jumping from the bootloader to the main program or do a hardware reset after a firmware update.
Thanks in advance for your help.
Best regards,
Mario
If you want to start a re-enumeration "the correct way", you must be able to deactivate the 1.5k pull-up resistor. If it's connected to a port pin instead of the positive supply, just disconnect it for several 100 milliseconds.
If your pull-up is wired directly to the positive supply, you can still get the same effect by pulling down D+ and D-. All our examples do this as one of the first actions in main(). The duration is a bit short, though, and the host will not always detect this as a re-enumeration request. To be on the safe side, pull down D+ and D- for several 100 ms.
If your pull-up is wired directly to the positive supply, you can still get the same effect by pulling down D+ and D-. All our examples do this as one of the first actions in main(). The duration is a bit short, though, and the host will not always detect this as a re-enumeration request. To be on the safe side, pull down D+ and D- for several 100 ms.
Thank you, Christian, increasing the time to 100ms solved my problem.
@Vishwas: for my project I took the code from the AVRUSBBoot, and somthing from elektor (I think elektor just copied and made some changes from code available here at obdev.at). Here are the links:
http://www.fischl.de/avrusbboot/
http://www.elektor.de/Uploads/Files/Magazine/060276-11.zip
I would recommend you to take a look at the projects available here on obdev.at (http://www.obdev.at/products/avrusb/), to find somthing similar to what you want to do.
Best regards,
Mario
@Vishwas: for my project I took the code from the AVRUSBBoot, and somthing from elektor (I think elektor just copied and made some changes from code available here at obdev.at). Here are the links:
http://www.fischl.de/avrusbboot/
http://www.elektor.de/Uploads/Files/Magazine/060276-11.zip
I would recommend you to take a look at the projects available here on obdev.at (http://www.obdev.at/products/avrusb/), to find somthing similar to what you want to do.
Best regards,
Mario