Reply by boB G June 27, 20132013-06-27
I ~think~ that I would like to be able to read the ID of whatever has connected to each living comm port and based on what info has been enumerated to windows, I can detect if my unit is occupying one or more of those ports. I think that might work. But that information I'm not sure where to find. Maybe that is in a progamming windows book ?

boB

--- In l..., "capiman26061973" wrote:
>
> Hello boB,
>
> > Next thing I need to find out, and maybe that forum is
> > the place, is to see how, when I plug in a virtual com port,
> > how to automatically find the virtual com port it has been
> > plugged in to so the user does not have to open up control
> > panel and device manager and manually change ports, etc.
>
> question is "what is the right com port?".
> You can enumerate com ports. You find all,
> but what is the one you want to connect?
> Or do you have only one and then want to automatically select this?
>
> Best regards,
>
> Martin
>

An Engineer's Guide to the LPC2100 Series

Reply by capiman26061973 June 23, 20132013-06-23
Hello boB,

> Next thing I need to find out, and maybe that forum is
> the place, is to see how, when I plug in a virtual com port,
> how to automatically find the virtual com port it has been
> plugged in to so the user does not have to open up control
> panel and device manager and manually change ports, etc.

question is "what is the right com port?".
You can enumerate com ports. You find all,
but what is the one you want to connect?
Or do you have only one and then want to automatically select this?

Best regards,

Martin

Reply by boB G June 23, 20132013-06-23
--- In l..., Xiaofan Chen wrote:
>
> On Wed, Jun 12, 2013 at 8:40 AM, boB G wrote:
> > I didn't think that changing the baud rate in windows for
> > a virtual com port did anything at all.
>
> If it is pure virtual com port, then that is true. If there is a
> real serial port after, then it can use useful. You may want
> to read the spec for USB CDC class from usb.org.
>
> > As far as how windows USB drivers work and integrate together, I
> > believe that all engineers and programmers that know about how
> > this all works are either retired or dead.
>
> That is certainly not true. If you head to the ntdev mailing list,
> then you will know quite a few experts there, one of them
> is Tim Roberts.
> http://www.osronline.com/showlists.cfm?list=ntdev
Thank you for that forum link and name !! That is the kind of
dialog I like to see ! OK, so there is one person living !

Seriously, I have found it next to impossible to find anyone
that knew anything about how USB drivers, windows incorporation
really worked.

Next thing I need to find out, and maybe that forum is
the place, is to see how, when I plug in a virtual com port,
how to automatically find the virtual com port it has been
plugged in to so the user does not have to open up control
panel and device manager and manually change ports, etc.

I have googled my pants off trying to find information
like that and nothing appeared. That of course in addition
to other information regarding setup and restting, etc.

boB

>
> > BTW, we find that windows 8 works much better overall with our
> > LPCUSB implementation of CDC virtual com ports than other
> > versions of windoze for some unknown reason.
> >
> --
> Xiaofan
>

Reply by Naresh Panchal June 20, 20132013-06-20
Hi Yusuf,

Thanks.
On Jun 19, 2013 12:29 PM, "Yusuf Husainy" wrote:

