Suggestion: Light-pen
Nick Mueller
Posts: 815
Hi!
Decades ago, I have built a commercial "high-res" (512 x 256 pixels; B&W) for the APPLE ][noparse][[/noparse]. The distinct feature was a light-pen.
It was some fibre-optics cable (the cheap plasics type), a photo-transistor and an amplifier. The graphics-chip supported that light-pen and the location the event occured (accurate to +/- 2 lines and 8 pixels wide) could be read from some GDP's register.
Just now, I got the idea of having one for the Propeller. I'm not in the situation to modify the VGA or TV routines (yet) but if someone thinks that it is doable, I could spend some time reinventing the electronics.
Electronics were a bit tricky because of noise and low signal. So it required some shielding for the amplifier and a low-noise high gain OpAmp.
Anybody wanting to pick that idea?
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
Decades ago, I have built a commercial "high-res" (512 x 256 pixels; B&W) for the APPLE ][noparse][[/noparse]. The distinct feature was a light-pen.
It was some fibre-optics cable (the cheap plasics type), a photo-transistor and an amplifier. The graphics-chip supported that light-pen and the location the event occured (accurate to +/- 2 lines and 8 pixels wide) could be read from some GDP's register.
Just now, I got the idea of having one for the Propeller. I'm not in the situation to modify the VGA or TV routines (yet) but if someone thinks that it is doable, I could spend some time reinventing the electronics.
Electronics were a bit tricky because of noise and low signal. So it required some shielding for the amplifier and a low-noise high gain OpAmp.
Anybody wanting to pick that idea?
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
Comments
1. You don't really have to modify the graphics routines. Just monitor their sync outputs in another cog to get the timing info.
2. The lightpens of yesteryear were all used with CRTs, which used a (hard) glass faceplate. Now we've got flat panel LCDs with (soft) plastic faceplates, which are much easier to scratch. Somehow, this has to be addressed by the choice of pen tips.
-Phil
Update: As subsequent posters have pointed out, a lightpen wouldn't work with an LCD anyway: STNs switch too slowly and TFTs are always on. ('Hadn't had my coffee yet. )
Post Edited (Phil Pilgrim (PhiPi)) : 4/10/2007 5:19:57 PM GMT
> at all with them.
Oh, they are to slow. And they also do have segments that work in parallel. You are right! Fogettid!
Would only work on a CRT (remember?)
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
It would still be very cool on the composite side...
Perhaps a modification to the TV driver is in order?
Oldbit
It only works on a CRT. The problem is detecting the signal. On a CRT, the signal has a very fast attack and a *very* slow decay. Not so on an LCD (but I never scoped one with a photo-transistor).
It would be best to trigger on the slope (differentiation) and the level, but I just triggered on the level (IIRC). That worked good enough, because we sold a complete system (medical stuff) and the sensitivity could be adjusted.
But who is using a CRT nowadays? Not that many. OTOH, OSD with a lighpen for a TV-set would be cool.
For what I thought about using it, CRTs aren't used.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
Post Edited (Nick Mueller) : 4/10/2007 9:14:21 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Post Edited (Paul Baker (Parallax)) : 4/10/2007 5:12:27 PM GMT
My setup is a corner table with a large/heavy 25" TV at one side, and a VGA monitor to my left.
Guess I'm one of the last to upgrade... sob...
Oldbitcollector
Funny you mentioned touch screens, I was just discussing a new project this morning and suggested using a propeller and an 8 inch VGA touch screen. I had exactly the same idea in mind (using a VDIP). My client was very interested in an all-in-one unit rather that having to have a separate PC for the user interface and is now sold on the idea! Of course I don't have a touch screen at hand as yet, and can't be 100% sure it will be doable. Paul is there any chance you could hook up the gear you have and tell me how you went and what brand of monitor you used? That would be really appreciated. Thanks in advance.
Cheers,
Shane.
PS Sorry slightly off topic - I like the light pen idea too... I'll keep a CRT screen handy!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Pseudo code: (Assume screen resolution is 256 by 192)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 4/11/2007 5:09:57 AM GMT
Here's a simple circuit from "Atari Archives" for the construction of a light pen.
www.atariarchives.org/ecp/chapter_6.php
Oldbitcollector
Regarding the pen...
You don't require a fiber optic cable; you can put a light emiting diode in a pen housing and use plain old wire.
Of course, with a touch screen - no pointing device is required. But the pen is actually appealing for fine, detailed work.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
The fiber optic cable has some advantages:
* It is lighter
* The sensitive area is much smaller compared to the photo-transistor's window (more accuracy pointing)
* Less problems with electrical noise (amp and sensor close together)
I kinda doubt that the linked atari-circuit works very well.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
*A fibre optic will tend to be quite stiff once you have the type with a protective cladding. The weight of a photodiode and a switch and some suitably flexible wire is not much of an issue.
*Resolution problems can be fixed with a mask or a lens.
*Reduction in noise if only an advantage if it was a problem in the first place.
But I would say you could make a workable solution using either method however I would look at using surface mount photodiodes, some are tiny.
Another alternative is a pen containing an ultrasonic emmitter and a pair of detectors to locate the pen tip, I have a digitizing pad that uses that method and the transmitter is built into the ball point pen.
Graham
First frame would alternate black and white pixels...
Record the brightness of the pixel the light pen sees
second frame would have two black then two white pixels...
record the state of the light pen
third frame would have four black then four white pixels...
read the pen
etc. etc.
After 16 frames the recorded states of the light pen should be a binary integer representing the pen's position.
I doubt that this is the best pattern of pixels to use, a 2D version of "gray code" would likely be more reliable. Also, using 4, 8, or 16 pixel brightnesses/colors could speed up the search. With a 16 brightness/color search 4 video frames should be enough to find the light pen's tip.
another way,
1. one frame with the top white and the bottom black
2. one frame with the right side white and the left side black.
3. you now know what quadrant of the screen the pen is pointing at.
4. restore the contents of the quadrants the pen is NOT pointing at.
5. loop back to step 1, but this time just put the search pattern on the quadrant the light pen was found in.
again 16 frames would be needed for a two color or gray level search, and 4, 8, 16 colors or gray levels would speed the search. This system is better because it only blanks the whole screen for two frames. (it'd prolly be really cool to watch too! )
All of these systems wouldn't need to disturb anything displayed on the screen if the video driver was modified to generate these test patterns.
my 2 cents,
Marty
Interesting idea... Along the same lines, you could make half the screen black, half the screen white.... monitor the Light pen
...if it is HIGH, sub divide the previous "white" section so that it is now half black, half white and repeat
...if it is LOW, sub divide the previous "black" section so that it is now half black, half white and repeat
for X you would need 8 iterations ... 256 = 8-bit representation
for Y you would need 8 iterations ....192 = 8-bit representation
...So as you said approximately 16 total iterations.
The binary HIGH / LOW pattern through each iteration will reflect the correct position.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
I wouldn't like the flicker while trying to track a lighpen.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
right, it would be pretty hard on the eyes to continuously track the light pen. (not to mention slow as mud. 16 iterations / 30fps = 0.53 seconds per location and any movement would screw up the algorithm) Now, if all the program needs is the location of click events, continuous tracking is not needed. The nifty part of using converging subdivisions of the screen is that flicker can be held to a minimum.
Beau I like your idea, it's simpler. I do think it'd be less annoying to alternate checking X and Y position. I think a shrinking flashing square would be less annoying than a shrinking horizontal line followed by a shrinking vertical line.
Also, single pixel position information would not always be needed. (say when clicking on buttons or selecting text.) In those cases searching could be further accelerated by only checking to say 5-bit precision in X and Y. (i.e. narrow the light pen position down to a single 8x8 pixel square in a 256x192 screen) Only 10 iterations would be needed then.
my two cents
Marty
P.S. I think you can also get just the raw touch screen panels, with no electronics box. The resistive touch screens should be really easy for the Prop to read directly. These are just two clear conductive films separated by an elastic separator. from what I've seen they should read out just like a potentiometer. (huh i guess there are also some "friendly" chips for reading a touch screen too http://www.national.com/pf/LM/LM8300.html )
Post Edited (Lawson) : 4/12/2007 4:05:53 AM GMT
This could also work on an LCD with minimal eye annoyance. Just modulate the pixels under different portions of the square differently and use the time-varying pattern to determine which part of the square is being picked up. If it's the right side, move it right; if the left, move left; etc. An interesting modulation pattern to try might be a maximal-length sequence (MLS) circulating about the square's periphery. The phase of the sequence picked up by the lightpen would determine where on the perimeter the pen was getting its reading. The advantage of such a sequence is its resistance to interference from other stuff that's happening on the screen. (This type of sequence is also used in CDMA cell-phone transmissions to modulate the individual signals for sharing a single channel.)
-Phil
Graham