How would I wire a B1 to a BS2...?
NewAgeServer
Posts: 18
Here's my dilemma. I will have a device that will be at one end of a 2-wire cable. It has to be 2-wire, no more, no less. This device will contain a BS1. At the other end of the cable will be a BS2. The BS1 needs to transmit data to the BS2 so the BS2 can log it. I know I can use VDD, VSS and Data, but it needs to be two wires. How would I do this?
That's what it must be.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I'm not new at basic stamp, but i am new at the LCD AppMod
Post Edited (NewAgeServer) : 11/11/2008 4:28:02 PM GMT
| Device |----------------------------| Basic Stamp 2 | |........|----------------------------|...............|
That's what it must be.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I'm not new at basic stamp, but i am new at the LCD AppMod
Post Edited (NewAgeServer) : 11/11/2008 4:28:02 PM GMT
Comments
In the future please try to use a descriptive subject for your posts. "How would I...?" doesn’t convey what you need help with. This will often limit potential useful responses as those who can help may never see your message.
By your request do you mean that you ONLY have two wires to work with? ... At what speed do you need to communicate?· ... What current demands are required of the BS1 and connecting circuitry?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!
If you have power allready, and the two lines are for comms, an I2C protocol would work, or even use one line for timing and the other as a common transmit line, or use one line as RX and the other as TX and to async transmissions, which would be easiest.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I'm not new at basic stamp, but i am new at the LCD AppMod
Again, what are your distances?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I'm not new at basic stamp, but i am new at the LCD AppMod
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I'm not new at basic stamp, but i am new at the LCD AppMod
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Anyway, you must have a way to combine power & data going into your line on one end, and extract them separately on the other end.· This is not particularly difficult, and is far from being a new poblem.
The solution is to make sure your data is entirely AC.· This is easy if you use capacitors to pass AC and block DC, and inductors to pass DC and block AC.· Schematic attached.· The resistors can all be about 100K ohms.· The capacitors should be sufficient to pass your AC, and the inductors should be suffcient to block it.· If you are sending data at 9600 baud, probably 0.1 microfarad would be·OK for the series capacitors, and 10 microfarads for the electrolytics.· The inductors can actually be substituted by resistors sufficient to drop, say, 5 volts (2.5 volts in each resistor) at whatever supply currents you need for the respective Stamps.· You'd have to calculate that yourself after measuring the currents.
R1 and R2 are a voltage divider to make sure the input to the receiving Stamp swings about the midway point between Vdd and Vss of the receiving Stamp.·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· -- Carl, nn5i
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· -- Carl, nn5i
Alternatively, it might be better to add a couple of diodes to prevent the input signal swinging below Vss or above Vdd. This would automatically charge the coupling capacitor on the receiving end to the correct bias point, as soon as the Start bit arrived. You'd still need R1 and R2, of course. Experiment!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· -- Carl, nn5i
Post Edited (Carl Hayes) : 11/11/2008 9:34:53 PM GMT
I dont think you could run it right off the pin on the BS2 though, especially when the cap is drained, I think it would overload the pin. It would be far easier to use a transistor, then you know you are protected.
Or you could go really high tech, and impose a freqency on top of the VDD voltage, but I would think you would need circutry at either end to read the line.
So the BS2 could transmit anytime it wanted, by cutting power to the BS1.
The BS1 could transmit only after it recieved a 'poll' command from the BS2, and it would signal by pulling the VDD line low.
The BS1 would be running on its own power supply, either a large cap or a rechargable battery, so loss of VDD would not impact its operation. Also the power supply would need to have an input diode, so it could not impose its power back onto the VDD line.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· -- Carl, nn5i
1) The transmitter simply reverses polarity through an H-Bridge, depending on if it's a "1" or "0" being sent. On the receiver end you have a bridge rectifier and a sense line going to an I/O through a resistor to one of the power leads.
2) Another way would be to modulate the current and/or voltage without dropping the voltage below a level that the BS1 or BS2 will brown-out at.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Do you still have the diagram of the first technique you mentioned? I remember it from your old web site. It's one of the most clever applications of a full-wave bridge I've ever seen.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When all else fails, try inserting a new battery.
Post Edited (Bruce Bates) : 11/13/2008 6:50:11 AM GMT
webpages.charter.net/schwabelove/BasicStamp/OctalSerialCascade.gif
In concept, the idea is the same as what you would use in the link above with reference to the MODE,GND, and Vcc ... but with this design, power would need to originate from the Transmitter side.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· -- Carl, nn5i
Advantages:·
(1) Beau's method is likely to be more noise-immune than my method.
(2) Beau's method is likely to be less expensive than my method.
(3) Beau's method is likely to be easier to to get working than my method.
(4) Beau's method is likely to be more fun than my method.
Balance all that, however, against the following:
Disadvantages:
(1) I didn't think of it.
Surely all will agree that the disadvantage of Beau's method outweighs all its advantages.· Won't they?
Beau's method requires nothing more than a single ULN2803 to drive the two lines, running from two Pins on the transmitting Stamp.· On the receiving end, it requires only a bridge rectifier and filter capacitor·(to feed·power to the receiving Stamp)·and a 22K resistor (to feed data to the receiving Stamp).· A ULN2803's outputs can easily power a Stamp.· Run the ULN2803s from a nine-volt supply and feed Vin (rather than Vdd) on both Stamps.
No contest.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· -- Carl, nn5i
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I'm not new at basic stamp, but i am new at the LCD AppMod
Beau's current modulating scheme should work with the BS2 end supplying power to the BS1 end and the data going the opposite way. The ULN2803 scheme won't work with the data going in the opposite direction from the power. I suggest using something like the 1-wire protocol, but using standard serial I/O. One wire is a common ground. The other wire is signal / power. You have a stiff pullup at the BS2 end to +9V or +12V, something that will conduct maybe twice as much current as the entire BS1 end will need. You have a 22K resistor at each end to an I/O pin used as an input. You also have a switching transistor (like a 2N2222A) to ground with an appropriate base resistor to another I/O pin used for output. At the BS1 end, you also have a Shottky diode and large filter capacitor connected as a half wave rectifier to supply power to Vin. If you want, you could use a logic threshold MOSFET instead of the bipolar switching transistor.
When the switching transistors at each end are off (the default), the pullup at the BS2 end supplies power to the BS1 end. Once the capacitor is mostly charged, both ends will see the line as idle (active high) for the purpose of a SERIN. Either end (BS1 or BS2) can transmit using SEROUT in open collector / drain mode which will short the line to ground briefly to transmit zero bits while the Shottky diode keeps the capacitor from discharging. The other end can see the transmission using SERIN. The only problem is that you can't transmit long strings of zero bits without allowing the line to go back to high for a while to let the capacitor recharge. The simplest way to do this is to only transmit a few characters before doing a PAUSE for a few milliseconds. The receive end can all be done in a single SERIN if you want because the SERIN will wait for the rest of the characters. You can experiment to see how long a series of characters can be sent before the BS1's Vin will drop too low. It'll depend partly on the mix of ones and zeros in the characters. You may not even need to break up a SEROUT into pieces.
Back to the frequency-division multiplexing. One signal (the power, at zero frequency) goes one way, and the other signal (the data, at nonzero frequency) goes the other way. Good thing it's inherently bidirectional.
Dang! I liked Beau's approach.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· -- Carl, nn5i