Main Site Documentation

Make interfaz with Windows Desktop app and Fez Domino App Througth usb client port


#1

I need to create two applications:

  1. Windows desktop app (for have access to the data base)
  2. Fez Domino App (to control the board components)

I have a fez domino board just as it was delivered from the factory (without any adicional card), i want to send data trough the usb cable from my windows application for the board itself to manage that information and execute the right action (i need to receive too information from the board).

In Example:

-The windows app send the data “open port 1” -> The board application receive the information and send a digital signal to the number 1 port.
-The windows app send a request to know if there is any digital sign on port one <- The board application returns the data informing if there is or there is digital sign (True or false)

Questions:

  1. The comunications usb port included on the board is useful to me to execute that action? or which one must i use? ( I read the begginers guide but i dont understand how to configure it )

  2. How should i make the interfaz between the desktop application and the board application? I have not found yet any information about it. ( Example codes for send data from desktop app and how can i recieve it from Domino app )

Thank you very much.


#2

You interface the PC to FEZ using USB or serial port.

Serial port…that is easy but you need to add minimal circuitry

USB port…that is also easy, thanks to out exclusive CDC class support (virtual serial port). The only problem is that you are using USB already for debugging so you can’t use it for CDC as well. You will need to do debugging on serial so you can use CDC in your application.
Read the ebook under USB Client section.

But, I have a trick. You can load your application over USB as usual (CDC application) and then connect a jumper on MODE pin and reset the board. The FEZ will reset in serial mode but you do not care about that. You care that the USB port is now free.

========================
FEZ community, can someone make a tutorial on how to use USB for deploying and make CDC at the same time? 500 points if someone makes it happen and another 300 for nicely done video tutorial :wink: Your CDC application will be a commander that can be used to control the on-board LED using commands you send from terminal program to FEZ CDC virtual serial port.


#3

That sounds like a challenge to me Gus! 800 points… mm - i likey!

Reading the docs, it says you cannot set the mode pin and use the LED port at the same time. If you do, you risk damage.


#4

Good point Mark. This should be in the tutorial.

You can pull down using 1K resistor instead of connecting to ground and then you will be able to use the LED. Also explain that if they do not have 1K resistor then connect to ground but then they can NOT use this pin anymore in the application

…So, do I add 800 points? :wink:


#5

Hello guys,

What is the best way to use the ports:

  1. Use the USB client port to interface with the PC or use it for debugging?
  2. Add a serial port to the board and use it to interface with the PC or use it for debugging?

What is the recommendation of you to make my programming easier?

Note: My desktop application will be on a laptop, I have no serial ports there.


#6

Debugging on serial is slower than USB.

Once you have serial added, all you need is a jumper to switch the interfaces easily.


#7

So, do you recommend i must add a serial port and use the USB client port for debugging and Serial port for the interface with the pc?


#8

When needing to use the FEZ as a USB client I just use a little USB<->TTL Level serial adapter made by Parallax ($15) for debugging. It works great with the only disadvantage being having two USB cables hooked up. For your end application a USB connection is typically much easier for a user to set up than a serial.


#9

Done, making the video now :slight_smile:


#10

Hi,

This is something I thought of a couple of days ago.
My solution was to try and enumerate the FEZ Domino
as a compound device. Use the debug endpoints as usual and add
one in endpoint and one out endpoint for cdc class.
I do have some USB background but never as a compound device.
What do you think?

S.B.D


#11

It’s mentioned in the eBook SBD that they used to have this, however due to support issues (users doing things incorrectly and breaking stuff) they discontinued it.


#12

MarkH…

do you think that with your video we can finally find the answer to our problem with the USB client port for debugging and for making the interface ( at same time ) from a PC Application to Fez Domino?


#13

Too bad… Breaking stuff is part of the fun :slight_smile: .
Is it possible to add this functionality back?
I think its time to read the ebook. RTFM.


#14

The problem with supporting both is that if you were to make any mistake, you will basically corrupt the registry and will never be able to get it to work afterwards :frowning: … then how do we help you after you do that? :slight_smile:

We will look into options soon.


#15

Sorry Jorge, but you can use the USB client or you can use the USB debugger. You can’t have both in the one application.

One thing which really confuses me about the USB CDC driver is it seems to work more like a socket than a SerialPort. I would be nice if the CDC class supported all the normal methods and events available on a SerialPort.


#16

Ok well the video is uploading, you can download the solution and schematic here: (link removed)

Video here:


#17

Hi MarkH.

About your video I have 2 questions.

  1. What are you using for making the jumper in the mode pin? i have a new fez domino and the mode-pin are just two holes. Can you explain me or show me one picture?

  2. Can you show me a C# code example for doing the connectivity from a Windows desktop app to the fez domino board? In the video you use a pre-developed app for the connectivity but in my project i must do the desktop app from scratch and i do not understand how can i send data to domino and receive data back to my desktop app.

Could you show me an example in which the windows desktop application send a signal to the board to turn on one led, and inmediatly the board send back one signal notifying that the led is turned on to the desktop app.


#18

You can just solder some male header pins onto the Fez in those two holes (check on the Fez product site - they have headers listed) and then connect Mark’s circuit to that.

For the second question, you just have to write an app that handles a serial connection. In the case of Mark’s SAMPLE program you just need to press a key, so in your app you just need to SEND a key. Search the internet for a simple serial c# app and learn a bit from that - we can’t teach you to fish if we just write the whole code for you :wink:


#19

Hello Brett,

The Mark’s sample show how you can send data througth usb client… can you tell me what is the way for recieve data from usb client port to fez? some event for listening the usb client port?


#20

Did you look at USB Client -> CDC in ebook?