USB plug-to-plug

Go To Last Post
14 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have signed on to update a project from RS-232 to USB.  I'm an old RS-232 guy from the days of 25 pin connectors and am having difficulties with designing the new board and writing the software.  This is a commercial project, so it needs to be very professional.  Our problem is this: we have a system which consists of a Controller with an Atmel ATmega1284P, up to 8 slave Target Sensors with an ATmega1284P each and a laptop as a GUI.  This is a shooting sport controller and our users are not predisposed toward computers and everything must be quite user friendly; each user is wearing a real, loaded .45 six gun. The GUI is written in C# and is accepted very well by the users, except the setup.  To connect the laptop to the Controller via RS-232 you have to know which COM port it is coming in on.  A laptop savvy operator who knows how to find the Device Controller and read it has no problem with that, but our cowboy customers will never get that.  My biggest nightmare is someone in Texas setting up for a match, can't connect the laptop and calls the Customer Service for help.  We're not that big of a company.

 

What I want is just what USB is designed to provide, turn on the app, plug in the USB and have the app find it and begins communicating with the Controller.  I have an FT232RL laid out on the board, but can't get it to work.  Part of the problem may be my soldering, so I have connected a Denkovi board to my UART and have it working like the RS-232 used to, I opened up the Device Controller and found it on COM4 and connected my Tera Term to it (my GUI is down for an overhaul).  We will be doing one more turn on the board.

 

I know where to find laptop driver information, but where can I find the information to program the FT232RL so that it announces the company name and other details that help the GUI recognize it?

 

 

The only thing more dangerous than a software engineer with a soldering iron is a hardware engineer with a compiler.

Last Edited: Wed. Feb 13, 2019 - 10:10 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Customization of an FT232R is possible, I gather from reading the FTDI web site. But, its not trivial. 

 

Consider, as an alternative, that the controller sends a text message (a logon message, so to speak) with the company name and maybe "Unit XYZ is connected". This would not require any change to the USB interface chip. If you DO change the chip, then it would only be visible to someone using Device Controller. And, I think, there would be a host of other problems, including your own device IDs and other things. 

 

I hope that you do not expect to use USB between the system controller and the sensors. That would require a USB master, and that raises the level way up. 

 

