[comp.sys.atari.8bit] Reply to Hennie Kretschmann about prob. with joystick ports...

jhs@MITRE-BEDFORD.ARPA (02/27/88)

My reply direct to Hennie Kretschmann was returned by an irate mailer, so
I've re-posted it this way.  Perhaps it will be of general interest anyway.

Hennie asked me if I could explain why he sees "timing jitter" when trying
to generate periodic pulses on the joystick port outputs.

I think that what you are seeing may possibly be the "Vertical Blanking
Interval" interrupt which occurs whenever the monitor reaches the bottom
of the screen and returns to the top.  During this time, the CPU is
interrupted and has to do some housekeeping chores.  In Europe I think this
interval is 1/50 second.  In the U.S. and Canada it is at 1/60 second since
the power line frequency here is 60Hz.

For a pulse generator, you might look at programming the POKEY chip to
generate the pulses.  I think that will give a perfectly periodic output.

For an RS-232 device, you could use the serial peripheral port, which requires
only some level converters, e.g. MC1488 and MC1489 to convert to RS-232
levels, and a new R: driver that knows how to use this port.  There was a
commercial device called the R:Verter which did this, and the driver program
is floating around if you can find someone who has it.  This output is also
generated by the POKEY chip so should be free of the timing uncertainty due
to the VBI processing.

You could probably also use the joystick ports, but you might have to turn
off the VBI interrupt (causing the screen to go blank) if the timing "jitter"
is too much.

I hope these comments are helpful.  You might find "de re Atari" fun to read
if you can get a copy of it.

-John Sangster / jhs@mitre-bedford.arpa