Jump to content

USB2.0 High Speed Serial Communications

Recommended Posts

LV2016 64-bit

I have inherited a LabVIEW Interface that talks thru a USB2 Interface to a micro-Controller at 921,600 baud.

This opens a new world of possibilities as USB2 can handle data at much higher rates than a typical RS232 interface.

I have been tasked with rewriting the LabVIEW code as it is difficult to maintain.  I have an application that will talk to the uC at 230 kbaud but can't attain the 921,600 baud. I have tried copying the pertinent VIs from the supplied code into my app but still can not attain 921,600 baud. Plus I don't have a serial line analyzer capable of handling USB2, so I can only trial and error with the uC. Is there a setting I have to do in LabVIEW to allow serial communications at the higher rates? At the moment, I am trying to get the Find Controllr VI to work. I have included the support VIs for the Find Controllr.vi. The Find Controllr VI attempts to find the correct port and baud rate and then obviously communicate with the uC.

Find Controllr.vi

Packet TR.vi

Get Available Ports.vi

Serial Data.vi

Check For Packet.vi

Open Port.vi

Create Packet.vi

Extract Packet ID.vi


Link to comment

I've heard of people getting that kind of speed but I've never used it on any device.  I found a couple of articles you probably already found talking about high speed serial stuff.



I'm not aware of any special work that needs to be done to achieve a fast baud rate.

Link to comment

I feel like USB is a bit of a red herring. It sounds like your microcontroller has a USB to serial converter on it. With real USB communication, you don't have to specify a baud rate. Here's some more info on USB raw http://digital.ni.com/public.nsf/allkb/E3A2C4FE42D7ED0D86256DB7005C65C9

When you say it can't attain 921kbaud, what do you mean? Are you getting an error code from VISA? Is it possible that the microcontroller doesn't support those baud rates?

Edited by infinitenothing
Link to comment

The uC works at 921600 baud with the LabVIEW interface that I have inherited. I don' have a serial line analyzer so I am restricted to trial and error with the uC. So, I try it and see if I get a response. I will try to use to laptops tomorrow and see if I can get them to talk to each other. I do have the uC set to 921600 baud. If I set the uC to 230kbaud my LabVIEW App can talk to it, but no faster. But the LabVIEW app I have inherited can talk at 921600 baud. That's what has me bewildered.

Link to comment

It sounds like "can't attain" means that your application doesn't get a response. That could easily be caused by an application error. Which is likely, seeing as how you misuse locals. Also, I noticed your Packet TR isn't opening the port or setting a baud rate. I think you need to get rid of the response ID checking and improve error handling. Ideally it would be as simple as "Open Port, create packet, wire that straight into the visa write, wait a second, get all the bytes off the port. View the bytes as hex and see if you can figure out what it's sending back." If you get a good packet back, then you know it's probably just an application error. If you get nothing back, you might want to take apart the uC and see if you can find out what pins to probe or what's going on at the serial end somehow, I guess I'd want to know what was working before. There is some chance it's a driver issue and you have to live with it. if you get back a visa error, then we can look at solving them.

Link to comment
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.