Ethernet Comms using the USB Programming Port
bsnut
Posts: 521
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.
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
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.
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
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.
Sounds like you have 3 Ethernet devices? I'd simply hard wire the Ethernet devices to a router, preferably a wireless router.
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.
Thanks for pointing this out to me.
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.
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.
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.
Thanks! More info below, and I will start a thread later.
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
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
I'll put one up shortly.
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.
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
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 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.
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.
Mike Green explained it wonderfully!