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 between the Computer and the Netduino?


  • Please log in to reply
9 replies to this topic

#1 Petezah

Petezah

    New Member

  • Members
  • Pip
  • 2 posts

Posted 22 August 2010 - 08:50 PM

Hi I'm new to the Netduino but I've used the Arduino in the past. I've written some applications that talk to the Arduino by opening a serial port with the correct comport. Now I'm trying to do the same thing with the Netduino the problem is that I couldn't find the comport of the Netduino when I connect to my computer. Just wondering whats the correct way to approach all of this. Any help would be really appreciated. Thanks!

#2 muyinteresting

muyinteresting

    Member

  • Members
  • PipPip
  • 19 posts

Posted 02 September 2010 - 11:09 PM

This would be nice to know. Although I'm confident that this is trivial. I will definitely need serial communication as I am sending commands to the netduino over a serial COM port. I'm dedicating this entire controller to controlling and monitoring relays. All the digital pins, except the COM1 ports will be used to trip relays for lights, wall outlets, etc. The analog ports will be used for monitoring current on things like switches to report current draw (ie. >0A = on). Are you intending to talk over the USB port or over the COM ports (D0/D1 and D2/D3)?

#3 greg

greg

    Advanced Member

  • Members
  • PipPipPip
  • 169 posts
  • LocationChicago, IL

Posted 02 September 2010 - 11:31 PM

This would be nice to know. Although I'm confident that this is trivial. I will definitely need serial communication as I am sending commands to the netduino over a serial COM port. I'm dedicating this entire controller to controlling and monitoring relays. All the digital pins, except the COM1 ports will be used to trip relays for lights, wall outlets, etc. The analog ports will be used for monitoring current on things like switches to report current draw (ie. >0A = on).

Are you intending to talk over the USB port or over the COM ports (D0/D1 and D2/D3)?


The USB port is currently only for debugging (and power). Secret Labs is looking into turning into a HID to be able send/receive data as well.

You can use either of the UARTs (D0/1 or D2/3) for standard serial communication to your computer through a serial cable or something like a XBee.

#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 03 September 2010 - 04:14 AM

The USB port is currently only for debugging (and power). Secret Labs is looking into turning into a HID to be able send/receive data as well.


Also, you can deploy/debug the Netduino using the D0/D1 ports and a USB-to-TTL cable--and then create code to use the USB client port however you'd like. USB is a bit advanced, so we're also working on some templates to do this. More on that later.

Chris

#5 muyinteresting

muyinteresting

    Member

  • Members
  • PipPip
  • 19 posts

Posted 03 September 2010 - 04:31 AM

Greg, I was aware that USB is not a communication option right now. That question was intended for the OP. However, now it has been stated. Standard serial communication with the UARTs is pretty easy. brb writing my code.

#6 freds

freds

    Advanced Member

  • Members
  • PipPipPip
  • 61 posts

Posted 12 September 2010 - 07:05 PM

I am very interested in using the USB port as a direct communications interface running a custom application. And it appears that it should be doable in the Microsoft.SPOT.Hardware.UsbClient namespace.

I have done some initial research on this and found the following links of interest.

USB Aware terminal emulator for testing.
Discussion on handling plug and unplug notifications from a windows application
Someone elses attempt at an example (example references two different namespaces with UsbClient)
Blog on using the microframework application via usb
ARM Disussion on a INF install file for a virtual comm port that works with recent windows versions
Discussions of using another USB class library that seems simular to the SPOT.USBClient

My testing idea is to have the test code first check if a pin had been grounded, before attempting to become a serial port client.

Is there any documentation of using a FTDI serial cable as the debugging interface, so that the USB port can become a virtual comm port under test?

Thanks

#7 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 12 September 2010 - 08:44 PM

Is there any documentation of using a FTDI serial cable as the debugging interface, so that the USB port can become a virtual comm port under test?


Hi freds, thanks for the post and welcome to the community.

If you have an FTDI RS232 cable, you can use an RS232 shield and erase/reflash your Netduino with the serial firmware. CuteDigi has an RS232 shield that we've used successfully in the lab.

You can also pick up a 3.3V USB-TTL serial cable and then you won't need any shield to convert the RS232 (-12V to 12V) voltages to TTL (0V to 5V) voltages....

Chris

#8 freds

freds

    Advanced Member

  • Members
  • PipPipPip
  • 61 posts

Posted 13 September 2010 - 02:10 AM

Hi freds, thanks for the post and welcome to the community.

If you have an FTDI RS232 cable, you can use an RS232 shield and erase/reflash your Netduino with the serial firmware. CuteDigi has an RS232 shield that we've used successfully in the lab.

You can also pick up a 3.3V USB-TTL serial cable and then you won't need any shield to convert the RS232 (-12V to 12V) voltages to TTL (0V to 5V) voltages....

Chris

Hi Chris

Thanks for that info; in exploring the site today I found the info on how to load the firmware via USB.

Steps to restore an Erased Netduino

Where do I find the serial firmware?
Also do you have the same debug functionality in VS2010 via serial as USB?

I work a lot in the reprap.org environment with Sanguino boards so have the 5V TTL cable that’s used with a lot Arduino derivatives. Would it be compatible since the CPU is 5v tolerant?

In connecting the cable I should obviously match TX and RD(Com1?), what pin should I feed 5V power in VIN or 5V?

Very much looking forward to your new board with more pins and more analog.

Thanks for the welcome!

#9 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 13 September 2010 - 02:16 AM

Where do I find the serial firmware?
Also do you have the same debug functionality in VS2010 via serial as USB?


Here's a link to the current serial firmware:
http://forums.netdui...indpost__p__562

You have the same functionality via USB or serial. Most users will want to debug over USB and communicate with their PC via serial--but you can do it the other way if you turn the Netduino into a custom USB device. We'll be providing samples for that in the near future as well.

I work a lot in the reprap.org environment with Sanguino boards so have the 5V TTL cable that’s used with a lot Arduino derivatives. Would it be compatible since the CPU is 5v tolerant?

In connecting the cable I should obviously match TX and RD(Com1?), what pin should I feed 5V power in VIN or 5V?


You'll want a 3.3V TTL cable. The Netduino can take the 5V signals fine--but some 5V TTL cables won't be able to make sense of the 3.3V signals coming from the Netduino. You won't hurt the Netduino trying the 5V cable--but you'll probably need a 3.3V cable. Note that the 3.3V cable will actually work with at least some 5V devices as well.

If you have a true 5V regulated power feed, plug it into the 5V header. If you have unregulated power, plug 7.5V-12V into the Vin header.

We'll have a "more pins" solution for Netduino users in the near future as well. More to come...

Chris

#10 freds

freds

    Advanced Member

  • Members
  • PipPipPip
  • 61 posts

Posted 14 September 2010 - 03:35 AM

Quick progress report:

I successfully changed over to serial debugging/firmware using a 5V FDTI TTL cable that is used with lots of Ardunio clones.

I can also report that the serial debugging interface is much slower to use then the USB!!! But it does work as expected.




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.