Panda Com port

I am new with Fez Panda and have a basic question. Can I use the USB port as serial to communicate between PC and Panda? I did a little search, it seems TeraTerm can make the USB as Virtual Comm. Is this the correct way to do it? Thanks

see CDC section in book.

Gus is referring to this microframeworkprojects.com

The thing that is not all that good explained in the book is that you have to pull the mode pin to ground. So, upload your program, remove the USB cable and pull the mode pin to ground. Put the USB cable back in and you have your virtual COM port.

Also the driver can be a pain to find (I have asked for it on the download page) but you can find it here. http://www.ghielectronics.com/downloads/NETMF/Library%20Documentation/CDC_Driver.inf

Hi Geir. Is the “mode” pin thing specific to Panda. As I don’t have to do that on Domino. Just have the do the break/continue jazz from VS.

There is a separate set of pads on the Domino.
Down by the analogue ports.
You can solder a little 2 pin header and use a jumper (like the ones on hardisk slave select)

Hi Geir,
I followed the link and tried the demo code USB Debugging with Virtual COM Channel in the book. It deployed successfully, if i pull mode to ground, there is no new port after power cycle. I am confused. windows does find a virtual port after power cycle the board without the mode pin. Then I tried to debug, during rebooting, it lost the virtual port. :’(
any idea what I did wrong? Thanks

Gary

During deploy, the USB port (and CDC fro that matter) will reset.

Do you have real serial port connected? and you are debugging over serial? You need to do this before you can use the USB port for other things…like CDC

Hi Gus,
From the usb client section, it states: USB Debugging with Virtual COM Channel
There are cases where developers may prefer to use the same USB cable for deploying/debugging, and at the same time, enable CDC (Virual Serial) port on the same USB interface. GHI exclusively supports just that.

My take is I can use the same USB for debugging and serial communication with PC(virual serial).

To answer your question, I don’t have any real com port connected.
what do I have to do before using USB as CDC/virtual comm port?

Ok now I know what you are doing. this is why we always putting in some code so we are not guessing.

Yes you can have CDC (virtual serial) + debugging on same USB cable. And yes every time your deploy the USB connection will reset and so the virtual serial will reset.

Load the application and run it, windows will ask for drivers, direct windows to the right drivers as explained in docs and you will end up with 2 things on your PC, debug interface and virtual serial port.

open “device manager” and look to verify.


All above is in docs and in book microframeworkprojects.com

I just realize that I have push reset after deploy.

I am almost there and I can debug and serial communication via the usb cable when I have VS studio debugging. If I only deploy the code to Panda, it seems freeze up and try to look for debugger, and refuse to move on the main code.

So I switch to the normal CDC, window can’t find driver for it. I googled and can’t find online. where can I download one for XP?

Thanks

Thanks for all the help. I have the CDC driver installed, the mode pin to ground, it works. But in some occasions XP does not detect it, so no virtual port show up in the port list. I power cycle the XP, the Panda. It just happens sometime. I tried on 2 pc, 2 Panda.
If I remove the mode pin, the XP has no problem to detect it as .net debug port.

any one has experience this before? or CDC just works perfect for you?

This is a minor issue in windows. If you create a virtual COM port on windows and open teh COM port. Then you unplug the CDC device and plug it back in while port is open, you will end up in a state where it maybe difficult to reopen the virtual COM port. You need to close the port, disconnect the device again and then plug it back in and now you can try to open the COM port.

In my code, I always make sure to close port on exiting, and I also reboot pc and panda a few times.
Could this be the debug+cdc driver I installed for debugging? XP confuse with 2 different cdc driver?

debug+CDC shouldn’t be the problem

It becomes very frustrating. Here is part of the code:
if (Configuration.DebugInterface.GetCurrent() == Configuration.DebugInterface.Port.USB1)
throw new InvalidOperationException("Current debug interface is USB. ");
USBC_CDC cdc = USBClientController.StandardDevices.StartCDC();

It is same as the code in the book.
Here is what I did, I deploy it when the mode is not connected to gnd. The usb is used as .net debug by XP.
Then I unplug usb, put a jumper between mode and gnd, this is where it gets strange. when i plug usb back, xp sometime does not see any change in usb,
sometime xp think it is .net debug, only a few time, xp correctly configure it as com port.

How can I trouble shoot it? put a resist between mode and gnd :’(

Yes because every time you deploy, the CDC driver resets and windows doesn’t do a great job in that area, especially if the CDC port was open in a windows application but then the CDC device (FEZ) did reset.

Why not use CDC separate from debugging. It least for now since you are doing a lot of debugging (reseting the device)

This makes it more confusing. What are you trying to accomplish? Debugging over serial port will really save you a lot of efforts when you need to use USB client for something beside debugging.

I finished the debugging and I am using CDC only by jumping the gnd with mode, is this correct to setup CDC?

what frustrates me is the CDC less reliable than CDC+debug. with your and others’ help, I did not have too much problem to get the CDC+debug working.
I must did some steps wrong with CDC only.

Ok now I understand. Yes CDC should be very solid. Maybe the problem is not having good power source? Have you tried powered hub? Or power pack