Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Serial Communication via USB Step by Step


  • Please log in to reply
8 replies to this topic

#1 J Wilson

J Wilson

    Advanced Member

  • Members
  • PipPipPip
  • 30 posts

Posted 20 March 2012 - 04:44 AM

Thanks to Dave VanderWekke and others, I have step by step instructions for anybody wanting to do communication between your PC and Netduino via USB. 1. Purchase a FTDI FT232RL USB to serial card: http://www.sparkfun.com/products/9873 2. Connect the following pins: FTDI.RXI - Netduino.D1 FTDI.TXO - Netduino.D0 FTDI.Gnd - Netduino.Gnd 3. Plug your USB cable into the computer and the FTDI. If your computer can't find the right driver to setup the comm port, try: http://www.ftdichip.com/FTDrivers.htm 4. Use the CommPort class I've written in both the Netduino and your .NET PC application. The CommPortNetduino.cs is an example of code to put in your Netduino application. The CommPortProgram.cs is an example of code to put in your .NET PC application. 5. Give it a try. You can actually program and debug the Netduino Application via your regular USB while doing serial communication via the other USB. For some reason, the PC application can't be running from the debugger at the same time. (At least I couldn't, had to launch it separately.) Good luck! BTW: Sometimes the messages don't come through. It's as if the SerialDataReceivedEventHandler doesn't have high enough priority and gets blocked by other events. Maybe somebody can explain this.

Attached Files



#2 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 20 March 2012 - 08:43 AM

Glad to hear it worked for you. I did notice in my alpha software that the SerialDataReceivedEventHandler would not fire occasionally and I think it was related to a timer I had in the software. I have since done away with using timers and have not had any issues since.

#3 J Wilson

J Wilson

    Advanced Member

  • Members
  • PipPipPip
  • 30 posts

Posted 03 April 2012 - 01:20 AM

Glad to hear it worked for you.

I did notice in my alpha software that the SerialDataReceivedEventHandler would not fire occasionally and I think it was related to a timer I had in the software. I have since done away with using timers and have not had any issues since.


I am using a timer in the PC application during the running of the race heat - to look for incoming messages (times) and to update the display. I could try having the SerialDataReceivedEventHandler trigger the updates. Might be more efficient.

#4 JacopoMTK

JacopoMTK

    Member

  • Members
  • PipPip
  • 26 posts

Posted 22 April 2012 - 07:28 AM

Thanks for the guide,so,basically what i need is only this (i prefer to order from european resellers) and nothing else?Not an usb to serial cable or other stuff?

Thanks.

#5 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 22 April 2012 - 09:02 AM

Thanks for the guide,so,basically what i need is only this (i prefer to order from european resellers) and nothing else?Not an usb to serial cable or other stuff?

Thanks.


Just that board and the Mini USB cable which is different than the Micro USB that comes with the Netduino.

#6 JacopoMTK

JacopoMTK

    Member

  • Members
  • PipPip
  • 26 posts

Posted 23 April 2012 - 08:31 AM

Just that board and the Mini USB cable which is different than the Micro USB that comes with the Netduino.


Thanks,oh,another thing,what is the effective speed of the COM port used with netduino in this way?

Thanks.

#7 Coder Myers

Coder Myers

    New Member

  • Members
  • Pip
  • 3 posts

Posted 30 May 2012 - 10:00 PM

So I take it you can't use the microUSB port on the netduino for communication with a PC app, only programming with VB? Sorry if it's an obvious question - I'm new to both VB and microcontrollers.

#8 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 30 May 2012 - 10:39 PM

So I take it you can't use the microUSB port on the netduino for communication with a PC app, only programming with VB? Sorry if it's an obvious question - I'm new to both VB and microcontrollers.


Basically, it cannot be a communication port and a debug port at the same time. You can switch and use serial port as debug and this frees up the microUSB port, but I believe it is limited as to what you can do. Best bet is an FTDI card or FTDI cable. I am using this one from Sparkfun which is mentioned in the first post.

#9 Coder Myers

Coder Myers

    New Member

  • Members
  • Pip
  • 3 posts

Posted 31 May 2012 - 03:49 PM

Basically, it cannot be a communication port and a debug port at the same time. You can switch and use serial port as debug and this frees up the microUSB port, but I believe it is limited as to what you can do. Best bet is an FTDI card or FTDI cable. I am using this one from Sparkfun which is mentioned in the first post.


Good to know, thanks.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.