> **
> Hi Naresh,
>
> The code I was using is from the VirtualCOM.zip file hosted on this
> group's files section. I just modified the SetSIOBaudrate() function in
> vcomuser.c, to the correct values, i.e., modified the U0DLL, U0DLM, U1DLL
> and U1DLM values to match the requests send by the host side PLPU-S2K
> driver.
>
> If you explore the source code in the above .zip file, you will understand
> how it works. After modifying this, it worked great.
>
> Again, thanks everyone for their replies.
>
> Regards,
> Yusuf Husainy.
>
> ________________________________
> From: Naresh Panchal
> To: l...
> Sent: Thursday, 13 June 2013 9:42 PM
> Subject: Re: [lpc2000] Re: VirtualCOM port Host side-Driver problem-
> PLPU-S2K
> Hi Yusuf,
>
> Can you share working code of virtual com? I also want to implement it.
> On Jun 13, 2013 10:54 AM, "Yusuf Husainy" wrote:
>
> > **
> >
> >
> > Hi,
> >
> > I have solved my problem.
> >
> > I did not look closely at the LPC VCOM code provided by Philips. There
> > were errors in the BaudRate calculation, when a Vendor request was
> received
> > to change the baud rate.
> >
> > Everything is working great now.
> >
> > Thanks to everyone who repled to my post, it gave me insights and
> > solutions.
> >
> > Regards,
> > Yusuf Husainy.
> >
> > ________________________________
> > From: Xiaofan Chen
> > To: l...
> > Sent: Wednesday, 12 June 2013 6:43 AM
> > Subject: Re: [lpc2000] Re: VirtualCOM port Host side-Driver problem-
> > PLPU-S2K
> >
> >
> >
> > On Wed, Jun 12, 2013 at 8:40 AM, boB G wrote:
> > > I didn't think that changing the baud rate in windows for
> > > a virtual com port did anything at all.
> >
> > If it is pure virtual com port, then that is true. If there is a
> > real serial port after, then it can use useful. You may want
> > to read the spec for USB CDC class from usb.org.
> >
> > > As far as how windows USB drivers work and integrate together, I
> > > believe that all engineers and programmers that know about how
> > > this all works are either retired or dead.
> >
> > That is certainly not true. If you head to the ntdev mailing list,
> > then you will know quite a few experts there, one of them
> > is Tim Roberts.
> > http://www.osronline.com/showlists.cfm?list=ntdev
> >
> > > BTW, we find that windows 8 works much better overall with our
> > > LPCUSB implementation of CDC virtual com ports than other
> > > versions of windoze for some unknown reason.
> > >
> >
> > --
> > Xiaofan
> >
> > [Non-text portions of this message have been removed]
> >
> >
> > [Non-text portions of this message have been removed]
>
>
Reply by Yusuf Husainy June 19, 20132013-06-19
Hi Naresh,

The code I was using is from the VirtualCOM.zip file hosted on this group's files section. I just modified the SetSIOBaudrate() function in vcomuser.c, to the correct values, i.e., modified the U0DLL, U0DLM, U1DLL and U1DLM values to match the requests send by the host side PLPU-S2K driver.

If you explore the source code in the above .zip file, you will understand how it works. After modifying this, it worked great.

Again, thanks everyone for their replies.

Regards,
Yusuf Husainy.
________________________________
From: Naresh Panchal
To: l...
Sent: Thursday, 13 June 2013 9:42 PM
Subject: Re: [lpc2000] Re: VirtualCOM port Host side-Driver problem- PLPU-S2K


Hi Yusuf,

Can you share working code of virtual com? I also want to implement it.
On Jun 13, 2013 10:54 AM, "Yusuf Husainy" wrote:

> **
> Hi,
>
> I have solved my problem.
>
> I did not look closely at the LPC VCOM code provided by Philips. There
> were errors in the BaudRate calculation, when a Vendor request was received
> to change the baud rate.
>
> Everything is working great now.
>
> Thanks to everyone who repled to my post, it gave me insights and
> solutions.
>
> Regards,
> Yusuf Husainy.
>
> ________________________________
> From: Xiaofan Chen
> To: l...
> Sent: Wednesday, 12 June 2013 6:43 AM
> Subject: Re: [lpc2000] Re: VirtualCOM port Host side-Driver problem-
> PLPU-S2K
>
> On Wed, Jun 12, 2013 at 8:40 AM, boB G wrote:
> > I didn't think that changing the baud rate in windows for
> > a virtual com port did anything at all.
>
> If it is pure virtual com port, then that is true. If there is a
> real serial port after, then it can use useful. You may want
> to read the spec for USB CDC class from usb.org.
>
> > As far as how windows USB drivers work and integrate together, I
> > believe that all engineers and programmers that know about how
> > this all works are either retired or dead.
>
> That is certainly not true. If you head to the ntdev mailing list,
> then you will know quite a few experts there, one of them
> is Tim Roberts.
> http://www.osronline.com/showlists.cfm?list=ntdev
>
> > BTW, we find that windows 8 works much better overall with our
> > LPCUSB implementation of CDC virtual com ports than other
> > versions of windoze for some unknown reason.
> > --
> Xiaofan
>
> [Non-text portions of this message have been removed]
>
>
>
[Non-text portions of this message have been removed]

