On Sat, 19 Mar 2005 00:01:31 -0600, Jim Leonard <trixter at oldskool.org> wrote:
Okay, now my age and lack of experience is going to
show: Can someone explain
to me exactly *how* a light pen works? What is the feedback mechanism if
drawing on, say, a completely black screen? How does the computer get
coordinates for where the pen is touching?
On the machines I'm familiar with (VLSI video chip like a 6545 or C=
VIC-II), the video chip has a light pen input which looks for a pulse
from a phototransistor which may or may not have a
press-to-the-screen-to-read or a squeeze switch on the pen body (to
keep it from firing when it's not meant to). When the chip sees the
pulse, it latches its internal row/column counters to a register that
can be read after the fact by user software. Some chips (like the
VIC-II) can generate an IRQ when that occurs (the initial version of
the VIC-II chip, on the C= proto run had a flaw that when they warmed
up, they would generate spurious IRQs and hose the machine).
The only requirement is that the beam produce a bright enough flash to
cause the phototransistor to fire deterministically. From memory,
that typically required the application to put something visible to
humans as well on the screen. I've seen check boxes, etc., when used
to capture simple user input (YES/NO...) I do not know if it's
possible to have a dark area of the screen fire the phototransistor or
not.
-ethan