home *** CD-ROM | disk | FTP | other *** search
-
-
- SEGA GLASSES INTERFACE FOR THE RS232 PORT
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Comments/enquiries/money(8-)) to:
-
- Glen Harris
- glen@wench.ece.jcu.edu.au
- James Cook University of North Queensland
-
-
-
- First off, here's the circuits: Warning! This is drawn using ASCII
- graphics characters. It may not
- print out correctly on some printers.
-
- RTS/DTR control version
- ~~~~~~~~~~~~~~~~~~~~~~~
-
- +VE
- │
- ┌────────────────o───────────────────┐
- │ ┌──────────────┼────────┐ │
- │ │ ┌────────┐ │ │ │ ┌──────────────┐
- │ │ ┌─┤1 8├─o─%%%%─┐ │ ┌───┼──┐ ┌──┼─────o──o───┐ │
- │ │ │ │ │ R1 │ │ │ │ │ │ │ │ │ │ │
- │ └─┼─┤2 7├────────o │ │ ┌─┴──┴──┴──┴──┴──┴──┴─┐ │ │
- │ │ │ IC1 │ R2 │ │ │ │14 13 12 11 10 9 8 │ │ │
- │ ┌─┼─┤3 6├─o─%%%%─┘ │ │ │ IC2 │ │ │
- │ │ │ │ │ └────────o │ │ 1 2 3 4 5 6 7 │ │ │ TO STEREO
- └─┼─┼─┤4 5├────┐ │ │ └─┬──┬──┬──┬──┬──┬──┬─┘ │ │ CONNECTOR
- │ │ └────────┘ │ │ │ │ │ │ │ │ │ │ │ │ =========
- │ │ C1 === === C2 └───o──┼──┼──┼──┼──┘ │ │ └──── COMMON
- │ │ │ │ │ │ │ └──┼─────┼───┼────── TIP
- │ └───────────────o─────o │ │ └─────┼─────┼───┼────── MIDDLE
- │ │ └──────────┼──┼────────┼─────o───┘
- │ GND │ │ │ │
- └──────────────────────────────────┘ DTR RTS GND
- TO RS232 CONNECTOR
-
-
- RTS only version
- ~~~~~~~~~~~~~~~~
-
- +VE
- │
- ┌────────────────o───────────────────o──────────────┐
- │ ┌──────────────┼────────┐ │ │
- │ │ ┌────────┐ │ │ │ ┌─────┼──────────┐
- │ │ ┌─┤1 8├─o─%%%%─┐ │ ┌───┼──┐ ┌──┼─────┼────────┐ │
- │ │ │ │ │ R1 │ │ ┌─┼───┼──┼──┼──┼──┐ │ ┌───┐ │ │
- │ └─┼─┤2 7├────────o │ │ │ ┌─┴──┴──┴──┴──┴──┴──┴─┐ │ │ │
- │ │ │ IC1 │ R2 │ │ │ │ │14 13 12 11 10 9 8 │ │ │ │
- │ ┌─┼─┤3 6├─o─%%%%─┘ │ │ │ │ IC2 │ │ │ │
- │ │ │ │ │ └────────o │ │ │ 1 2 3 4 5 6 7 │ │ │ │
- └─┼─┼─┤4 5├────┐ │ │ │ └─┬──┬──┬──┬──┬──┬──┬─┘ │ │ │
- │ │ └────────┘ │ │ │ │ │ │ │ │ │ │ │ │ │ │
- │ │ C1 === === C2│ └───o──┼──┼──┼──┼──┘ │ │ │ └──COM
- │ │ │ │ └─────┼──o │ └──┼─────┼───┼─┼────TIP
- │ └───────────────o─────o │ └─────┼─────┼───┼─┼────MID
- │ │ └──────────┼───────────┼─────o───┼─┘
- │ GND │ o─────┼───┘
- │ │ │ │
- └──────────────────────────────────┘ RTS GND
- TO RS232 CONNECTOR
-
-
- Components needed
- ~~~~~~~~~~~~~~~~~
-
- R1 1K ohm resistor
- R2 180K ohm resistor (I used a 200K trimpot)
- C1 0.1uF capacitor
- C2 0.01uF capacitor
- IC1 555 timer
- IC2 4030 quad 2-input XOR
-
-
-
- │ │
- │ │
- ───o─── ────o───── THESE WIRES ARE JOINED TOGETHER
- │
- │
-
-
- │ │
- ───┼──── │
- │ ─────┼───── THESE WIRES ARE _NOT_ JOINED
- ───┼─── │
- │ │
-
-
-
- How it works
- ~~~~~~~~~~~~
-
- The circuit consists of a 555 timer in it's astable configuration,
- oscillating at 400Hz. The output of the timer is XORed with the
- DTR and RTS lines of the RS232 port, to control each lens separately.
-
- The RTS only verion takes the RTS input and inverts it through the
- spare XOR gate, which feeds it to the former DTR input. The changes
- to the "How LCD's work" section should be fairly obvious.
-
-
- How LCD's work
- ~~~~~~~~~~~~~~
-
- The LCD panel is two sheets of polarised plastic/glass, with their
- axes of polarizarion parallel to each other. This means that the
- light entering one piece is polarised, and then exits through the
- other piece, as it has the same polarization.
-
- When an alternating electric field is passed through the liquid
- crystal between the sheets, the polarization of the light is changed
- by an amount inherent in the design of the LCD, usually 90 or 270
- degrees, for minimum passage of light.
-
- When this light reaches the second polarized panel, the planes of
- polarization are at 90 degrees to each other - and so no, or very
- little light is transmitted.
-
- Electrical Connections
- ~~~~~~~~~~~~~~~~~~~~~~
-
- The LCD panel is designed to turn opaque when a potential oscillating
- between +10V and -10V is placed across it's connectors. This would mean
- grounding one connector and placing an oscillating +/-10V potential on
- the other. Since getting -/+10V would unnecesarily complicate the
- circuit, this effect is achieved by placing +10V across the connectors
- and then, effectively, _REVERSING_ the connectors, letting current flow
- the other way. As far as the LCD is concerned, it's getting +/-10V.
-
- Practically, this is done by feeding the 555's output to each of the
- connectors on the panels, namely, the backplane and the left and right
- connectors.
-
- The square wave goes through 3 of the XORs, with the input to the one
- connected to the backplane tied to ground so it acts as a simple buffer.
- The DTR and RTS lines are connected to the inputs of the other two XORs.
-
- When the RTS and DTR lines are low, the outputs are in phase, and so
- there is a potential difference of zero volts on each LCD, having no
- effect on the crystals.
-
- When the DTR or RTS goes high, the output of the XOR is inverted with
- respect to the input, giving a phase change of 180 degrees. This gives
- a potential difference of 10V which oscillates at the frequency of the
- 555 timer.
-
- RTS HIGH RTS LOW DTR HIGH DTR LOW
- │ │ │ │
- ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐
- BP ┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └
- ┌─┐ ┌─┐ ┌─┐ ┌───┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐
- L ┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └───┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └
- ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌─┐ ┌───┐ ┌─┐ ┌─┐ ┌─┐ ┌───┐ ┌─┐
- R ┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └─┘ └
-
-
- In the RTS/DTR version, one of the XOR gates is not used, so it's
- inputs are tied low to prevent free oscillation, and the danger of
- thermal damage.
-
- The circuit looks a bit complex, but pins 2 and 6 on the 555 can be
- connected under the chip, and the same with 4 and 8, which makes
- things a lot simpler. Not much can be done for the 4030.
-
- The 180K resistor should give 398.89Hz if all the components are
- exactly what they are marked, but since they rarely are, I used a
- 200K (or 500K, see below) variable resistor and a frequency counter
- to get 400Hz.
-
- Some people might like to try a faster oscillator, as some video
- cards and monitors can switch images at 70Hz and above. As the
- frame rate increases, it will start to interfere with the blanking
- effect of the LCD. It is possible to increase the oscillation to
- above 400Hz, HOWEVER this _must_ be done with caution, as I do not
- know what will happen to the crystals if they are pushed too far.
- I have heard of people using 512Hz (crystal driven) with no ill
- effects, but this is entirely at your own risk, and I cannot be held
- responsible for any resulting damage.
-
-
- The circuit can be fitted on a 5cm by 2cm piece of veroboard,
- including the stereo socket. This fits quite nicely in a project box
- meant for an IR remote control, with the removeable front panel cut
- to take a DB25 connector.
-
-
- Here's the pinouts for the RS232 connector (DB9 and DB25 versions):
-
- RS232 9 pin 25 pin
- ========================
- RTS 4 20
- DTR 7 4
- GND 5 7
-
-
- The whole thing is powered by a 9V battery from the battery holder in
- rear of the box and has an on/off switch on the side. There is also a
- power-on LED on the top and a LED on the DTR/RTS inputs to show me at a
- glance if there is a signal _getting_ to the box before I start ripping
- apart my code to find the bug.
-
-
- Trouble Shooting
- ================
-
- > Check the wiring.
-
- > Check that power is getting to all the chips.
-
- > Check the 555 is oscillating at ~400Hz on pin 3 and also on pins 1,
- 6 and 13 of the 4030.
-
- > Check the 3 ouputs to the stereo socket with an oscilloscope.
-
- > Tie the RTS and DTR pins high physically and confirm the waveform
- is the same as the one drawn above.
-
- > Check that the RTS and DTR signals actually reach the 4030 with a
- logic probe/CRO _ON THE PINS_, not just the DB25/DB9.
-
-
-
- Here's a sample program to test the glasses. The word at the bottom of
- the screen should be the lens you can see out of. If the lenses are back
- to front, simply switch the RTS and DTR wires. DO NOT edit the program
- to change the #defines of LEFT and RIGHT. My programs will have an
- option to reverse the lenses, and I hope most other programmers will do
- so as well, but we _would_ like to set a standard, wouldn't we?
-
-
-
- -------BEGIN-----cut here------
- /*******************************************************************************
- * *
- * This program is a simple demo to test that the glasses are working *
- * and that the lenses are the right way around. *
- * *
- * Glen Harris *
- * glen@wench.ece.jcu.edu.au *
- * *
- *******************************************************************************/
-
- #include <stdio.h>
- #include <dos.h>
-
- unsigned int com_base[] = { 0x3f8, /* COM1 */
- 0x2f8, /* COM2 */
- 0x3e8, /* COM3 */
- 0x2e8 /* COM4 */
- };
-
- #define BOTH 0 /* Both lenses clear */
- #define LEFT 1 /* Left lens clear */
- #define RIGHT 2 /* Right lens clear */
- #define NONE 3 /* Neither lens clear */
-
- #define Glasses(x) outportb(base+4,(x)) /* Byte containing RTS and DTR bits */
-
- void main(int argc)
- {
- unsigned int base; /* Comm port base from which to work */
- unsigned char left, right;
-
- base = com_base[1]; /* COM2 */
-
- if (argc == 1) /* No options, */
- {
- left = LEFT; /* so lenses are the */
- right = RIGHT; /* correct way around */
- }
- else /* If there is an option (any option), */
- {
- left = RIGHT; /* switch the lenses to */
- right = LEFT; /* the other way around */
- printf("Swapping lenses.\n");
- }
-
- while(!kbhit())
- {
- printf("%s\n", "Left");
- Glasses(left); /* Clear left lens */
- delay(500); /* Wait half a second */
- printf("%s\n", "Right");
- Glasses(right); /* Clear right lens */
- delay(500); /* Wait half a second */
- }
-
- Glasses(BOTH); /* Clear both lenses */
-
- getch();
- }
- ------END--------cut here----
-
-
-
-