Reply by rtstofer June 18, 20132013-06-18
--- In l..., Naresh Panchal wrote:
>
> Hi Yusuf,
>
> Can you share working code of virtual com? I also want to implement it.
> On Jun 13, 2013 10:54 AM, "Yusuf Husainy" wrote:
>

People come here to get help with THEIR problems. They seldom provide any feedback on whether the help they received solved the problem.

Most will claim that "my company owns the code" even though they got it from us or it was provided by a company.

Some days I like to rant...

Richard

Reply by Naresh Panchal June 13, 20132013-06-13
Hi Yusuf,

Can you share working code of virtual com? I also want to implement it.
On Jun 13, 2013 10:54 AM, "Yusuf Husainy" wrote:

> **
> Hi,
>
> I have solved my problem.
>
> I did not look closely at the LPC VCOM code provided by Philips. There
> were errors in the BaudRate calculation, when a Vendor request was received
> to change the baud rate.
>
> Everything is working great now.
>
> Thanks to everyone who repled to my post, it gave me insights and
> solutions.
>
> Regards,
> Yusuf Husainy.
>
> ________________________________
> From: Xiaofan Chen
> To: l...
> Sent: Wednesday, 12 June 2013 6:43 AM
> Subject: Re: [lpc2000] Re: VirtualCOM port Host side-Driver problem-
> PLPU-S2K
>
> On Wed, Jun 12, 2013 at 8:40 AM, boB G wrote:
> > I didn't think that changing the baud rate in windows for
> > a virtual com port did anything at all.
>
> If it is pure virtual com port, then that is true. If there is a
> real serial port after, then it can use useful. You may want
> to read the spec for USB CDC class from usb.org.
>
> > As far as how windows USB drivers work and integrate together, I
> > believe that all engineers and programmers that know about how
> > this all works are either retired or dead.
>
> That is certainly not true. If you head to the ntdev mailing list,
> then you will know quite a few experts there, one of them
> is Tim Roberts.
> http://www.osronline.com/showlists.cfm?list=ntdev
>
> > BTW, we find that windows 8 works much better overall with our
> > LPCUSB implementation of CDC virtual com ports than other
> > versions of windoze for some unknown reason.
> > --
> Xiaofan
>
> [Non-text portions of this message have been removed]
>
>
>
[Non-text portions of this message have been removed]

Reply by Yusuf Husainy June 13, 20132013-06-13
Hi,

I have solved my problem.

I did not look closely at the LPC VCOM code provided by Philips. There were errors in the BaudRate calculation, when a Vendor request was received to change the baud rate.

Everything is working great now. 

Thanks to everyone who repled to my post, it gave me insights and solutions.

Regards,
Yusuf Husainy.
________________________________
From: Xiaofan Chen
To: l...
Sent: Wednesday, 12 June 2013 6:43 AM
Subject: Re: [lpc2000] Re: VirtualCOM port Host side-Driver problem- PLPU-S2K

 
On Wed, Jun 12, 2013 at 8:40 AM, boB G wrote:
> I didn't think that changing the baud rate in windows for
> a virtual com port did anything at all.

If it is pure virtual com port, then that is true. If there is a
real serial port after, then it can use useful. You may want
to read the spec for USB CDC class from usb.org.

> As far as how windows USB drivers work and integrate together, I
> believe that all engineers and programmers that know about how
> this all works are either retired or dead.

That is certainly not true. If you head to the ntdev mailing list,
then you will know quite a few experts there, one of them
is Tim Roberts.
http://www.osronline.com/showlists.cfm?list=ntdev

