Shop OBEX P1 Docs P2 Docs Learn Events
Ethernet Comms using the USB Programming Port — Parallax Forums

Ethernet Comms using the USB Programming Port

bsnutbsnut Posts: 521
edited 2011-03-15 10:11 in Propeller 1
I have a question and wondering if this can be done. I am planning to get a Propeller Platform with the USB programming to use in a monitoring project for a ship that I am restoring. The goal is do use a USB to Ethernet adapter for serial communications to the Spinneret web server and the web server communicates to a cell phone modem that is less than 200 feet away and 2 decks up.

My question is, can this be done and what other objects are needed to be used. I do realize, I will need the Parallax Serial Terminal object to communicate through the USB chip on the Propeller board.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-03-13 11:42
    I don't get how you plan to do the communications between the Prop and the cell phone modem. Is this what you plan:

    PC (PST) to USB (serial port profile) to USB-to-Ethernet adapter to Telnet ... Ethernet ... Spinneret Telnet to serial I/O pins to cable to cell phone modem (3.3V logic).

    First of all, there are programs, some of them free, that will create a Telnet terminal on the PC itself, so you don't need the USB-to-Ethernet adapter.

    200 feet seems like a bit of a distance to try to do 3.3V serial I/O. You'd be much better off using RS232 or RS485 signal levels, so you'd need at least a 3.3V to RS232 adapter on each end. A MAX3232 at each end would do. You don't need the PST object on the Spinneret. Since you need two full duplex serial channels, you might just use the 4 port serial driver from the Object Exchange (here). You could even modify it to function independently, just copying characters from one port to the other without any intervention from the rest of your program.
  • bsnutbsnut Posts: 521
    edited 2011-03-13 15:37
    Thanks for the reply Mike. I know it is doable with an extra Ethernet chip or use RS485. The main goal is to have the 22 I/O pins for my sensors and outputs. Now RS485 will work between the two Props fine with no problems.

    Let me go in more detail here what I am trying to do.. The Propeller Platform USB port is connected to the USB to Ethernet Adapter after programming the Prop chip. The 200 feet was overkill and I know Ethernet is limited to 100 meters (300 feet). It will be around 100 to 150 foot run of Cat-5. The Cat-5 plugs in to the Spinneret Ethernet port and the Spinneret is setup to communicate to a PIC GSM Cellular Development Board www.sparkfun.com/products/8851, which also has Ethernet port on the board which I forgot about.

    Now, let's put these two questions out there.
    1) Will this setup work with an 4 port Ethernet switch?
    2) How would you do it with the following components?

    P.S. This maybe Spinneret contest entry
  • Mike GreenMike Green Posts: 23,101
    edited 2011-03-13 17:51
    How are you going to get the PP USB port to talk to the USB to Ethernet adapter? They're both USB clients unless the USB to Ethernet adapter is somehow special.
  • bsnutbsnut Posts: 521
    edited 2011-03-13 22:51
    To answer your question. I was going to use the Full-Duplex Serial Driver v1.2, since the USB chip on the Propeller Platform communicates with pins 30 and 31.

    The only thing is, I will need to do modify, find object, or create one for the addressing part of Ethernet. I will also need research on the Ethernet to USB adapter.
  • Mike GMike G Posts: 2,702
    edited 2011-03-14 06:58
    I'm scratching my head over your description.

    Sounds like you have 3 Ethernet devices? I'd simply hard wire the Ethernet devices to a router, preferably a wireless router.
  • MagIO2MagIO2 Posts: 2,243
    edited 2011-03-14 07:06
    What Mike Green tries to tell you:

    The way
    propeller - serial interface - USB programmer - USB ethernet adaptor

    does not work!

    The problem is that both, USB programmer and USB ethernet adaptor are USB clients. They simply won't talk to each other.
  • bsnutbsnut Posts: 521
    edited 2011-03-14 13:06
    I now understand what everybody is talking about after doing more research on the USB to Ethernet Adapter. I guess, I learn something new about USB clients that I didn't know. Which means you software on both sides. So, what I am going do to do is, setup RS485 network and this will aloud me better control and let me add more points to this web based ship monitoring system. This means, I need to find an object for RS485 or create one.

    Thanks for pointing this out to me.
  • schillschill Posts: 741
    edited 2011-03-14 13:26
    If you use full duplex rs485 (4 wires, 1 twisted pair for transmit and 1 twisted pair for receive) then you don't need a special rs485 object. You can use any standard serial communications object.

    If you only have two "nodes" - one at each end - then it's very simple to set up. You don't need to worry about addressing, two nodes talking at the same time, etc. You can literally use it in place of a direct 3.3v digital connection - with the added benefit that it will work over hundreds of feet.
  • Bill HenningBill Henning Posts: 6,445
    edited 2011-03-14 14:02
    bsnut,

    You might be interested to know that I have a nice small RS485 module that can be used with Props, stamps or indeed any micro - it is available in 3v3 and 5v configurations, I just need to make up a product page on my site and start selling them; I have the boards and parts in stock. I'll start a thread on it later today or tomorrow, as soon as I figure out the kit and a&t pricing for the 3v3 and 5v versions.

    The module is called "485Plug" and it fits the 5-pin hcomm header common to all of my boards.
  • bsnutbsnut Posts: 521
    edited 2011-03-14 14:41
    @schill,
    I like your idea but I would like to expand beyond two nones which means I need to do RS485 network. Which, I have no problem setting up.That's why I was looking into Ethernet way, which also aloud you to beyond two nones

    @Bill,
    I like your idea and like more information on your board and here are some questions for you.
    1) How is the addressing done on your board?
    2) How many I/O pins does this board?
    3) Do you have a photo of your board so we can see your handy work?
    4) Does your board work with the USB port that is on the Propeller Platform

    The one thing I am trying to do is maintain the following
    1) SD card pins for program storage and booting
    2) EEPROM pins
    3) Serial pins 30 and 31

    This means I am willing to give up 4I/O pins for communications control.
  • Bill HenningBill Henning Posts: 6,445
    edited 2011-03-14 15:26
    Hi bsnut,
    bsnut wrote: »
    @Bill,
    I like your idea and like more information on your board and here are some questions for you.

    Thanks! More info below, and I will start a thread later.
    bsnut wrote: »
    1) How is the addressing done on your board?

    That's up to the software layer; there is lots of C code on the net for simple addressed serial networking code, just translate some to Spin.

    The following thread has some protocol ideas...

    http://forums.parallax.com/showthread.php?124009-CANBus-RS485-Ethernet
    bsnut wrote: »
    2) How many I/O pins does this board?

    Two I/O pins, one controlling the direction of RS485 buffers, and the other being the I/O pin used to transmit/receive data

    The board requires Vcc, GND, TX and RX, and uses the same 5 pin propplug compatible pinout that all of my boards do - see bottom of this post
    bsnut wrote: »
    3) Do you have a photo of your board so we can see your handy work?

    I'll put one up shortly.
    bsnut wrote: »
    4) Does your board work with the USB port that is on the Propeller Platform

    No, it needs two raw propeller pins - the USB port on Propeller boards can only be used as a virtual serial port to a computer, and cannot be used to connect peripherals to the prop.
    bsnut wrote: »
    The one thing I am trying to do is maintain the following
    1) SD card pins for program storage and booting
    2) EEPROM pins
    3) Serial pins 30 and 31

    This means I am willing to give up 4I/O pins for communications control.

    Then you could hook up two of my comm modules. Right now I have SerPlug (RS232) and 485Plug.

    Note that 485Plug, when used with 6/8 pin passive RJ45 connectors, follows the standard RJ45 Modbus RS485 pinout, and provides an optional terminating resistor, and a second RJ45 for daisy chaining. And if people prefer 3-screw terminals, those can be mounted as an alternate to the RJ45's...

    (485Plug actually supports balancing resistors for Profibus as well... shhhh)

    H-COMM 5 pin header, male on processor boards, .1" spacing, pins 1-4 same as PropPlug

    pin 1: GND
    pin 2: /RESET (not connected)
    pin 3: <TX
    pin 4: >RX
    pin 5: +3.3V **OR** +5V depending on which RS485 chip is installed
  • bsnutbsnut Posts: 521
    edited 2011-03-15 01:50
    Bill,
    So, what you are telling me I can't reuse the Pins 30 and 31, that are being used by the USB chip, even after programming the Propeller as it states below or this going to interfere with the USB chip?
    The Propeller has 32 I/O pins, 28 of which are general purpose. I/O Pins 28 - 31 have a special purpose at boot up and are available for general purpose use afterwards;

    The first option is to have a custom PCB board made for my I/O that will mate to the top of the Propeller Platform and the second option was to make a custom PCB board for my I/O and the Propeller. This, will be all decided on when I price out the cost of having the boards made.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-03-15 07:09
    The issue isn't the Propeller. It's the USB chip which always produces a receive output. If you add some additional logic to effectively disconnect the USB chip from the Propeller, then you can use pins 30 and 31 for something else when you're not communicating with the PC (like downloading).

    Except for the boards that use a PropPlug or equivalent, I don't think there are any boards that let you use pins 30 and 31 for anything but communications with the PC. The PropPlug lets you disconnect the USB interface from the Propeller.
  • Bill HenningBill Henning Posts: 6,445
    edited 2011-03-15 07:50
    bsnut,

    Mike Green explained it wonderfully!
  • bsnutbsnut Posts: 521
    edited 2011-03-15 10:11
    Now, I understand why you stated to use raw I/O with USB chips and thanks to Mike Green who explains it well as always.
Sign In or Register to comment.