Shop OBEX P1 Docs P2 Docs Learn Events
long distance programming issue - Page 2 — Parallax Forums

long distance programming issue

2

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-06-16 21:47
    Jonathan,

    Where is the cable that powers the pump relative to the USB extension cable? Do they lie side-by-side?

    -Phil
  • JonathanJonathan Posts: 1,023
    edited 2013-06-16 21:55
    Nope. The closest they come is perhaps 10 inches.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-06-17 02:38
    Well, you could try powering the Propeller end from a battery supply to better define the source of your trouble.

    But I guess I just am very old school about this and think the less you depend on USB converters going up and down and around, the easier it will be to get reliable performance over distance.

    In fact, converting the USB to RS232 and using a 100 feet of wire with RS232 at slower bauds is feasible. But I presume you want to remotely program the Propeller from time to time and need to work with the existing speed provided by the Propeller Tool.

    I do indeed admit that with 'good' hardware, there should be no problem with your original approach. I just have difficulty with sorting out if you are using 'knock off junk' or hardware that was developed by some sincere engineers to perform above average.

    If you really wan to stay with this configuration, you might just go and buy a better branded set of dongles backed by a solid manufacturer.
  • JonathanJonathan Posts: 1,023
    edited 2013-06-17 07:12
    Loopy, that's a good idea, running the Prop from a battery. I should have thought of and tried that already. I still think it's a ground issue.

    My dongles are indeed "off brand" cheap ones from epay. Any suggestions as to a better brand? While I only need this setup fpor a few weeks while I get all the programming hammered out, I need to do this sort of thing pretty often. I sure wish someone would come up with a wireless Prop programmer.

    Thanks!

    Jonathan
  • PublisonPublison Posts: 12,366
    edited 2013-06-17 07:27
    Jonathan wrote: »
    I sure wish someone would come up with a wireless Prop programmer.

    Thanks!

    Jonathan

    Phil did a XBEE program uploader here:

    http://forums.parallax.com/showthread.php/127780-Upload-Prop-programs-via-XBee?highlight=wireless#top
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-06-17 07:38
    If you need to do long distance by wire programming again and again, I stick by my original suggestion USB to TTL and then RS-422/485 all the way. The wire can reach a kilometer or more.

    But of course, if you prefer to use Propeller boards that only support a USB programing interface.. this is a non-starter.

    I live in Taiwan and everything I buy locally is highly-suspect of being cheap "knock off', even when branded. So I personally can't help you. But buying on EBay does raise a red flag unless there is added info about the vendor.

    I posted a spec sheet from a branded item. Frankly, I never heard of the Black Box brand, so I am unsure. Belkin charges hefty prices, but stands behind what they sell.

    The RS485 approach works nicely with the Parallax Proto Board.
  • PublisonPublison Posts: 12,366
    edited 2013-06-17 08:17
    Frankly, I never heard of the Black Box brand, so I am unsure.

    The Black Box Corporation has been around since 1976:

    http://en.wikipedia.org/wiki/Black_Box_Corporation

    I
    have used many of their devices. The used to be to only game in town in the 80's and early 90's.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-06-18 01:22
    Here is the document for the Belkin product... so you can compare with Black Box and decide... Frankly Belkin has always been very expensive. But this seems to be $35USD and might be reliable for investing in as sound test equipment is the only kind to buy.

    http://www.belkin.com/us/p/P-F3U130

    And something else.

    http://www.belkin.com/support/dl/f1d086u__p75472-a.pdf
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-06-18 08:16
    Loopy,

    Did you read the Belkin product description?
    The USB Active Extension Cable from Belkin ensures you get the best performance and maximum data integrity when you transfer information between your computer and devices. It uses active electronics to sustain your data signal, so you can connect a peripheral to your PC from an extra 16 feet away. Standard (passive) USB extension cable connections can cause significant data loss over distances of more than 16 feet. With the Belkin USB Active Extension Cable, you can connect up to four of these cables in a series along with a device cable for a total operating distance of up to 80 feet.

    Its range is 16 feet (or and extra 64' if you buy four of them). Jonathan needs a 100' extension.

    -Phil
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-06-18 10:12
    Yes I did notice that... after posting. It seems that Belkin really doesn't endorse a 100' CAT5 USB extender scheme... but you can get 80 for a hefty price.

    Typical of Belkin... a costly solution... must buy 5x at $35 USD each.

    The second product actually uses CAT5 cable and will handle two USB channels and video... but is primarily intended for a USB keyboard and USB mouse. Maybe useless for programing the Propeller over USB. KVM represents Keyboard-Video-Mouse.... about $200-250 USD (ouch!)

    Everything from Belkin is a near miss.

    Black Box looks right... but they are not cheap either.... $149-349 USD!
    http://www.blackbox.com/Store/Results.aspx/search-USB to CAT5 Extender``si_product|USB to CAT5``si_product|"USB+to+CAT5"``si_product
    http://www.blackbox.com/Store/Detail.aspx/USB-2-0-CAT5-Extender/IC280A

    I could build a RS485 solution for under $60 USD including a USB to TTL converter from Sparkfun.
    https://www.sparkfun.com/products/718

    http://www.blackbox.com/Store/Detail.aspx/USB-to-3-3-V-TTL-Mini-Converter/CL062A
  • RickInTexasRickInTexas Posts: 124
    edited 2013-06-18 20:45
    There's a thread using Wixels for remote programing. 100 feet is likely too far, but perhaps putting the pc xmitter on an extension strategically placed may work. Rs422 would be great.

    Also, a TRUE RS-232, i.e.the full +/- 12v or whatever it is may work. Shielded without ground loops may be enough.

    Going to work but I'll think about it more...
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-06-18 21:05
    If you're going to roll your own, I'd go with RS422 long before considering RS232. The latter is just not meant for those distances. Also, if you use shielded cable, be sure to connect the shielding at one end only.

    -Phil
  • RickInTexasRickInTexas Posts: 124
    edited 2013-06-19 01:38
    Also, if you use shielded cable, be sure to connect the shielding at one end only.

    -Phil

    Ah, yes. The 2nd end of the shield/gnd completes the loop in ground loop, correct?
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-06-19 02:33
    I have have wonderful successes with RS422/485 when testing with 100' roll of telephone extension cord that has 4 wires... no shielded cable. I ran a test for 3 months with two CANbus nodes sending back and forth and no failure of any data in that period. (CANbus has a register than counts the number of failed messages and requests to resend.)

    RS422 may require more pairs of wires (6 total) for using Tx, Rx, and Reset... but it is the easiest to deploy. RS-485 transcievers have to switch between Tx and Rx.

    But your CAT5 cable has 4 twisted pairs, plus shielding... so building to RJ45 sockets would allow you have an extra pair for future use as data or power.

    Above all, it will better handle both distance and speed and the RS422 receiver and transmitter chips are very cheap ($1 USD or so). Set up an all 3.3volt solution for simple Propeller interface. You may have to busy a few LDO 3.3v regulators as well.

    Shielding connected at BOTH ends creates nasty ground loops.

    Here is one driver/receiver set, but you don't have to use Maxim.

    There are some very standard solutions of passive termination to improve performance by eliminating reflections on the line.

    http://en.wikipedia.org/wiki/RS-422

    http://www.ti.com/lit/an/slla070d/slla070d.pdf

    http://www.maximintegrated.com/datasheet/index.mvp/id/3764
  • PublisonPublison Posts: 12,366
    edited 2013-06-19 02:51

    But your CAT5 cable has 4 twisted pairs, plus shielding... so building to RJ45 sockets would allow you have an extra pair for future use as data or power.

    Loopy,

    CAT5 does not have a shield. It is called UTP (Unshielded Twisted Pair)
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-06-19 06:59
    And so... what's this?

    http://www.amazon.com/dp/B001R6A394
  • kwinnkwinn Posts: 8,697
    edited 2013-06-19 07:53

    That is "STP Shielded Cat5e Cable, Pure Copper, Gray"
  • PublisonPublison Posts: 12,366
    edited 2013-06-19 07:58

    OK...it exists.. :)

    In 20 years of pulling CAT5, never needed anything shielded. Always worked to 300 meters without shielding.

    I would suspect it's only used in a small amount of installations.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-06-19 08:20
    Well, the application is not for LAN... it is twisted pairs of RS-422 lines. So it might be needed.

    But I have had good RS-422 performance without properly twisted pairs and not shielding. Shielding was just a consideration in this problem context.
  • PublisonPublison Posts: 12,366
    edited 2013-06-19 08:23
    Well, the application is not for LAN... it is twisted pairs of RS-422 lines. So it might be needed.

    But I have had good RS-422 performance without properly twisted pairs and not shielding. Shielding was just a consideration in this problem context.

    Duly noted..and a good point.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-06-19 08:24
    Jonathan, I would recommend the RS422 approach as it is dead simple and you can use CAT5. As for transmitter/receiver chips it's sometimes easier just to use more common and available RS485 chips although you need one for each pair then and just hardwire them as transmitter or receiver. I'd suggest the 120R termination at the receive ends for each pair.

    There is another way for remote programming that I should by all means suggest also that doesn't require the Prop to be programmed with the Spin tool and only requires RX and TX. How's that possible? Well I think you might know that I program in Forth and once a kernel has been loaded onto a Prop you can communicate and program it by simply pasting your code into the terminal. I have boards running tiny serial Bluetooth modules at 230,400 baud so the laptop only needs Bluetooth and nothing else. I have even talked to and programmed Props from my smartphone or at the very least listed and changed variables. Just a thought as there are no big "issues" with programming this way plus Forth is like having a built-in command interpreter and debugger as well.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-06-19 08:35
    Hi all,
    Frankly, I have been annoyed when we all were bumped over to USB for everything. At the time this was starting, I had gotten my first RS232 to Rs485 adapter.

    At this point, I am thinking that Parallax might do very well with a Propeller Project Board that is specifically adapted to programing from an RS422/485 bundle of lines via CAT5 wire and RJ45 plug in.

    At the other end, a USB to RS422/485 programming device would be not a huge additional cost when compared with the other programming tool/adapters that Parallax offers.

    There are a lot of users that want to have their Propeller located afar, but communication available from a computer in the office or shack.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-06-19 08:47
    Here's an example of a board that I can program remotely via it's built-in RS485/RS422 port. The CAT5 supplies 24V to the switching regulator (not fitted on this sample) and the other two pairs are simple RX and TX.
    PIXIE.jpg

    There are many other boards I use RS485/RS422 on and very rarely will USB be built into the board, rather the programming header allows for a USB or any other type of module which could even be soldered in if I really wanted to.
    1024 x 682 - 120K
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-06-19 09:50
    Very nice.

    BTW, you are quite right. For remote programing, it is easier to use three RS-485 transcievers at each end and tie them to just one direction. The RS422 chips seem to come in 4 Rx or 4 Tx or singles. And not as easy to get in DIP packages.

    The 120 ohm resistors for termination is important too. RS-422/485 is so simple and reliable... USB gets complex and sensitive.
  • kwinnkwinn Posts: 8,697
    edited 2013-06-19 11:27
    Very nice.

    BTW, you are quite right. For remote programing, it is easier to use three RS-485 transcievers at each end and tie them to just one direction. The RS422 chips seem to come in 4 Rx or 4 Tx or singles. And not as easy to get in DIP packages.

    The 120 ohm resistors for termination is important too. RS-422/485 is so simple and reliable... USB gets complex and sensitive.

    RS-422/485 is a great improvement over RS232 and TTL serial, however it is still susceptible to voltage level shifts and impulse noise from equipment starting and stopping. Using high speed optoisolators as in the attached diagram provides even more noise immunity than RS-422/485 does, as well as being immune to ground loops and impulse noise.

    Unwanted resetting of the prop can also be eliminated by having a low value pullup resistor (1K or less) on the propeller reset opto and a 555 timer or similar monostable circuit on the drive side of the connection.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-06-20 02:24
    @kwinn
    Are you suggesting we actually include both? I am beginning to think we may have an excellent all-purpose solution for distant Propeller modues.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-06-20 02:52
    kwinn wrote: »
    RS-422/485 is a great improvement over RS232 and TTL serial, however it is still susceptible to voltage level shifts and impulse noise from equipment starting and stopping. Using high speed optoisolators as in the attached diagram provides even more noise immunity than RS-422/485 does, as well as being immune to ground loops and impulse noise.

    Unwanted resetting of the prop can also be eliminated by having a low value pullup resistor (1K or less) on the propeller reset opto and a 555 timer or similar monostable circuit on the drive side of the connection.

    The problem with optos is usually that they are too slow, sure there are faster ones with built-in Schmitt trigger outputs too but a proper twisted-pair balanced line with termination provides very high noise immunity. Better than this though is to have galvanic isolation and balanced drivers. This I do with products using solid-state isolators and 485 line drivers and receivers. The ultimate is to go fibre-optic and I have made Prop products with SMF run up to 40kms.

    Here's an isolated RS485/422 module with dynamic termination.
    Screenshot from 2013-06-20 19:54:17.jpg
  • JonathanJonathan Posts: 1,023
    edited 2013-06-20 07:15
    Once again, back from my 48 hour shift and a TON to catch up on in this thread.

    The cheapie USB-cat5 adapters I have been using have been quite reliable in a variety of situations. I still think because unplugging the laptop or using the ungrounded netbook works that it is, in this case, a grounding issue.

    All that said, I am very much interested in working on a more rugged solution, not only to fix this problem but for future projects. I do have some RS-485 chips kicking around. Peter, have you used the schematic above? It does use some surface mount stuff, so I'd have to make some boards. I am a fan of DIP, easier for me to work with, but I know that limits my options pretty severely. Maybe it's time to stop making my own boards and send out for some.

    Jonathan
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-06-20 07:57
    Jonathan wrote: »
    Once again, back from my 48 hour shift and a TON to catch up on in this thread.

    The cheapie USB-cat5 adapters I have been using have been quite reliable in a variety of situations. I still think because unplugging the laptop or using the ungrounded netbook works that it is, in this case, a grounding issue.

    All that said, I am very much interested in working on a more rugged solution, not only to fix this problem but for future projects. I do have some RS-485 chips kicking around. Peter, have you used the schematic above? It does use some surface mount stuff, so I'd have to make some boards. I am a fan of DIP, easier for me to work with, but I know that limits my options pretty severely. Maybe it's time to stop making my own boards and send out for some.

    Jonathan

    That circuit is used in industrial and highway signalling but you don't have to have anything that heavy-duty, just the RS485/422 chips and termination resistors, that's all. You could use RS485 chips as I mentioned earlier or you could just use the little 8-pin DIP pack RX/TX RS422 chips like the MAX490s etc. I've even used RS422 chips as single ended devices for RS232 by simply biasing the chip slightly and allowing for a series resistor but you don't have to do that.

    So have a look at putting 2 chips on the board so that you end up with RX, TX, and DTR which you would couple through your reset transistor circuit. There's even a spare transmitter to communicate back to the host if you want. Unlike RS232 which is very speed limited and can't drive long lines (don't let the big +/- voltages fool you), you will find RS422 very happy to work at megabit rates as long as you use twisted pair per signal, so CAT5 is the way to go and you could just put an RJ45 straight on your board to make it easier. You should make up a PC host board that has the USB chip and the RS422 drivers along with a RJ45. I be very much inclined to make this end of it isolated to protect the PC just in case and also to rule out any ground loops etc.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-06-20 09:36
    Peter is thinking 4 chips total and two twisted pairs. One pair of tranceivers would handle Rx/Tx (I guess that is half-duplex) and the other pair would be locked in just one direction communication for reset.

    I am thinking 6 chips for full-duplex and 3 twisted pairs.

    I suppose it is up to you which is really optimal.

    About the only snag I have hit in building a simple all DIP solution in Taiwan with the Sparkfun USB to TTL device is that I can not buy RS485 transceivers for 3.3v locally or in DIPs.
    https://www.sparkfun.com/products/718

    Sparkfun is willing to sell the 75 cent chip on a breakout board for $9.95. You would need six of these boards to cover both ends of your CAT5 cables 3 twist pairs in use. But it appears that they do NOT provide the ocrrect passive termination as well.

    https://www.sparkfun.com/products/10124

    The best I can do is order from Mouser, Digikey, or Futurelec. But if you manage an adapted +5V interface, you can get DIPs just about anywhere. And I suspect I have the minimum required six sitting next to me in my clutter.

    I'd try it with 120 ohm termination pairs and just the transceivers first. A lot of excellent solution die in planning because they get too elegant.

    Besides, you really might enjoy pondering the real limits of generic bare-bones RS-422/485. It is a goodie. You can get RJ45 jacks in dongle form that are intended to use screws and just cut of the ends and crimp on connectors that will create a 0.1 spacing plug.. all 8 in a single row, or in 4 pairs separately. That will plug directly into your DIY board very cleanly and last a long long time.

    The new Propeller Project Board could adapt to RS-485 chips for loading.
    http://www.parallax.com/Portals/0/Downloads/docs/prod/prop/32810-Propeller-Project-Board-USB-Guide-v1.0.pdf

    That would leave you with the other end being most of the build.
Sign In or Register to comment.