BS2 and Serial Communications
ShadowDragon
Posts: 51
Hi, i was wondering how to send and receive data over a serial connection at the same time. Thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I watch how the moon sits in the sky on a dark night,
shining with the light from the sun,
The sun doesn't give light to the moon,
Assuming the moons gonna owe it one,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I watch how the moon sits in the sky on a dark night,
shining with the light from the sun,
The sun doesn't give light to the moon,
Assuming the moons gonna owe it one,
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I watch how the moon sits in the sky on a dark night,
shining with the light from the sun,
The sun doesn't give light to the moon,
Assuming the moons gonna owe it one,
A UART is a Universal Asychnronous Receiver Transmitter. They are used to encode serial data streams into a format that can be sent over either phone lines using a MODEM, or even a radio link. The basic technology goes back about twenty odd years to the first dialup lines for computers.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Buck Rogers
www.gregg.levine.name
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I watch how the moon sits in the sky on a dark night,
shining with the light from the sun,
The sun doesn't give light to the moon,
Assuming the moons gonna owe it one,
"Synchronous Transfers" synchronize data transfers by using a 'clock' pin. The BS2 typically implements this using the "SHIFTIN/SHIFTOUT" keywords -- but it only acts as a clock 'master' (where the BS2 generates the clock signal) it cannot act as a clock 'slave', so this mode is no good for BS2 to BS2 communcations.
So, while in 'normal' TTL circuitry, synchronous transfers can be twice as fast as asynchronous, the BS2 doesn't support the 'slave' mode to make this work. Nor does the BS2 run fast enough to make engineering in a 'slave' mode a useful thing to do.
Conclusion: Use SERIN/SEROUT, and don't worry about whether it's "synchronous" or "asynchronous".
You·CAN perform bi-directional asynchronous communication (RS-232) between two Basic Stamps, but NOT in native mode. You will need to add a UART to each of the Basic Stamps, which will provide the concurrent, bi-directional capability, and the necessary data buffering. The best UART that I know of for Basic Stamp use, since it uses a synchronous serial access (SPI/Microwire) method (as opposed to a parallel method), is the Maxim MAX-3100. I'd imagine you can order a couple of free samples from Maxim if you'd like to try it out.
Thanks to Dr. Tracy Allen for the following applications note on using the MAX3100 with the Parallax Basic Stamp: http://www.emesystems.com/BS2IrDA.htm
Although the thrust of that particular applications note deals with the IrDA capabilities of the MAX3100, it can also transmit and receive over a hard wire (RS-232) connection as well. The most important areas to review in this applications note are the format and use of the MAX3100's internal registers, and the format and use of the configuration word. Once you have that well in hand, the rest is simplicity itself.
I have included a copy of the MAX-3100 data sheet for your inspection and perusal. Just as a side-note, there are other members of the Maxim MAX-31xx series as well, which may be of interest. Check the Maxim/Dallas web site for more information: http://maxim-ic.com·. Let us know how you make out with it.
Regards,
Bruce Bates