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

Using Mini to connect to Serial Components


  • Please log in to reply
7 replies to this topic

#1 Bendage

Bendage

    Advanced Member

  • Members
  • PipPipPip
  • 153 posts
  • LocationIrvine, CA

Posted 16 March 2012 - 03:36 AM

So here is my problem. I have an FTDI cable to write code to the mini. But I want to use the mini to connect to another serial component. With the other Netduino boards this is easy.

I am assuming that the only way is to use the RS232 Com2 pins. Thats fine but all the USB breakouts are showing pins like the pic posted (no DTR pin?)

Since my component uses ground, voltage, TX and RX I am probable going to have to use Com1 to connect to it. That leaves my with connecting Visual Studio to Com2. The instructions say to cut an RS232 cable but I only have USB. Can the breakout board below work? If so how? If not, what is the alternative to using RS232 with USB and the mine to connect to the PC?

Posted Image

Also, since my mini is set to communicate through serial with Visual Studio, do I need to reset it to get the serial port prompt?

#2 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 16 March 2012 - 07:04 AM

Since my component uses ground, voltage, TX and RX I am probable going to have to use Com1 to connect to it. That leaves my with connecting Visual Studio to Com2. The instructions say to cut an RS232 cable but I only have USB. Can the breakout board below work? If so how? If not, what is the alternative to using RS232 with USB and the mine to connect to the PC?

Also, since my mini is set to communicate through serial with Visual Studio, do I need to reset it to get the serial port prompt?

Without the spec for the board it is difficult to say if you can use the board you mentioned but looking at the connections I would guess you could not use it directly. This is a guess and is based upon the fact that the board has breakouts for 5V and 3.3V so I'm guessing that it is working on TTL levels.

RS232 works using positive and negative voltages to represent the data where as TTL uses 0 and some positive voltage (usually 3.3 or 5V - i.e. TTL - in our case). Check the data sheet for the board in question.

If the board is indeed TTL then you can use it but you need additional circuitry. The MAX232 chips allow you to convert TTL to RS232 and requires the chip and four additional capacitors. It's simple to use and the datasheet I have for the chip has the circuit diagram in the datasheet. I did this with a Bluetooth board to connect a PC to the Mini via the MAX232. It took about 15 minutes to setup on breadboard and test. Of course, the other option is to but a USB to RS232 convertor.

When I did this I decided to leave VS talking to the Mini on the configured com port and just used the other one for communication with the PC. i.e. VS on COM1 and Bluetooth on COM2.

Hope this helps,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#3 Bendage

Bendage

    Advanced Member

  • Members
  • PipPipPip
  • 153 posts
  • LocationIrvine, CA

Posted 16 March 2012 - 04:11 PM

So I guess what I need is the following?

Posted Image

Posted Image

Based on what you are saying it appears that the component I have will only connect via TTL... the current way I am connecting to VS.

If I am to use the above adapters to connect the mini to VS, how do I bring the prompt up on the mini again to change the way VS connects to it?

#4 Bendage

Bendage

    Advanced Member

  • Members
  • PipPipPip
  • 153 posts
  • LocationIrvine, CA

Posted 16 March 2012 - 04:23 PM

... Or maybe this one?

Posted Image

#5 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 16 March 2012 - 07:22 PM

Based on what you are saying it appears that the component I have will only connect via TTL... the current way I am connecting to VS.

As I mentioned in my reply, without a data sheet for the part I am guessing. I'd like to recommend that if you need advice regarding a part you please submit links to the parts data sheet or to the components web page. The original post had what looked like a link but it did not take me to a web page with information about the part.

If I am to use the above adapters to connect the mini to VS, how do I bring the prompt up on the mini again to change the way VS connects to it?

Have a look at this link.

Regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#6 Bendage

Bendage

    Advanced Member

  • Members
  • PipPipPip
  • 153 posts
  • LocationIrvine, CA

Posted 16 March 2012 - 09:30 PM

Thank you. I have looked at that link. I think the component type is irrelevant at this point since I have deducted by your feedback is does in fact require the mini COM1. So... Assume I need the mini RS232 COM2 connection to connect to VS, as I said before... "The instructions [your link] say to cut an RS232 cable but I only have USB." Can I use the Red Sparkfun adapter I posted? What needs to be done to reset the board to prompt me which COM port VS will use like it does out of the box?

#7 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 17 March 2012 - 07:45 AM

Thank you. I have looked at that link. I think the component type is irrelevant at this point since I have deducted by your feedback is does in fact require the mini COM1.


I would not deduce that as I really don't understand whay you need to switch the deployment method to COM2. If you have deployment via COM1 working then I would leave that alone. I would then use COM2 to connect to a serial device. If that serial device was a PC then a USB to RS232 adapter would do the job. Alternatively, a USB to TTL would work with the MAX232 sitting between the TTL signals of the adapter and the COM2 port on the Mini.

The only advantage I can see from switching is reduced cost if you are going to make a large number of boards.

What needs to be done to reset the board to prompt me which COM port VS will use like it does out of the box?

In order to switch the Mini to use a different COM port you need the Mini Transport Selector which is one of the attachments to the firt post in this thread. You need to compile this application and deploy it to the MIni.

Alternatively, I guess all you really need is the following line of code:
Transport.SetInterface(TransportInterface.Com1); // Change to Com2 if required.
with the appropriate usings etc.

Regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#8 contractorwolf

contractorwolf

    Member

  • Members
  • PipPip
  • 23 posts

Posted 17 April 2012 - 02:49 PM

I think there is a lot of confusion about how to use the COM2 port on the Netduino Mini. I was orginally in the same place coming from using the FEZ Domino which had more than one standard serial port. What I needed was 2 COM ports that both work on TTL levels. There are 3 basic types on comminication when dealing with these small chip and they sometimes can get confusing, but here is what I have found:

The mini has 2 com ports, one is rs232 and one is TTL, neither of these is (or will work directly with) USB. To connect to USB you will need a fdti chip that usually comes with the mini usb plug. The best (and smallest) one I have been able to find is this one:
http://www.mouser.co...j6TUmuUKXOEIg==

It allows me to connect my Neduino Mini TTL pins to USB for deploying and debugging. While this alone is great, what do you do if you need some other serial connection to something like Xbee or Wifi? After doing some research, I found that the MAX232 chip would allow me to convert the COM2 port from rs232 to TTL so that I could use it to connect to the Xbee or something else that required TTL levels. The MAX232IN is what I used and it is available here:
http://www.mouser.co...PHXgRUYuZ8BsA==

It needs 4 additional caps (1uF available at any radio shack) and your xbee will need a voltage regulator to convert the 5v power source to a 3.3v power source (just need to covert the power, not the signal levels).

What does this give you? It basically gives you a Netduino Mini with USB for power and debugging PLUS an additional usable COM port that can be used to connect to another micro serial device (which I think is what most of you are looking for). I am designing a special Netduino Mini board that will have all of this and the Xbee that you can make on a standard protoboard from radioshack (basically one layer pcb). Ill post the full plans with pictures and instructions as soon as I have it all soldered out (maybe next week). Should be simple enough for anyone reading these boards to be able to understand and do at home.

here is the basic idea worked out on a breadboard:
Posted Image




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.