> BTW, we find that windows 8 works much better overall with our
> LPCUSB implementation of CDC virtual com ports than other
> versions of windoze for some unknown reason.
>

--
Xiaofan



[Non-text portions of this message have been removed]

Reply by Xiaofan Chen June 11, 20132013-06-11
On Wed, Jun 12, 2013 at 8:40 AM, boB G wrote:
> I didn't think that changing the baud rate in windows for
> a virtual com port did anything at all.

If it is pure virtual com port, then that is true. If there is a
real serial port after, then it can use useful. You may want
to read the spec for USB CDC class from usb.org.

> As far as how windows USB drivers work and integrate together, I
> believe that all engineers and programmers that know about how
> this all works are either retired or dead.

That is certainly not true. If you head to the ntdev mailing list,
then you will know quite a few experts there, one of them
is Tim Roberts.
http://www.osronline.com/showlists.cfm?list=ntdev

> BTW, we find that windows 8 works much better overall with our
> LPCUSB implementation of CDC virtual com ports than other
> versions of windoze for some unknown reason.
>

--
Xiaofan
Reply by boB G June 11, 20132013-06-11
I didn't think that changing the baud rate in windows for a virtual com port did anything at all.

As far as how windows USB drivers work and integrate together, I believe that all engineers and programmers that know about how this all works are either retired or dead.

BTW, we find that windows 8 works much better overall with our LPCUSB implementation of CDC virtual com ports than other versions of windoze for some unknown reason.

boB

