How to communicat with Microcontrollers through USB port in VB

S

Thread Starter

Sivakumar

Hello Sir,
I need Sample source code in VB to communicate with PIC16F77A microcontroller through USB Port.

I know well how to communicat throgu COM Port and Parallel port.

But I need to know how it can be done through USB
port.

Mail ME Please : [email protected]

Thank You,
 
R

Robert Scott

There is no such thing as generic USB communication in VB. Instead, each USB device must be programmed to conform to a specific USB Class device and must be provided with a device driver. If the USB device emulates a COM port (which is common) then you would communicate with it in VB exactly the same as would for a COM port. You just have to find out which COM number the USB device is assigned. This assignment is made by the operating system, not by your program. So if you know COM port communication, then you already know how to talk to the PIC, provided the PIC is programmed to conform to the CDC Class.

Robert Scott
Real-Time Specialties
Embedded Systems Consulting
 
N

Nathan Boeger

Robert's reason is exactly why it might be easiest to find a device specific OPC server, then write your program as an OPC client, making generalized API calls (reads, writes, etc). This will give you the additional benefit of being able to easily support other PLCs later instead of needing to start again from scratch. If you become a member, they have VB.NET sample code for clients.

http://www.opcfoundation.org

----
Nathan Boeger
http://www.inductiveautomation.com
"Design Simplicity Cures Engineered Complexity"
 
C

Chris Turcotte

Since the PIC16F77A does not have native USB support, you may want to use a USB to serial converter. Avit Research has a nice assembly:

"The AVIT Research USB to TTL Serial Cable is designed to allow simple rapid connection of microprocessors to the USB interface. It allows legacy products using PC serial ports to be easily upgraded to USB. The cable contains a USB to serial converter chip and is terminated in a standard 0.1� pitch header. The serial data is at standard TTL levels allowing it to interface directly to the micro-processor of the intended application."

This device looks like a cable and comes with the Windows drivers that make it look like a standard serial port that then can be accessed using standard COM port methods as Robert Scott described.

See:

http://www.avitresearch.com/ttl_serial_products.htm

Regards,

Chris Turcotte
 
Hi,

I also would like to communicate with a PIC but through the serial port. I was wondering if anyone can give me a sample program in c or vb. Thanks. My email is lucian_ky @ yahoo. com
 
Hi,

Please, can you send me sample source code in VB to communicate with parallel and serial port?

Thanks,
Pankaj
 
Hello there...

I am an Engineering student and am working on a project that needs a car to be controlled by a computer.

I am looking forward to connect the same using a serial port or USB port. I will be thankful if you could guide me to proceed with my project.

You can contact me at [email protected]. When you mail for the first time, please punch in "PROJECT ROVER" in the subject line.
 
Top