On getting your first FT232R working, there is a pin that I overlooked on my first one. I think that it is the TEST pin (#26 on the SSOP package). It MUST be grounded. That SSOP package is difficult to hand solder. I highly recommend that you get one on a breakout board, maybe from SparkFun or AdaFruit to start with. Sure, you pay double or more, but it will save you far more in time to market.

 

I have done GUI apps that talk to FT232R devices. There are some tricks, depending on the language you decide to use. Those tricks help make automatic operation relatively simple.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ka7ehk wrote:
I think that it is the TEST pin (#26 on the SSOP package).
https://www.avrfreaks.net/forum/usb-basics#comment-2344856

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

arlynwhitchurch wrote:
What I want is just what USB is designed to provide, turn on the app, plug in the USB and have the app find it and begins communicating with the Controller.

WCID Devices · pbatard/libwdi Wiki · GitHub

WCID Advantages

  • Actual Plug-and-Play for end-users
  • ...

via https://www.avrfreaks.net/forum/usb-basics#comment-2344556

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

arlynwhitchurch wrote:
... but where can I find the information to program the FT232RL so that it announces the company name and other details that help the GUI recognize it?

User Guide for FTDI FT_PROG Utility

(page 13)

5.4 USB_String_Descriptors

Details of the USB device manufacturer /product Description/USB Serial number can be set in the USB_String_Descriptors.

...

via https://www.ftdichip.com/Support/Utilities.htm#FT_PROG

via FT232R

 

P.S.

(page 4, next to last paragraph)

When fitted, an external EEPROM allows customization of the device default parameters such as VID, PID, Serial Number, Manufacturer Descriptor and Product Descriptor. FT_Prog provides a fast and simple way to program these parameters.

Other USB UART have internal EEPROM.

http://ww1.microchip.com/downloads/en/DeviceDoc/20005565B.pdf (page 5, middle of left column)

via MCP2221A - USB - USB Bridge

(Microchip USB UART don't have auto-baud; Microchip USB PIC UART has auto-baud)

There's significant competition in USB UART (choices ... choices)

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So, what language is the PC user interface program written in?

 

I have a couple different projects that have a PC interface to a FTDI chip, then to a micro.

 

I still recall having difficultly figuring out to enumerate the serial ports on the PC on the first of these projects.

 

On my most recent one, using Visual Studio . whatever, getting a list of (USB connected and other) serial ports is easy.

Live and learn, and the software tools provided get better and better, also.

 

Knowing that these are dedicated systems without other mission critical serial devices connected it is then easy to send a given command / text to each device found.

The device of interest recognizes the command and answers with a specific reply.

Bingo, you found your connected device.

 

That method is probably making the real programmers cringe.

One can certainly pay for their own USB VID (IIRC), and then look for your own specific device in the USB device list, but that is a costly solution, and (for me at least) more complex.

 

Make sure you follow the data sheet exactly, as there are many variants on how to connect the FTDI chip based upon how one is powering it, and its clock source, etc.

 

Interestingly, I made 1/2 dozen FTDI breakout boards when I had some spare room on a PCB I was having made.

Four of them worked perfectly, two of them failed.

Very odd, I certainly expected them all to work first time.

I check and rechecked my soldering, trace conductivity, etc., and never could fix the two little boards with one chip on them..., (very frustrating).

Point being, either use a commercial breakout board, or a known good board, for your project development.

That will limit the issues to your software, and you won't have to deal with the situation of unknow SW vs HW failure.

 

JC

 

 

 

Last Edited: Wed. Feb 13, 2019 - 08:28 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The C# code should be able to make a list of serial devices, then interrogate each of them. All without human intervention or fiddling with the ftdi chip.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If I were a customer support employee I wouldn't want to pick up the phone from no .45 wavin' angry Texas guy either.

I think we understand each other here.

 

Adding "decent" USB support to a device is not a trivial undertaking.

If you want to write good and reliable drivers, then do not use the FTDI chip stuff or anything else that is designed to emulate the obsolete RS232.

I do use and like RS232 for microcontrollers because of it's simplicity, but for regular folks on normal computers it is pretty much obsolete (and rightly so!).

 

Instead, use a microcontroller with real USB hardware support. such as the AT90USB.... series or the Altmel's with "U4".

To get this to work properly you have to buy a number from the big USB guys in the sky, called a VID (Vendor IDentification number).

Those big USB guys in the sky have made these numbers very rare (There are only 65536 of them in this whole world) and they did this on purpose to make them very expensive.

 

If you have such a number you can do very interesting things with it.

For example you can make your device behave like an USB disk. Then those Texas guys only have to put the USB connector into a brand spanking new laptop, and they can load and/or run the software directly from the emulated USB disk. No CD's or internet connection required.

 

But getting to this level of customer friendlyness is quite a challenge. You will need different hardware and also have to write a lot of software to get it to work properly.

You will also need to think about things like that software getting damaged or overwritten and how to deliver software updates.

Doing magic with a USD 7 Logic Analyser: https://www.avrfreaks.net/comment/2421756#comment-2421756

Bunch of old projects with AVR's: http://www.hoevendesign.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Re: Msg #3

 

I've told, you all, that my memory isn't what it used to be, and that was never the greatest, either!

 

Jim

 

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If Windows 10, possibly

https://github.com/Microsoft/Windows-universal-samples/blob/master/Samples/SerialArduino/cs/Scenario1_ConnectDisconnect.xaml.cs

function FindDevice

via

What is new with Serial in Windows 10 – Microsoft Windows USB Core Team Blog

...

 

2.   A Windows Runtime API for communication with Serial devices

...

2. New SerialArduino SDK Sample from above //build talk is now available including C# and Arduino sketch source code.

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the super fast replies!

 

That sounds like the information I am looking for; I will read it and give it a try.  I think I need to get a break-out board so that I can hold off on the next board turn.

 

I am communicating with the slaves via an RS-485 Multi-Drop link which is working very well.  Electric spec's give me plenty of distance and has only 1 CAT-5 cable at the Controller which daisy chains to the slaves.  It has a screaming baud rate.  I use a speak-when-spoken-to protocol to avoid collisions.

 

Thanks again.  It might be a week or two before I know if this is all going to work.

The only thing more dangerous than a software engineer with a soldering iron is a hardware engineer with a compiler.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

You can find some products, they don't need to know too much procedural knowledge. Use the editor in the background of the program to write the visual interface.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
<
You can find some products, they don't need to know too much procedural knowledge. Use the editor in the background of the program to write the visual interface.>

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Other USB UART have internal EEPROM.

Cypress USB UART have an internal EEPROM, a fractional baud rate generator, and a 48MHz clock.

CY7C65213: USB-UART LP Bridge Controller

due to Replacing FT232R with CY7C65213 USB-UART LP Bri... | Cypress Developer Community

 

"Dare to be naïve." - Buckminster Fuller