Sitenotice:
2020: NameSpaces are going to be implemented this year to better separate content. OS-9 Al (talk) 11:18, 15 April 2020 (CDT)
2020-05-17: If a page gives you an error about some revision not being found, just EDIT the page and the old page should appear in the editor. If it does, just SAVE that and the page should be restored. OS-9 Al (talk) 12:22, 17 May 2020 (CDT)

Hi-Res Joystick Software

From CoCopedia - The Tandy/Radio Shack Color Computer Wiki
Jump to navigation Jump to search

Aaron wolfe/robert gault The High Resolution Joystick Adapter

I present here a simple Basic program to demonstrate how the adapter can be used in either the Tandy or CocoMax modes. Most of the work is done by an assembly language routine, one for each mode. This is not the only way to write useful code, it is just an example to get you started on your own projects. Keep in mind that the timed circuit values change when the Coco CPU clock changes. It may be difficult to get the full resolution at fast clock speeds.

Joystick.zip demo Basic program and 2 asm source code files in EDTASM format binary files included plus Tandy/CocoMax circuit (joystick.gif)


Hi-Res joystick interpolation software

This project was jointly created by John Kowalski, Robert Gault and Nickolas Marentes

How the ADC works

The real work when converting any analogue voltage to a digital reading with the Color Computer is actually done using the DAC (Digital-to-Analogue) converter. To understand how the ADC (Analogue-to-Digital) circuit works, we must understand how the DAC works.

In simple terms, the DAC accepts data from the computer and converts it to an analogue voltage. Although the computer's data bus is 8-bit, the input to the DAC is only 6-bits. This represents a value from 0 to 63 or 64 individual voltage steps as output from the DAC. This is also how the 64 levels of volume is derived when the DAC output is diverted and used for sound generation.

In order to get a digital reading from the joystick port, the output of the DAC is fed into an input of a voltage comparator. At the same time, the voltage from the joystick or mouse is fed into a second input of the voltage comparator. This voltage comparator compares the two input voltages and sets an output high or low to indicate the difference. Software running on the Color Computer can read the comparator output and determine if the DAC voltage needs to be raised or lowered to attempt to match the joystick port voltage. This test is repeated until it locates the DAC voltage value which coincides with the incoming voltage. Through a process of successive approximation, an accurate ADC value can be found.

This is the first stage of reading the joystick port that derives the normal 6-bit joystick port reading.