Extending programming distance
Jonathan
Posts: 1,023
Hi All,
I want to be able to program a prop from the PC in my house to about 50' away at my solar power/ battery bank. I have a phone wire run out there, 4 conductors. Round trip resistance is about 2.5 ohms on each pair.
Just hooking up a Prop clip won't work, not suprising. Anyway to boost the distance with simple hardware? I took a look for a bootloader that might allow me to send a program via serial coms, but didn't see any such thing.
Thanks!
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
I want to be able to program a prop from the PC in my house to about 50' away at my solar power/ battery bank. I have a phone wire run out there, 4 conductors. Round trip resistance is about 2.5 ohms on each pair.
Just hooking up a Prop clip won't work, not suprising. Anyway to boost the distance with simple hardware? I took a look for a bootloader that might allow me to send a program via serial coms, but didn't see any such thing.
Thanks!
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
Comments
How about RS232? I have some chips laying about for that.
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
So, can I connect my propclip to the PC and run the RES/TX/RX lines from the clip into the inputs of the RS232, output RS232 connected to phone line, then another RS232 on the other end with 1k resistors from the RS232 to the RES?TX?RX lines on a protoboard? Would I even need to do the RES line?
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
You need the RES line at the Propeller for programming and you need the RS232 signal levels on the long cable.
You could use a MAX3232 with a PropClip to convert to RS232 signal levels, then use another MAX3232 at the Propeller end to convert back. You'd need to carry TX, RX, and RES. The MAX3232 has a pair of transmitters and a pair of receivers, so you'd use 3 out of the 4 at each end.
Another alternative would be to use RS485 transceivers, but that would need 3 twisted pairs in the cable between the PC and the Propeller.
Post Edited (Mike Green) : 1/7/2010 8:18:38 PM GMT
The second scheme is what I had in mind. I have a couple of MAX3235's. If I put a series resistor to the Prop from the RS232, that should work, right?
Thanks for the help!
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
Ideas: (ALL GOOD HUMOR INTENDED!)
Do you think it might work if you run a phone extension and connect two old Hayes modems to it?
How about wi-fi and a laptop? Fiber optics?
Behold, the Miracle! Heaven has cursed the Copper Headed Serpent, which hath stretched its great Coil around
the earth, to listen to the seas, and to speak to the other seas. Nevermore shall this serpent hear words in one place
and speak them in another, nor shall it even rattle its tail! It tried to squeeze the earth like a boa constrictor,
and bind it like spider's silk, and spill blood. But now even divided into many small ones, it is deaf and dumb,
and turning into moss, and its evil spirit whispers only silence. In this millenium, the dark days of the Talking Snake
Uncoiled will be remembered with amazement, at how its own Blue Venom fell down from the sky upon it,
and it became blue, and fire becomes blue as it burns. Speak to the Copper Snake, Listen to the Copper Snake,
Remember how it used to Talk, and Marvel at its Silence!
( IOW... Hmm. Wires don't work anymore. {shrug} )
I know I need two RS232 chips. In fact, I have them here on the desk and, according to my Propscope, working fine. However, when I try to use the connection to program, no joy. I can't even substitute one line from the direct propclip connection successfully. Looking at the scope, with one probe on the propclip output and one one the 232 output, they seem the same. The circuit shares a common ground. I can't think why it doesn't work. The sreies ressitor mentioned above is just to protect the Prop from the 5V of the 232.
Off for a grueling 48 shift. I'll check back here when I'm done.
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
The scheme you described should work. Since it doesn't, there must be something else going on. There's not enough delay in the MAX3235s to affect the download protocol.
Since the transmitted signal during programming is about 2MHz (Jeff Martin should confirm this), the 74HC14 example fails at 3.3V due to Nyquist stating that the frequency capability should at least be twice what you are sampling.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Ok, I wasn't sure, I seem to remember Jeff mentioning that there were some tricks that he did to make the effective throughput much faster though.
That being the case (115kBaud), I would try two 74HC14's on both ends to see if that would clean the signal up enough
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Those delays are plenty high enough, based on the discussion so far, to accomodate the transfer.
I'd suspect some kind of noise,·loss, or wiring problem·introducing itself along the way.
Cat 5 cable is wound at very strict specifications to support extreme communication speeds; it may be final part of the equation you need.
If it's proving not possible using the current methods might I suggestion that over really long distances though (not sure if this qualifies)·a differential protocol may be best since it is much more reliable and immune to noise.· RS422 or RS485.
Regarding Beau's memory:· We tried higher speeds, and it definitely works under the right conditions, but there is too much likelyhood of problems caused by process variations in various environments to justify it, so we bumped it back down to the original-spec of 115.2 k baud.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Jeff Martin
· Sr. Software Engineer
· Parallax, Inc.
Post Edited (Jeff Martin (Parallax)) : 1/8/2010 6:43:07 PM GMT
Even now with my PC talking to other things using 4 metres of 9 way ribbon cable I'm struggling to get over 38400 baud. (1200 on the other hand can go 500 metres or more)
Ribbon cable isn't the best, and certainly it could be improved with every alternate line grounded, or twisted pairs etc. But I think for long runs 115k is going to be very dependent on the type of cable, shielding etc.
For a start try cat5/6 as suggested.
Then maybe it is going to be a matter of a small .net program (or anything really) on the PC spitting out character U (01010101) continuously and snake the cable round the shed and scope the other end and see how square the edges are.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
You might be able to get away with twisting RES around TX or RX. For best results -- and this is also true if you are using RS232 -- you need TX, RX, and RES all twisted around a GND. All the GNDs are connected together at one end, only one at the other to avoid ground loops. Of course it's better if you're using individually shielded pair instrumentation cable, but at 50 ft cat3 phone cable should be fine even with TTL. If you had run cat5, even though you don't need its tighter twistiness, you'd have another pair to twist RES around GND and you'd be OK.
The other thing you can do (which isn't too hard since, unlike IIC, all the signals are unidirectional) is to convert them all to a current signal with a NPN transistor transmitter at one end and an optoisolator (LED+photogransistor in a sealed enclosure) at the other. This will give you a robust signal that can be driven for miles while ignoring what's twisted around what.
I've played with this a _lot_. The speed spread of the propeller under an RC oscillator is still fast enough to cope with 230.4k downloads, but when the clock slows right down (as it does when you heat the propeller up) you run into problems at the end of each transmitted long when the bootloader goes to write it to the hub. The simple answer to this is to make sure you have an extra pause bit at the end of each long to allow the prop to catch back up.
After implementing this, I managed to do about 10,000 consecutive reliable loads to a propeller sitting at an ambient temperature of 80 degrees C, whereas it would routinely fail prior to adding the extra pause.
Of course if you slow it down to 115.2k it works all the time too.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Life may be "too short", but it's the longest thing we ever do.
The only problem area I have found is on multistation systems when you have a shorted driver or receiver somewhere, and that would be the same regardless of the physical protocol.
PS - in this case I would have used current loop signaling with opto isolators for safety since there were only four wires for the signals. A common ground, Rx, Tx, and res on individual wires.
Post Edited (kwinn) : 1/9/2010 3:17:24 PM GMT
Unfortunately the PropTool doesn't have selectable baud rate nor any hooks for invoking a third-party loader instead of the default so using a separate loader isn't as smooth as it could be.
I was surprised to see the 3 transistor circuit you referred to at the Prop schematics web page. I found a 2 transistor circuit that I'm sure I worked on out of a prop manual somewhere (can't find it now but i still have the JPG of the circuit, see attached). Could never get to work for downloading. I had taken the RESn components out and it works fine for up and down serial communication on a com port.
well anyway,
have you ever used the 3 transistor circuit successfully, or know anyone else who has?
Thanks
http://www.parallax.com/tabid/442/Default.aspx
It's the PropellerDatasheet-v1.2.pdf
I could never get this to work for downloading into the prop
after I removed the connection between RESn and DTR, including capacitor and 4.7ohm resistor connected to Rx(2) the circuit has worked fine as a com port communication portal and I don't have to worry about closing hyperterminal or Parallax Serial Terminal communications
so... should this 2 transistor circuit have worked?
if not
then should this manual be updated and replaced on the web?
can anyone confirm the 3 transistor circuit worked for them