Silicon ChipComputer Bits - November 1993 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: The Australian very fast train
  4. Feature: Electronic Engine Management; Pt.2 by Julian Edgar
  5. Review: Tektronix TDS 544A Colour Oscilloscope by Leo Simpson
  6. Project: Build A Jumbo Digital Clock by Darren Yates
  7. Project: High Efficiency Inverter For Fluorescent Tubes by John Clarke
  8. Serviceman's Log: Keeping within the customer's budget by The TV Serviceman
  9. Feature: Remote Control by Bob Young
  10. Feature: The World Solar Challenge by Brian Woodward
  11. Project: Stereo Preamplifier With IR Remote Control; Pt.3 by John Clarke
  12. Project: Build A Siren Sound Generator by Bernie Gilchrist
  13. Order Form
  14. Feature: Computer Bits by Darren Yates
  15. Review: Epson's Stylus 800 InkJet Printer by Darren Yates
  16. Review: The Autoplex Unimeter by Darren Yates
  17. Vintage Radio: The vexed question of originality by John Hill
  18. Product Showcase
  19. Back Issues
  20. Market Centre
  21. Outer Back Cover

This is only a preview of the November 1993 issue of Silicon Chip.

You can view 33 of the 96 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Articles in this series:
  • Electronic Engine Management; Pt.1 (October 1993)
  • Electronic Engine Management; Pt.1 (October 1993)
  • Electronic Engine Management; Pt.2 (November 1993)
  • Electronic Engine Management; Pt.2 (November 1993)
  • Electronic Engine Management; Pt.3 (December 1993)
  • Electronic Engine Management; Pt.3 (December 1993)
  • Electronic Engine Management; Pt.4 (January 1994)
  • Electronic Engine Management; Pt.4 (January 1994)
  • Electronic Engine Management; Pt.5 (February 1994)
  • Electronic Engine Management; Pt.5 (February 1994)
  • Electronic Engine Management; Pt.6 (March 1994)
  • Electronic Engine Management; Pt.6 (March 1994)
  • Electronic Engine Management; Pt.7 (April 1994)
  • Electronic Engine Management; Pt.7 (April 1994)
  • Electronic Engine Management; Pt.8 (May 1994)
  • Electronic Engine Management; Pt.8 (May 1994)
  • Electronic Engine Management; Pt.9 (June 1994)
  • Electronic Engine Management; Pt.9 (June 1994)
  • Electronic Engine Management; Pt.10 (July 1994)
  • Electronic Engine Management; Pt.10 (July 1994)
  • Electronic Engine Management; Pt.11 (August 1994)
  • Electronic Engine Management; Pt.11 (August 1994)
  • Electronic Engine Management; Pt.12 (September 1994)
  • Electronic Engine Management; Pt.12 (September 1994)
  • Electronic Engine Management; Pt.13 (October 1994)
  • Electronic Engine Management; Pt.13 (October 1994)
Items relevant to "Build A Jumbo Digital Clock":
  • Jumbo Digital Clock PCB pattern (PDF download) [04108931] (Free)
Items relevant to "High Efficiency Inverter For Fluorescent Tubes":
  • 18/36W High-Efficiency Fluorescent Inverter PCB pattern (PDF download) [11312931] (Free)
Articles in this series:
  • Remote Control (October 1989)
  • Remote Control (October 1989)
  • Remote Control (November 1989)
  • Remote Control (November 1989)
  • Remote Control (December 1989)
  • Remote Control (December 1989)
  • Remote Control (January 1990)
  • Remote Control (January 1990)
  • Remote Control (February 1990)
  • Remote Control (February 1990)
  • Remote Control (March 1990)
  • Remote Control (March 1990)
  • Remote Control (April 1990)
  • Remote Control (April 1990)
  • Remote Control (May 1990)
  • Remote Control (May 1990)
  • Remote Control (June 1990)
  • Remote Control (June 1990)
  • Remote Control (August 1990)
  • Remote Control (August 1990)
  • Remote Control (September 1990)
  • Remote Control (September 1990)
  • Remote Control (October 1990)
  • Remote Control (October 1990)
  • Remote Control (November 1990)
  • Remote Control (November 1990)
  • Remote Control (December 1990)
  • Remote Control (December 1990)
  • Remote Control (April 1991)
  • Remote Control (April 1991)
  • Remote Control (July 1991)
  • Remote Control (July 1991)
  • Remote Control (August 1991)
  • Remote Control (August 1991)
  • Remote Control (October 1991)
  • Remote Control (October 1991)
  • Remote Control (April 1992)
  • Remote Control (April 1992)
  • Remote Control (April 1993)
  • Remote Control (April 1993)
  • Remote Control (November 1993)
  • Remote Control (November 1993)
  • Remote Control (December 1993)
  • Remote Control (December 1993)
  • Remote Control (January 1994)
  • Remote Control (January 1994)
  • Remote Control (June 1994)
  • Remote Control (June 1994)
  • Remote Control (January 1995)
  • Remote Control (January 1995)
  • Remote Control (April 1995)
  • Remote Control (April 1995)
  • Remote Control (May 1995)
  • Remote Control (May 1995)
  • Remote Control (July 1995)
  • Remote Control (July 1995)
  • Remote Control (November 1995)
  • Remote Control (November 1995)
  • Remote Control (December 1995)
  • Remote Control (December 1995)
