Hi all,
I have a FEZ spider and the following modules (USB Client DP, LED7C, Button amongst others) and I want to create an electronic scale.
You put something on the scale, I take the measurement (in the form of voltage that is converted to weight) and then I push it to the USB where another application reading the data will use it to plot the graph (there is a lot I do not know about this but I’ll keep it to one question per post )
My first question is how do I achieve this two way communication?
I saw a post during my search which suggested that this was possible but I lost the link unfortunately. It did indicate that if I’m using the USB for two way communication, then it cannot be used for deployment and debugging. I’ll need to use a serial connection for that. I doubt I can order any new components considering the time I have left to get my prototype running.
A link to a working sample or tutorial will be helpful. I’ll just create a small application that will generate a sequential number and send it through the USB and I’ll use the application at the other end to plot some kind of graph.
The intent is that you turn off USB debug (on a spider with a switch, on others usually a jumper) and then a serial device is present on your PC. To get back into “deployment mode” you simply switch the switch back to USB debugging and you no longer get CDC but you can update your code and redeploy - you just can’t do both over the same connection. With some code to check for status before you blindly turn on CDC you should be fine.
Also if you have an FTDI cable or some other USB-TTL serial device, you can use that to temporarily hook up the debug port and continue debugging as well as getting serial messages over CDC. Or of course you can go the other way and just use that additional serial port as your data transfer port, and keep the USB client port for debugging (its easier ! )
I am not sure how to switch it into CDC mode, or even if there is a CDC mode on the USB Client on Hydra. I suggest you use a standard TTL USB-serial adapter connected to a set of UART pins.
Oh ok. I get it now. Unfortunately I did not buy any of those components since I did not think I needed them. The closest I have is the USB host but I guess that can’t do. Looks like I’ll have to forget about the two way communication then. I’ll have to purchase those modules are my second prototype but can’t buy now due to time constraints.
Given that I can neither use Ethernet or Wifi, do I have any other means of sending data to a connected PC?
I do not think serial debugging is supported on hydra to release usb and even so, cdc will not work on devices not running the GHI libraries, which are not supported completely on hydra.
We recommend any of the other board for any advanced features. Hydra is good for being completely open source.
But you do not need any of this. Add the usb serial module and use that like cdc. Keep the usb port for debugging.
Yeah. I think the usb serial is the best way to go. Had I known :). Thanks for all your assistance. For now, due to time constraints, I’ll look at the possibility of writing the data to an sd card and then opening the file on the pc to display the graphs.