Has anyone ever tried to program a BasicStamp that is a mile or more away?
![LoopyByteloose](https://forums.parallax.com/uploads/userpics/025/nC57NMH1BTW54.gif)
A lot of you know I was quite enthused about RS-422 an RS-485 a few years ago.
It occured to me today that it would be nice to have a set up that allows you to reprogram your BasicStamp without a site visit.
I suspect the most conservative approach would have 3 twisted pairs providing Full Duplex RS-232 ;One pair·for Tx, One for for·Rx, and One pair·for the ATN line.
Since Ethernet cable is 4 twisted pairs, the fourth pair could prove 9 Volts DC to the remote BasicStamp and the RS-422/485 chips.
During normal operations, the Rx and Tx could communicate via Debug.· If something became obviously wrong, first test the unit with a 'Hello World' and just load a revised program or reload the original.
I suspect some will jump in as say that it has already been done.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Everything in the world is purchased by labour; and our passions are the only causes of labor." -- David·Hume (1711-76)········
It occured to me today that it would be nice to have a set up that allows you to reprogram your BasicStamp without a site visit.
I suspect the most conservative approach would have 3 twisted pairs providing Full Duplex RS-232 ;One pair·for Tx, One for for·Rx, and One pair·for the ATN line.
Since Ethernet cable is 4 twisted pairs, the fourth pair could prove 9 Volts DC to the remote BasicStamp and the RS-422/485 chips.
During normal operations, the Rx and Tx could communicate via Debug.· If something became obviously wrong, first test the unit with a 'Hello World' and just load a revised program or reload the original.
I suspect some will jump in as say that it has already been done.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Everything in the world is purchased by labour; and our passions are the only causes of labor." -- David·Hume (1711-76)········
···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
Comments
-Phil
There is a third option to consider. Such devices exist that let you connect a serial device over an IP network, using an interface box on each end. I have seen this done before, to remotely control robotic TV studio cameras. I believe they provide a full compliment of handshaking signals. The only questions as for if it will work concern the baud rate at which the STAMP programs at, and if the Stamp <-> IDE software connection can tolerate latency. Perhaps a Parallax employee could chime in on this?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"... one of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs." -
"If Python is executable pseudocode, then perl is executable line noise."
"The best accelerator available for a Mac is one that causes it to go at 9.81 m/s2."
"My software never has bugs. It just develops random features."
"Windows isn't a virus, viruses do something."
"Programmers are tools for converting caffeine into code."
"Enter any 11-digit prime number to continue."
Transmiting low voltage power·over·small wire is indeed problematic due to voltage drop, but I suspect that you could easily go up to 48 volts DC without any compromise in insulation.· Most wire insulation·can easily handle 100 volts.· But·above 48VDC is generally considered a greater fire hazard due to electric sparks are hotter and can ignite combustible material or gases.··Of course, this can be discarded from the scheme if the distances are too much for power distribution.
Second, a short-haul modem adds both a cost factor and a significant power drain.· I suppose if your like me and save old stuff, you may already have one or two modems.· If that case, the project at least becomes cost effective - and quite different. You would be programing the modems, on the PC in Forth or Visual Basic or C++.·
I'm not entirely·sure how the do it on a BasicStamp, but I am sure it can be by having the·BasicStamp output an intialization string.· It seems that requirement·would also·disallow using the ATN to program the BasicStamp if it were completely blank as the BasicStamp's moden couldn't be first·intialized.
Yes, I·do believe·that the 9,600Baud and 19,200Baud that are used in DEBUG are also the programing rates.· Why would Parallax change to another rate unless it needed to eliminate a significant programing delay?· I don't think that is case.
Getting back to the RS-422/RS-485 concept.· I have been pondering the ideal RS-232 to RS-422/RS-485 for quite some time. And this version has pointed me towards building a board that is multi-use.
In one configuration, it could program and reprogram a remote BasicStamp, even one that is completely blank (6 wire, Full Duplex, plus ATN).· That means that if the remote site goes haywire, one could test the BasicStamp with a simple 'Hello World'.
But in other applications, ·by eliminating the ATN line, it could be a simple full-duplex device (requires 4 wires) or a simplex device (requires 2 wire). I have avoided the half duplex (2 wires) as it requires more thought about protocol.· Each end has to switch between Tx and Rx in a predictible manner.
Yes, it would be possilbe to go from Internet directly into a BasicStamp with the right PC software or, in some cases, by calling up PBasic via the Remote Computer operation feature in WindowsXP.· I've never really tried the PINK, but seeing that there is a new updated edition available, one might even be able to eliminate powering up a PC to reach the BasicStamp at the end of the line.· You just need ADSL and a router/firewall to connect to the PINK to the RS-422/485. Again I am wondering if one can evolve the ATN with just a PINK.
In sum, I am warming up my soldering iron and rumaging through my parts.· I think that the dual use feature makes the whole thing more worthwhile.· I may even create a board with the configurations [noparse][[/noparse]RS-232 programing, full-duplex, half-duplex, and simplex]
If it·proves·useful and ·popular - Parallax is welcome to duplicate the·multiple design.·It may be a good tutorial project for Stamps-In-Class.·I just love to explore.·
This is idea for rural techies that really need to monitor something on the back 40 acres while relying a low power consumption, like a 12volt car battery.
By the way, the SX-28 and SX-48 Proto boards aleady have spaces available for the RS-422/485 transciever chips.· Even the Propeller Protoboard is easily adaptible.· But these wouldn't reprogram from a remote site.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Everything in the world is purchased by labour; and our passions are the only causes of labor." -- David·Hume (1711-76)········
Post Edited (Kramer) : 9/23/2007 10:43:02 AM GMT
Jeff T.
Rafael
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You've got to play the game.
You can't win.
You can't break even, except on a very cold day.
It doesn't get that cold.
~Laws of Thermodynamics~
I guess if you had two Stamps, one on the sending end and one on the receiving end, you could program one of the slots of the local Stamp with the program you wish to send, and send it to the remote stamp using a program running in a different slot, much like on the remote end. This would eliminate any need for intervention from the tokenizer. You would basically be making yourself a MODEM (modulator-demodulator) except instead of using FSK, QAM, or QPSK, you would be using DTMF.
I have a software-guru friend who is in the middle of writing a PC program for me that will let me send a file of my choosing, 8 bytes or so at a time, to a Stamp so I can use it to program an EEPROM. Because of the limited speed of the Stamp and the lack of a hardware UART, I have to send tiny (compared to computer applications) packets of data. After writing each packet to the EEPROM, the Stamp would respond with a SYN or ACK ASCII code to ask for more packets. This would continue until the EEPROM is completely programmed. I could theoretically program the data destined for the EEPROM by using a DATA table in the Stamp, but that would limit me to less than 2k, and some of my EEPROMs are 32-64k. That would require a lot of steps, 2k at a time!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
We have a customer here in Oz Dowunder that can and has reprogramming
of the Basic Stamps via a Modem .. thousand of miles across the country.
I do not know the ins and out of it all so can't share that info.
But it works very well .
Cheers
Ronald Nollet·· OZ Australia
Just get a USB adapter for the Basic Stamp and a USB Ethernet Birdge for both ends.
If you had to you could connect the Ethernet adapter to a wireless network bridge.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never give up,·Never submit to the seemingly invincible enemy.
-Phil
1. Yes, a modem can be used, but a lot more equipment is involved and both ends of the line require more power. And, you are likely to prefer using it in is a telephone context.
2. Ethernet is even more overhead and support of power and equipment. I do have a FTP and TELNET Tini400 server sitting next to my on my desk. Why would I bother to attach a BasicStamp to it when it already has CANbus and 1-Wire support in Java.
Try to consider being at a remote station in the Australian outback and you want to monitor a water hole and pump house that is a bit far away. You have solar energy to recharge a minimal power setup [noparse][[/noparse]maybe one 8volt 4ah gel cell] if the pump's starter batteries are down unexpectedly. In fact, the BasicStamp would tell you that the batteries are the problem before you leave home. It might also provide other significant info. It seems the BS2 [noparse][[/noparse]only requires a few milliamps to operate] and a low power RS-422/285 chip set are quite ample. Since you are developing the setup, it would be wonderful to reprogram it in the evenings and test out more features.
Incidentally, I do have a 56K modem saved from my dial up days in Internet connections. I save it in case I must fax something from the computer to someone. The problem is that one needs a pair to do most of these hobby applications.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
PLEASE CONSIDER the following:
Do you want a quickly operational black box solution or the knowledge included therein?······
This is really more feasible inside a building, especially if it already has a network.
You only need one adapter, at the end with the Basic Stamp.
A more expensive option is 10baseFL, which has a range of 2000 meters.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never give up,·Never submit to the seemingly invincible enemy.
Post Edited (Junk_Bot) : 2/27/2008 4:26:55 PM GMT