|
View:
New views
20 Messages
—
Rating Filter:
Alert me
|
| < Prev | 1 - 2 | Next > |
|
|
How to deal with comm port assignments with FTDI chipsGood day to all.
I'm having a buddy write a small utility for me using one of myriad BASIC packages out there. He gets to choose one of the following flavors: MS VB dot net Express (free version), Real Basic, Power Basic, Liberty Basic. I don't care which of the four he uses - this is (hopefully) a short term solution until I get around to writing something that is stand-alone. The utility needs to merge 2 serial comm streams into a single, combined output. It thus needs 3 serial ports which I plan to implement with FTDI FT232BM or FT232BL USB to serial adapters. I'm stuck with using a small netbook for this project - no serial ports but has 3- USB ports. I'm using these particular adapters because I have them handy - they are a tiny PCB with a USB jack on one end and TTL terminals on the other end. I need to interface to RS-422 serial ports so the TTL levels are easiest for me. Something that concerns me is that I don't know how to ensure which USB port is tethered to which comm port. Because I have 3 identical USB to serial adapters, its entirely possible that the comm port numbers will move around between the 3 USB ports everytime the computer is rebooted. Is there something that I can do to ensure that the comm port assignment stays with a particular physical USB port? Alternatively, is there something that I can do that ensures that the comm port assignment stays with a particular USB-serial adapter card? I think that I recall reading somewhere that some of the FTDI chips have eeprom that can be used to lock a particular adapter to its comm number but I'll be darned if I can find it now. Many thanks for any ideas that you might have! dwayne -- Dwayne Reid <dwayner@...> Trinity Electronics Systems Ltd Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax www.trinity-electronics.com Custom Electronics Design and Manufacturing -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: How to deal with comm port assignments with FTDI chipsOn Fri, Apr 23, 2010 at 6:47 AM, Dwayne Reid <dwayner@...> wrote:
> Is there something that I can do to ensure that the comm port > assignment stays with a particular physical USB port? Alternatively, > is there something that I can do that ensures that the comm port > assignment stays with a particular USB-serial adapter card? I think > that I recall reading somewhere that some of the FTDI chips have > eeprom that can be used to lock a particular adapter to its comm > number but I'll be darned if I can find it now. > This one? http://www.ftdichip.com/Documents/AppNotes/AN_132_Re-Assigning_COM_Port_Numbers_Using_Registry.pdf -- Xiaofan http://mcuee.blogspot.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: How to deal with comm port assignments with FTDI chipsOn Thu, 22 Apr 2010 16:47:11 -0600, "Dwayne Reid" said: > Something that concerns me is that I don't know how to ensure which > USB port is tethered to which comm port. Because I have 3 identical > USB to serial adapters, its entirely possible that the comm port > numbers will move around between the 3 USB ports everytime the > computer is rebooted. Hi Dwayne, In my limited knowledge of Windows and USB-serial adapters: A USB-serial adapter should grab the same comport number each time it is plugged into the same USB port. The port numbers will not overlap. If you plug adapter A into USB port 1 and it is assigned com4, it will always be com4 if it is plugged into USB port 1. If you plug it into another USB port it will grab the next never-used-before comport number, but plugging it back into USB port 1 it will be com4 again. A different USB-serial adapter will grab different comport numbers. Comport numbers stay reserved "forever" for their mated adapter/USB port combinations. So if you label the USB-serial adapters and the USB ports nothing should change. All of this works fine until you get into two-digit com numbers, then you mileage may vary and you might consider going to the control panel or if they are FTDI adapters they have a utility that cleans out the registry entries and you start fresh. Cheers, Bob -- http://www.fastmail.fm - Choose from over 50 domains or use your own -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: How to deal with comm port assignments with FTDI chips-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 Dwayne Reid wrote: > Good day to all. > > I'm having a buddy write a small utility for me using one of myriad > BASIC packages out there. He gets to choose one of the following > flavors: MS VB dot net Express (free version), Real Basic, Power > Basic, Liberty Basic. I don't care which of the four he uses - this > is (hopefully) a short term solution until I get around to writing > something that is stand-alone. > > The utility needs to merge 2 serial comm streams into a single, > combined output. It thus needs 3 serial ports which I plan to > implement with FTDI FT232BM or FT232BL USB to serial adapters. I'm > stuck with using a small netbook for this project - no serial ports > but has 3- USB ports. I'm using these particular adapters because I > have them handy - they are a tiny PCB with a USB jack on one end and > TTL terminals on the other end. I need to interface to RS-422 serial > ports so the TTL levels are easiest for me. > > Something that concerns me is that I don't know how to ensure which > USB port is tethered to which comm port. Because I have 3 identical > USB to serial adapters, its entirely possible that the comm port > numbers will move around between the 3 USB ports everytime the > computer is rebooted. > > Is there something that I can do to ensure that the comm port > assignment stays with a particular physical USB port? Alternatively, > is there something that I can do that ensures that the comm port > assignment stays with a particular USB-serial adapter card? I think > that I recall reading somewhere that some of the FTDI chips have > eeprom that can be used to lock a particular adapter to its comm > number but I'll be darned if I can find it now. > > Many thanks for any ideas that you might have! > > dwayne > The FT232 chips have a small eeprom area (called the EEUA) which is accessible from the d2xx device driver that FTDI provide freely. I suggest you store an ID number into each chip's eeprom and then use the d2xx driver's API to enumerate and identify each device. The d2xx driver will then allow you to read from and write to the device in a more straightforward way than using COM port emulation. The d2xx driver is really simple to use so don't be too drawn to COM ports. - -- Brendan Gillatt | GPG Key: 0xBF6A0D94 brendan {a} brendangillatt (dot) co (dot) uk http://www.brendangillatt.co.uk -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) iD8DBQFL0NfjHEhZ5Ws5poERAsiVAJ4gZNO6YUWAfCTNZ6kBSF+6ElonvgCgjlI9 bXoNg3AicTTyQft3RWGTq3M= =A1fJ -----END PGP SIGNATURE----- -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: How to deal with comm port assignments with FTDI chips>> Something that concerns me is that I don't know how to ensure which
>> USB port is tethered to which comm port. Because I have 3 identical >> USB to serial adapters, its entirely possible that the comm port >> numbers will move around between the 3 USB ports everytime the >> computer is rebooted. > > Hi Dwayne, > > In my limited knowledge of Windows and USB-serial adapters: > > A USB-serial adapter should grab the same comport number each time it is > plugged into the same USB port. The port numbers will not overlap. If > you plug adapter A into USB port 1 and it is assigned com4, it will > always be com4 if it is plugged into USB port 1. If you plug it into > another USB port it will grab the next never-used-before comport number, > but plugging it back into USB port 1 it will be com4 again. A different > USB-serial adapter will grab different comport numbers. Comport numbers > stay reserved "forever" for their mated adapter/USB port combinations. > > So if you label the USB-serial adapters and the USB ports nothing should > change. Only if the adapters have a unique serial number in them. Early FTDI chips required an external SPI EEPROM into which the relevant info could be programmed, using an FTDI utility. Later chips come with unique serial numbers, but the hooks are still there to assign your own serial numbers and other identifying info that USB uses when it enumerates. > All of this works fine until you get into two-digit com numbers, then > you mileage may vary and you might consider going to the control panel > or if they are FTDI adapters they have a utility that cleans out the > registry entries and you start fresh. I understood it would work way up into 3 digit port numbers. IIRC the maximum number of COM ports is 256! -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: How to deal with comm port assignments with FTDI chipsAlan B Pearce wrote:
> > I understood it would work way up into 3 digit port numbers. IIRC the > maximum number of COM ports is 256! > > > > On NT (XP, w2K, Vista, Win7 are really NT) since 1993, you have com 1 to com 255 Visual basic's mscomm.dll only allows up to 16 ports as it was written for "should have been strangled at birth" Windows 95. AFAIK you can edit a location in the dll to have 255 ports. Bluetooth and 3G Modems use a lot of serial ports. I also have virtual serial over TCP/IP and local virtual serial ports to interconnect applications. Linux has a different scheme. \dev\ttyNN and variants with different device name for USB -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: How to deal with comm port assignments with FTDI chips> I understood it would work way up into 3 digit port numbers. IIRC the
> maximum number of COM ports is 256! I am up to COM152 at the moment :) -- Wouter van Ooijen -- ------------------------------------------- Van Ooijen Technische Informatica: www.voti.nl consultancy, development, PICmicro products docent Hogeschool van Utrecht: www.voti.nl/hvu -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: How to deal with comm port assignments with FTDI chipsWouter van Ooijen wrote:
>> I understood it would work way up into 3 digit port numbers. IIRC the >> maximum number of COM ports is 256! >> > > I am up to COM152 at the moment :) > > Don't run my son's Java app then. He stupidly enumerates the ports and then attaches to the lowest valid one by default. This worked fine on his desktop (one real Serial port and one fictitious com2, no header) and his laptop (one USB serial adaptor). On my laptop it took 3 mins (real + USB serial + IR x 2 kinds on one physical IR port + Bluetooth + TCP/IP serial + USB Modem "serials", and virtual loopback serials to interconnect applications). So I guess maybe 10min to 25min on your system! I told him there is a good reason everyone else just has a blind list and up to user to figure via utilities or device manager what COMx the Bluetooth, USB, or remote TCP/IP serial port server box is. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Does 18F4550 have open Drain ports?I need to drive a 3.3V chip from 5V PIC (PIC18F4550). The PCB with the
3.3V chip already has 10K pullups to +3.3V on the chip inputs. (the 3.3V chip is an off the shelf iTrip type module using A7303B with 5 parallel pins to set FM Radio TX channel, I'll only be using 3 or 4 pins, instead of the normal 4 way switch, giving me 7 channels minimum) So I thought maybe drive with Open Drain. I thought did this about 7 years ago in Assembler on 16F877. But I don't know how to do it exclusively in JAL. Also I can find NO mention of "open drain" output mode on any port on 18F4550 data sheet. maybe I imagined I did this before once. The "weak pullups" mentioned in datasheet for port B and Port D would appear to be approx 5K to 20K (probably FETs). That would give 1.7V above 3.3V, and assuming clamp diodes to VDD (3.3V) then about 50uA clamp diode current. Can the Port B or Port D be open drain without pullups? Does the 18F4550 have open drain at all? I could use 4 diodes, but if the V_low Max of the 3.3V chip is above 0.7V, that won't work (many 3.3v chips the max "0" is about 150mV). So then option is 4 x BS170 fet (no resistor needed) or 4 x NPN transistors with base resistor. Or an HC logic open drain driver (if I had one to hand, I have a bunch of ULN200x chips, but more space than 4 x BS170s) The datasheet of A7303 doesn't say what the levels are for its programming pins. All is characterised for a 3.3V VDD (and off the shelf PCB has 3.3 regulator). It claims Absolute Max is 5V VDD and 5V for "pins". Thoughts? I *COULD* see if diodes to ground "program" the channel, but without a spec, how do I know that still works (if it works) when the unit is hotter or colder? A production version will likely use an 18FxxJxx or an ARM cortex M3 (I'm leaning to a higher end chip with Linux for production so MP3 playback via USB host from dongle or HDD driver using sw would work, an 8bit PIC core can't usefully do that). -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Does 18F4550 have open Drain ports?Michael Watterson ha scritto:
> I need to drive a 3.3V chip from 5V PIC (PIC18F4550). The PCB with the > 3.3V chip already has 10K pullups to +3.3V on the chip inputs. (the 3.3V >[...] What if you use the "old" trick of setting LATx registers to 0 and then set TRIS to output for dominant 0 and to input for recessive 1... ? -- Ciao, Dario -- Cyberdyne -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Does 18F4550 have open Drain ports?Michael Watterson wrote:
> I need to drive a 3.3V chip from 5V PIC (PIC18F4550). The PCB with the > 3.3V chip already has 10K pullups to +3.3V on the chip inputs. (the 3.3V > chip is an off the shelf iTrip type module using A7303B with 5 > parallel pins to set FM Radio TX channel, I'll only be using 3 or 4 > pins, instead of the normal 4 way switch, giving me 7 channels minimum) > > So I thought maybe drive with Open Drain. I thought did this about 7 > years ago in Assembler on 16F877. But I don't know how to do it > exclusively in JAL. > > Also I can find NO mention of "open drain" output mode on any port on > 18F4550 data sheet. maybe I imagined I did this before once. > by leaving the data output (port or lat) bit permanently at zero then controlling the output through the tris bit. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: How to deal with comm port assignments with FTDI chips> I told him there is a good reason everyone else just has a blind list
> and up to user to figure via utilities or device manager what COMx > the Bluetooth, USB, or remote TCP/IP serial port server box is. I think an 'auto search' is not that bad an idea, but its should be a user-activated option. It is not up to an application to decide that it can scan (and presumably try to communicate) on all available ports. There might be something critical attached to one of the ports... -- Wouter van Ooijen -- ------------------------------------------- Van Ooijen Technische Informatica: www.voti.nl consultancy, development, PICmicro products docent Hogeschool van Utrecht: www.voti.nl/hvu -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Does 18F4550 have open Drain ports?peter green wrote:
> Michael Watterson wrote: > >> I need to drive a 3.3V chip from 5V PIC (PIC18F4550). The PCB with the >> 3.3V chip already has 10K pullups to +3.3V on the chip inputs. (the 3.3V >> chip is an off the shelf iTrip type module using A7303B with 5 >> parallel pins to set FM Radio TX channel, I'll only be using 3 or 4 >> pins, instead of the normal 4 way switch, giving me 7 channels minimum) >> >> So I thought maybe drive with Open Drain. I thought did this about 7 >> years ago in Assembler on 16F877. But I don't know how to do it >> exclusively in JAL. >> >> Also I can find NO mention of "open drain" output mode on any port on >> 18F4550 data sheet. maybe I imagined I did this before once. >> >> > You can make any IO pin on a pic act in an effectively open drain mode > by leaving the data output (port or lat) bit permanently at zero then > controlling the output through the tris bit. > But are the week pullup always enabled on port D and B for inputs? though likely nn uA from 5V week pull up to a 3.3V input pulled up via external 10K to 3.3V isn't fatal. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Does 18F4550 have open Drain ports?Michael Watterson ha scritto:
> But are the week pullup always enabled on port D and B for inputs? no, and are there any for PORTD? -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: How to deal with comm port assignments with FTDI chipsWouter van Ooijen wrote:
>> I told him there is a good reason everyone else just has a blind list >> and up to user to figure via utilities or device manager what COMx >> the Bluetooth, USB, or remote TCP/IP serial port server box is. >> > > I think an 'auto search' is not that bad an idea, but its should be a > user-activated option. It is not up to an application to decide that it > can scan (and presumably try to communicate) on all available ports. > There might be something critical attached to one of the ports... > > screen loads is a bad idea. The 1st time I thought I hadn't clicked properly (the application also OUGHT to check if it's already running, it didn't!). I've no idea what the java enumerate ports function does, it may just interrogate the registry or something. It doesn't appear to affect the actual port(s). On linux also this isn't simple as serial port naming conventions seem to vary and if you look in /dev/ simply for existence of a port name you might see only ports that exist or all possible ports depending on distribution, The Java library in mention, is not part of Sun/Oracle as they have dropped serial support(!) but does support Linux, Mac and Windows. The enumerate function does find a USB based serial port on Ubuntu (the Netbook has no physical serial) and also PCIe card (that uses PCIe to PCI bridge internally) based dual serial port on XP laptop also with no physical port. But on your PC, you might think the program is broken :) I'm fond of my 2002 Inspiron 8200 laptop as it has 1600x1200 screen @ 15.6" approx (1200 line screen if you can even get it, is now WS, so 17" 1920x1200, or more likely 1920x1080). 1200 lines good for PDF datasheets. Real serial, parallel, PS/2 and firewire ports. Sadly only USB1.1, but I have a PCMCIA dual USB2.0 card. I dread trying to get a replacement screen and port wise. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Does 18F4550 have open Drain ports?Dario Greggio wrote:
> Michael Watterson ha scritto: > >> But are the week pullup always enabled on port D and B for inputs? >> > > > no, and are there any for PORTD? > Yes, Port D has them as well as Port B But re-reading the datasheet reveals that by default the pullups are off. /RBPU turns on all port B pullups /RDPU turns on all port D pullups my tact switches are on port B and the LCD and FM TX are using Port D, so I can leave port D as it is and turn on pullups on port B -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: Does 18F4550 have open Drain ports?Michael Watterson ha scritto:
>> >> no, and are there any for PORTD? >> > Yes, > Port D has them as well as Port B > But re-reading the datasheet reveals that by default the pullups are off. > /RBPU turns on all port B pullups > /RDPU turns on all port D pullups thank you Michael, must've missed them then :) I usually use PORTB for inputs (must be legacy) and PORTD for output. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: How to deal with comm port assignments with FTDI chipsDwayne Reid wrote:
> Is there something that I can do to ensure that the comm port > assignment stays with a particular physical USB port? Alternatively, > is there something that I can do that ensures that the comm port > assignment stays with a particular USB-serial adapter card? I think > that I recall reading somewhere that some of the FTDI chips have > eeprom that can be used to lock a particular adapter to its comm > number but I'll be darned if I can find it now. If it's a one-off application, as Bob has suggested once you plug in the adapters, they are each assigned a COM port number, and it sticks as long as you plug them into the same USB ports. A better solution is to use FTDI's D2XX API. It allows you to sidestep the issue completely, as it allows you to communicate with each FTDI device directly, eliminating the hassle of having to deal with virtual COM ports. http://www.ftdichip.com/Documents/ProgramGuides/D2XX_Programmer%27s_Guide(FT_000071).pdf You will need to use FT_Prog to assign each adapter a unique name. http://www.ftdichip.com/Resources/Utilities.htm#FT_Prog Vitaliy -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: How to deal with comm port assignments with FTDI chipsBrendan Gillatt wrote:
> The FT232 chips have a small eeprom area (called the EEUA) which is > accessible from the d2xx device driver that FTDI provide freely. > > I suggest you store an ID number into each chip's eeprom and then use the > d2xx driver's API to enumerate and identify each device. The d2xx driver > will then allow you to read from and write to the device in a more > straightforward way than using COM port emulation. The d2xx driver is > really simple to use so don't be too drawn to COM ports. > D'oh. Didn't see your post before sending mine. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: How to deal with comm port assignments with FTDI chipsSome of my colleagues at work have told me that com port assignments
to FTDI devices can change even if they are not unplugged. Apparently the enumeration order on boot is not guaranteed and sometimes the assignments can change due to this. Sean On Fri, Apr 23, 2010 at 7:52 PM, Vitaliy <piclist@...> wrote: > Dwayne Reid wrote: >> Is there something that I can do to ensure that the comm port >> assignment stays with a particular physical USB port? Alternatively, >> is there something that I can do that ensures that the comm port >> assignment stays with a particular USB-serial adapter card? I think >> that I recall reading somewhere that some of the FTDI chips have >> eeprom that can be used to lock a particular adapter to its comm >> number but I'll be darned if I can find it now. > > If it's a one-off application, as Bob has suggested once you plug in the > adapters, they are each assigned a COM port number, and it sticks as long as > you plug them into the same USB ports. > > A better solution is to use FTDI's D2XX API. It allows you to sidestep the > issue completely, as it allows you to communicate with each FTDI device > directly, eliminating the hassle of having to deal with virtual COM ports. > > http://www.ftdichip.com/Documents/ProgramGuides/D2XX_Programmer%27s_Guide(FT_000071).pdf > > You will need to use FT_Prog to assign each adapter a unique name. > > http://www.ftdichip.com/Resources/Utilities.htm#FT_Prog > > Vitaliy > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
| < Prev | 1 - 2 | Next > |
| Free embeddable forum powered by Nabble | Forum Help |