--- In l..., Yusuf Husainy wrote:
>
> Kevin, 
>
> Thanks for all your replies.
>
> I have done furthur work, and aI have found out that in the PLPU-S2K driver, the file ioctl.c, gets IRP packets from the user, which contain the values regarding the COM9 parameters. IOCTL requests issued by the application using the VirtualCOM port(In this case the hyper terminal) control the UART0 parameters of the LPC2148 device(COM7). Now, I also analysed the USB requests from the host, I found out, it issues requests for data bits of 7 bits in length and a Baudrate value of 0x60, which maps to no known values in the device firmware of LPC, given in the VirtualCOM.zip file hosted here: http://tech.groups.yahoo.com/group/lpc2000/files/ It is at the bottom of the page, maybe you can have a look at it. I an using this excat firmware. 
>
> Any help from anyone would be helpful.
>
>
> ________________________________
> From: Yusuf Husainy
> To: "l..."
> Sent: Tuesday, 11 June 2013 2:06 PM
> Subject: Re: [lpc2000] Re: VirtualCOM port Host side-Driver problem- PLPU-S2K
>
>
>
>  
> Hi Kevin,
>
> You were right, I consulted with the hardware engineers, and found out, that the pull ups(D+ and D-) were connected to +Vcc simultaneously(I was using a switch to switch between full-speed and low-speed). I am using the Keil IDE and the example Philips had given..
>
> I can connect and then disconnect the device. But if I try to connect it again, without resetting my board, windows does not recognise it. I have to reset the board, and then reconnection will take place successfully. 
>
> Now, when the device is connected, I can communicate between the VCOM and UART0. I configure VCOM(COM9) to 9600, and then UART0(COM7) to 9600. 
>
> If It try to communicate, garbage values are displayed on both the COM ports.
>
> However, If I set the baudrate of COM9 to 38400, leaving COM7 unchanged, communication takes place flawlessly. 
>
> What I don't understand is How the Host side VirtualCOM driver of Philips works, I mean, If I set COM9 to a particular Baudrate(say 9600), then this is communicated as a Vendor request to the device, and I presume, this request calls a function which actually sets the baudrate of the LPC2148's UART0 to 9600. So, If I have the COM7(connected to UART0) set at 9600, no change should take place. So, what does actually happen if I set the baudrate of the COM9 to a particular value?(I mean, down below, the physical link is USB FullSpeed, at 12Mbps max, and the VCOM Bulk transfer would get a part of it.)
>
> ________________________________
> From: Kevin
> To: l...
> Sent: Tuesday, 11 June 2013 12:46 PM
> Subject: [lpc2000] Re: VirtualCOM port Host side-Driver problem- PLPU-S2K
>
>
>  
> I'm not familiar with the example you used, i used an example from IAR which worked reasonably well. Although I had to convert it from IAR to GCC and get it to work with FreeRTOS.
>
> Make sure that your soft-connect, the switchable pullup on the D+ line, works.
>
> If you have a USB-analyzer i suggest you use it, or see if you can borrow one. It helped me a lot to get it working.
>
> If your device is self-powered you could try restarting your device after disconnecting it from the pc. If that works, than you might have a problem with your disconnect/connect routines.
>
> --
> Kevin
>
> --- In l..., Yusuf Husainy wrote:
> >
> > Hi Kevin,
> >
> > That worked for me. Windows does not crash now.
> >
> > But, now, Windows does not recognise the device at all. Earlier, at the first time, it could detect it, now, that also does not happen.
> >
> > I saw in the device manager, the entry for the unknown device is there under the USB controllers field, in the details tab, the vendor id and product shown is 0, however, the actual vendor id and product id in the PLPU-S2K.INI file, and in my device descriptor match. 
> >
> > Maybe, the host is not able to read the descriptor correctly, so it shows a vendor id and product id of 0.
> >
> >
> >
> >
> > ________________________________
> > From: Kevin
> > To: l...
> > Sent: Monday, 10 June 2013 5:29 PM
> > Subject: [lpc2000] Re: VirtualCOM port Host side-Driver problem- PLPU-S2K
> >
> >
> >
> >  
> > Before you unplug the device you need to make sure that the virtual port is closed, in other words close your serial terminal program. My problem with almost all USB serial ports is that they fail when I forget to close the port before disconnecting them.
> >
> > Although I can usually get it working again by closing my serial terminals and then unplugging the device again. Wait a while and then plug it in again.
> >
> > --
> > Kevin
> >
> > --- In l..., Yusuf Husainy wrote:
> > >
> > > Hello all,
> > >
> > > I am working on Virtual COM port driver for a LPC2148 based Board. I have a custom board, and have slightly modified the code for the VirtualCOM driver hosted on this mailing list for LPC2148.
> > >
> > >
> > > 1.
> > > Now, when I connect my device, the Host driver install correctly, and creates two Virtual COM ports - COM9, COM10. 
> > >
> > > Initially, I have configured UART0(COM7) to 9600 for debug messages. 
> > >
> > > Then I connect COM9 with 9600 baud rate, so after this, COM9 is connected to COM7(UART0), but when I type anything on COM9, garbage data gets printed on COM7.
> > >
> > > I thought this was a baudrate problem, so I changed the baudrate of COM9 to 38400, leaving the baudrate of COM7 at 9600 only.
> > >
> > > After this, it worked like a charm, I was able to send and receive data simultaneously, on both sides.
> > >
> > > So, my question is, why is this happening, why can't the COM9 operate at 9600 correctly.
> > >
> > > 2.
> > > The other problem is, when I disconnect my device(plugging out the USB cable from my device), The host side VCOM driver does not get unloaded automatically. Due to this, If I try to connect the device again, Windows pops out a message, that the USB device is unrecognised and has malfunctioned. This does not go away until I restart my PC.
> > >
> > > I had also thought an easier way way to solve this problem would be to just go to Device Manager and uninstall the driver, instead of restarting my PC. But, if I try to do this, i.e., Uninstall the driver for COM9, in device manager, Windows crashes, and reboots automatically, every single time.
> > >
> > > I suspect this is a problem with the Windows side Host VCOM driver.
> > >
> > > I am stuck with these two problems, I would appreciate any help.
> > >
> > > Regards,
> > > Yusuf Husainy.
> > >
> > > [Non-text portions of this message have been removed]
> > >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
> [Non-text portions of this message have been removed]
>
>
>
>
> [Non-text portions of this message have been removed]
>