Building a light pen for the 64/128

Started by xlar54, December 07, 2007, 07:02 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

xlar54


airship

Looks pretty easy to figure out to me. You've got a diagram, illustration, parts list, and sample programs. I'd add a button switch, though. Very nice little project.
Serving up content-free posts on the Interwebs since 1983.
History of INFO Magazine

xlar54


smf

Quote from: xlar54How does something like this work?
traditional lightpens/guns only work on a crt, not an lcd/plasma.

crt's work by firing electrons at the screen, they are aimed using a set of electro magnets. One for moving the beam up and down and one from side to side.

tv pictures are raster scan, which start at the top left and move the beam to the right and then move it down a line and again across to the right and repeated until you get to the bottom. At which point you move back to the top.

As it moves it changes the intensity of the r/g/b guns, the electrons hit the phosphor on the front of the screen. So
that fast moving objects don't blur the phosphor decays quick enough that when the same area is drawn again that it has already died out. It's quick enough that your persistance of vision doesn't notice ( well it can if you look out of the side of your eye ).

The lightgun however can see where the electron guns currently are drawing because it's brighter.

The vic chip in the c64 knows where the electron guns are because it's generating the display ( the tv synchronises the drawing to the input signal ), so all the lightgun/pen needs to do is tell the vic chip when it can see the electron beam and it can store the position for you to read later.

I'm not sure electronically how the lightgun/pen works, but the circuit I saw was practically just a light sensor hooked up to the vic chip ( via the joystick port ).

airship

There's a special lightpen detect line on just port 0. Port 1 won't work.
Serving up content-free posts on the Interwebs since 1983.
History of INFO Magazine

RobertB

Quote from: smfI'm not sure electronically how the lightgun/pen works, but the circuit I saw was practically just a light sensor hooked up to the vic chip ( via the joystick port ).
The Flexidraw light pens I have are more electronically complicated.  The Picasso's Revenge light pen I had is basically your description above.  The Koala light pen is somewhere between the Flexidraw and the Picasso's Revenge pen in quality.  The McPen has its extra circuitry built into an outboard housing.

Truly,
Robert Bernardo
Fresno Commodore User Group
http://videocam.net.au/fcug
The Other Group of Amigoids
http://www.calweb.com/~rabel1/

Mangelore

One of the pins on the 80 column VDC chip is a Light Pen input.
Was there any software ever written to take advantage of it?

smf

Quote from: RobertBThe Flexidraw light pens I have are more electronically complicated.  The Picasso's Revenge light pen I had is basically your description above.  The Koala light pen is somewhere between the Flexidraw and the Picasso's Revenge pen in quality.  The McPen has its extra circuitry built into an outboard housing.
I suspect the difference is only in how the detection is done, the basic principle is probably the same. You could prove it by looking at how the pen is hooked up to the c64, if they all connect to the same lightpen input on the joystick port then they are for all intents and purposes using the same method. As I said, I'm not really sure how the electronics works for detecting the beam.

Obviously it doesn't work if the screen is black, but some might be better than others at working on dark colours.

airship

The design on the Swedish site uses a phototransistor/transistor pair, which is, I think, what the Flexidraw uses. It was the best.
Serving up content-free posts on the Interwebs since 1983.
History of INFO Magazine