Problem: How can I detect which usb port my propeller is on programatically?
BillDer
Posts: 33
I have a FTDI chip on my own pcb with the prop chip. I can detect it and program it from the Propeller tool just fine and I can send and receive data from a basic program. The problem is that as I move it from computer to computer, my board get reassigned different port numbers. I would like to write code in basic that scans the available ports and then selects the one with the propeller on it. Much the same way the Propeller tool does when you select F7 Identify Hardware. How does the Propeller Tool do it? Any suggestions would be much appreciated.
Comments
I posted an example of using propellent.dll over on Savage Circuits using Delphi
http://www.savagecircuits.com/forums/showthread.php?338-Using-Propellent.dll-in-your-PC-User-Interface-for-your-Prop-Application
You use getversion and it returns a string which contains the com port. Parse it to get the port number to open in your program.
There are also threads on using VB over there.
Member Unsoundcode has VB example here
http://forums.parallax.com/showthread.php?126247-Using-Propellent.DLL-with-VS2010&highlight=propellent
Tom
I have written a HTML application (.hta extension). It uses vbscript to read the registry and find the com ports (even if the device is not currently connected) and displays them in a web-type page.
It is called EnumPorts.hta and is run by double-clicking it in Windows Explorer or a shortcut.
I just modified it to provide special handling for FTDI devices it identifies.
The cursor changes to a "vertical text" cursor if you move it over an FTDI device in the "Device Desc" column.
If you click that row, it prompts you to enter a description for that unique id and stores it in the registry. When you run the EnumPorts.hta the next time, the stored descriptions appear in the list.
You may find it useful...