Articles in this series:
  • Darwin To Adelaide On Solar Power (October 1993)
  • Darwin To Adelaide On Solar Power (October 1993)
  • The World Solar Challenge (November 1993)
  • The World Solar Challenge (November 1993)
  • The World Solar Challenge (January 1994)
  • The World Solar Challenge (January 1994)
Items relevant to "Stereo Preamplifier With IR Remote Control; Pt.3":
  • IR Remote Control Stereo Preamplifier PCB patterns (PDF download) [01308931/2] (Free)
Articles in this series:
  • Stereo Preamplifier With IR Remote Control; Pt.1 (September 1993)
  • Stereo Preamplifier With IR Remote Control; Pt.1 (September 1993)
  • Stereo Preamplifier With IR Remote Control; Pt.2 (October 1993)
  • Stereo Preamplifier With IR Remote Control; Pt.2 (October 1993)
  • Stereo Preamplifier With IR Remote Control; Pt.3 (November 1993)
  • Stereo Preamplifier With IR Remote Control; Pt.3 (November 1993)
Items relevant to "Computer Bits":
  • Games Card Breakout PCB [07103941] (PCB Pattern, Free)
  • DOS software for Computer Bits, November 1993 & January/February 1994 (Free)
Articles in this series:
  • Experiments For Your Games Card (January 1992)
  • Experiments For Your Games Card (January 1992)
  • Computer Bits (November 1993)
  • Computer Bits (November 1993)
  • Computer Bits (January 1994)
  • Computer Bits (January 1994)
  • Computer Bits (February 1994)
  • Computer Bits (February 1994)
  • Computer Bits (April 1994)
  • Computer Bits (April 1994)
COMPUTER BITS BY DARREN YATES More experiments for your games card Games cards are more than just entertainment adaptors – they can provide a simple interface between the outside world & your PC. In this article, we turn your games card into an 8-bit A/D converter using an op amp & a transistor. When we came out with the first “Experiments for Your Games Card” article in January 1992, we looked mainly at using the existing circuitry on the card to accept analog resistive devices such as light-dependent resistors (LDRs) and thermistors. Going back briefly to what we discussed, the games card essentially contains four 555 timers (in the one chip) which are connected up as monostables. The circuit in Fig.1 gives the general idea. The setting of the joystick provides the current which charges the .01µF capacitor. The computer then keeps a record of how long the monostable output is high, once it has been triggered, by incrementing an 8-bit register. Fig.2 shows the pin-outs of the DB15 joystick adaptor sock­et. As you can see, it allows up to four analog inputs (via the joytick controls) and four digital inputs (via the fire buttons). Also included are two +5V supply rail pins and a number of GND pins. Last time, we showed you how to connect an LDR or a ther­mistor into the card to measure light and temperature. This allowed us to measure analog signals “of sorts”. The reason we say this is that using this method, you can’t just apply an analog voltage directly onto the input and that all comes down to the fact that we have to charge up a capacitor in the 555 circuit on the card. Since a capacitor charges up linearly with current and not voltage, this 70  Silicon Chip makes it a bit difficult. Also, if the capacitor doesn’t rise above +3.3V (ie. 2/3Vcc), the 555 will never reach its threshold and switch off after it has been triggered. It is this turning off which tells the computer to stop counting. If we did feed a direct analog Fig.1: the input control circuitry for a typical games card. There are four such circuits to cover all the controls on a joystick. voltage into the joystick inputs, the circuit would not respond until the capacitor’s voltage rose above +3.3V. However, we can solve that with the simple circuit shown in Fig.3. Using one op amp and a transistor, we can turn the joy­stick input into a modest fractional 8-bit analog-to-digital converter or ADC. And since the joystick port comes with four analog inputs, this gives up to four channels. Putting it simply, the op amp and transistor form a vol­ tage-to-current converter which turns our analog input voltage into a current which then charges up the 555’s .01µF capacitor. VR1 adjusts the output current to obtain the best display. Notice that we are obtaining the 5V supply for the circuit from the games card (pin 1). The op amp used is an LM358 dual package so by using just another transistor, you can get a second chan­nel. By using BASIC’s STICK command, it’s a simple case of read­ing off the 8-bit number from that command to retrieve the digi­tal code produced by the games card. Low-frequency scope Fig.2: the pin connection details for the DB15 sockets on a games card. Putting this into practice, we wrote a small program to use the card as a low-frequency oscilloscope. Because QBasic is quite slow and the STICK command even slower, the upper frequency limit is only 10Hz. This is because QBasic can only take 40 readings from the joystick every second –even with a 40MHz 386DX. This necessitates the use of a 100µF capacitor on the input so that low-frequency signals are not reduced in amplitude. Be that as it may, the display in Fig.4 shows the results of the program. Even though 10Hz is a low frequency, the circuit is still useful because it can be used to measure long term changes in circuit voltages, PIN 1 to take a look at QBa­sic. Even though QBasic is 47k only an interpreter, it is a big improvement on GWBasic and it has an easy-toQ1 22k 8 2 BC558 use screen editor and no line numbering! 1 100 IC1a 16VW LM358 The STICK command 3 makes programming the 4 PIN 3 games card quite easy 68k PIN 4 and takes the work out of having to count up registers and examine inputs Fig.3: this simple circuit functions as a voltage to current converter & connects to one of the and all the nitty gritty. It joystick pot inputs. works as follows. When you want to take a reading for an all-up cost of about $2 in parts! of the joystick port, you have to use The maximum input signal is 400mV the STICK(0) statement. When the p-p for a sinewave and 200mV for a program implements STICK(0), it not square­wave. Any more than this and only records the x-input from the the joystick counter register gives first joystick, it also takes a record of erroneous results. all joystick inputs. The good thing With the components specified, about this is that if you decide to use there is a range of about 80 to 170 on all four inputs as ADCs, this system the 8-bit range. It still has 8-bit reso- won’t travel any slower. lution – but not over the full range of STICK(0) holds the x-input from 0 to 255. No, this isn’t eight bits but Joystick A, STICK(1) the y-input from it’s not bad for $2. joystick A, STICK(2) the x-input from joystick B and STICK(3) the y-value Programming from B, but you must use STICK(0) Since January 1992, DOS 4.01 and first. For example, let’s say we wanted DOS 5 have gone by the wayside and to take 640 samples from the last two we’ve moved into the era of DOS 6. joystick analog inputs; ie, the x and y This means that many machines will inputs from joystick 2 and store them have QBasic instead of GWBasic, al- in an array for future use. These correthough the following tips are equally spond to the commands STICK(2) and valid in both. However, if you’re still STICK(3). A simple BASIC routine is working with GWBasic, you may want as follows: VR1 10k Fig.4: this sample display of the output screen is for a 5Hz 100mV RMS sinewave input signal. The on-screen instructions tell you how to expand or compress the x & y axes (note: instructions not shown here for the y axis). DIM SAMPLE1(640),SAMPLE2(640) FOR NUMBER = 1 TO 640 TEST=STICK(0) SAMPLE1(NUMBER)=STICK(2) SAMPLE2(NUMBER)=STICK(3) NEXT NUMBER Note that we must first perform a STICK(0) command before we can get information from STICK(2) or STICK(3). By using DEFINT SAMPLE1, SAMPLE2, you can speed up the program by 5-10% since operation on a single-byte integer variable is faster than floating-point variables. To save these arrays as a file, you could use the following routine: OPEN [FILENAME.EXT] FOR OUTPUT AS #1 FOR NUMBER = 1 TO 640 PRINT#1,SAMPLE1(NUMBER) PRINT#1,SAMPLE2(NUMBER) NEXT NUMBER CLOSE #1 The data is then saved in the following format: SAMPLE1(1) SAMPLE2(1) SAMPLE1(2) SAMPLE2(2) SAMPLE1(3) and so on. By replacing the OUTPUT and PRINT statements with INPUT, you can retrieve this information out of the file, for use in another program. In fact, this is a very basic model of how audio signals can be retrieved from extremely noisy sign­ als using noise averaging techniques. The stored data is fed through an algorithm which manages to remove the noise component and retrieve the original signal. You may even want to try having a crack at it if you have the relevant information. The program CRO.BAS produced the diagram in Fig.4 and can be run from QBasic or, if you have access, on a BASIC compiler. This will speed things up to a degree, particularly if you use Turbo Basic from Borland. If push comes to shove, you could probably get it to work on GWBASIC provided you add in the line numbers. The listing is too long to include here but we can provide a copy of the file on disc, as well as a complied version called CRO.EXE. If you would like a copy, write to SILICON CHIP, PO Box 139, Collaroy, NSW 2097. The cost is $10 (incl. p&p) and payment can be made either via cheque on by quoting a credit card number. Please indicate whether you require a 5.25-inch or SC 3.5-inch disc. November 1993  71