Upload
danieltorni
View
58
Download
0
Embed Size (px)
Citation preview
TEST& MEASUREMENT
34 Elektor Electronics 10/2000
GBDSOGameboy Digital Sampling Oscilloscope (1)
Convert a Nintendo games console into a portable oscilloscope
By Steve Willis
The application of dedicatedgames consoles to more variedfunctions other than justplaying games is fraught withdifficulties. Not only do theconsoles contain highlyintegrated and custom-madecomponents, there will oftenbe no publicly availabledevelopment tools orapplications manuals. Howeverthe Nintendo Gameboy© isone such system which hasreceived considerableattention from the hobbydesigner and enjoys a largeselection of both technical andsoftware support through anetwork of websites.
entire screen of data is captured before it isdisplayed (standard mode). The number ofsamples captured per scan may be set toeither 240 or 600 points per channel, allowingthe visible screen window to be moved rela-tive to the initial trigger. Sampling of the twoinput channels occurs simultaneously, exceptfor the 10 and 5 µS/DIV ranges, when thechannels are sampled on alternate traces rel-ative to the trigger (alternate mode). CHAmay also be saved as an on-screen reference,thus allowing a total of three traces to be dis-played at once.
Gateway: the ROM cartridge interfaceAll the signals required for the oscilloscopeare available on the external ROM cartridgeslot, so no modifications need be made to theGB console itself.
The oscilloscope cartridge plugs into acustom 32-pin card edge connector on theunderside of the GB and interfaces directly to
The attraction of using a mass pro-duced console soon becomes clearwhen the time and cost involved inproducing a general purpose portableinstrument with processor, LCD dis-play and user interface, not to men-tion the moulded case, sound systemand serial port, are considered.
The Gameboy OscilloscopeThe GameBoy ‘GB’ digital samplingoscilloscope ‘GBDSO’ converts aGBpocket or GBcolour into a multi-purpose test instrument whichshould prove invaluable to the hobbydesigner. Design of GBDSO posedmany contrasting requirements: highspeed, low power, low cost, smallsize and versatility. In order to sim-plify the hardware as much as pos-sible, real-time software is used toperform the majority of control func-tions e.g., triggering and variable-rate sampling. Once captured, thesampled data is displayed using astandard oscilloscope 10 by 8 screenformat that is designed to maximisescreen use. A simple four-positionmenuing system (one for each key)in combination with the joypad pro-vides easy setting of the standardscope functions.
A number of advanced optionsare also possible for the more expe-rienced user, these include FFTanalysis, XY mode, averaging andreference storage. A serial data linkallows the displayed screen or tracedata values to be transferred to a PCcomputer via the computer’s printer
port. The PC software is MS Win-dows 95 compatible.
The oscilloscope has two inputchannels CHA/B, with independentsoftware-controlled variable-gainamplifiers. The inputs have a 1-MΩinput impedance so they can be con-nected directly to 1:1 or 10:1 scopeprobes or to an audio jack lead. (lim-itations on size made BNC type con-nectors impractical). The amplifierscan be AC or DC coupled by meansof a switch. The variable-gain ampli-fiers give an input sensitivity of50 mV to 10 V per division with 10:1probes and an input bandwidth ofDC to 100 kHz.
The displayed trace has twomodes of operation. For low frequen-cies (100 s to 100 ms/DIV), a chartrecorder style of display is producedwith the trace scrolling across fromthe right hand side. For high fre-quencies (50 ms to 5 µs/DIV), an
TEST& MEASUREMENT
3510/2000 Elektor Electronics
Key Features:Dual trace displaySampling Rate: DC to 1 MspsTime Base: 100 s to 5 µs/DivInputs: AC/DC 1 MegOhmInput gain: 50 mV to 10 V/DivLine or chart recorder trace
modesReal-time FFT mode with dB scaleVariable persistence XY modePC link for screen or data transfer5 hrs operation from NiMH bat-
teriesAveraging and Auto trigger func-
tionsReference trace storage
FFT — the basicsThe following details the specific implementation of the GBDSO FFT for those requiring agreater explanation of its operation. Initially, the input data is sampled using the standardscope capture programs. The data is then passed through a Hamming window to reduceartefacts caused by the finite sample points (rectangular window). A Hamming window waschosen as it gives a good compromise between main lobe and side lobe widths. The win-dowed data is recorded using a bit-reversal algorithm to suit the decimation in time (DIT)process of the FFT. The data is then processed by a discrete Fourier transform (DFT),which is implemented using a 256-point radix-2 fast Fourier transform (FFT).16-bit arithmetic is used for the majority of the calculations, but since the GB has no multi-ply instruction this has to be calculated longhand by assembler software. The complex realand imaginary values of the DFT are combined to produce 128 x 32 bit values.Finally, a logarithm is taken (1 bit = 6 dB) and the data is displayed on the screen. The entireprocesses (excluding sampling) takes 0.8 seconds of which the FFT accounts for 90% of thetime requiring 4096 signed 16-bit multiplications and 6144 signed 16-bit additions.
Figure 1. Gameboy card edge connector (end view of ROM cartridge).
1
+5V
32
990082 - 11
ECLKWR
A0 - A15 D0 - D7
RDRAM_CS
GNDAUDIO INRESET
GAME BOY
top view
the data and address busses of the GB Z80 (-like) main processor. The pin functions of thecard edge connector are shown in Figure 1.
Circuit diagram
As you can see from the circuit diagram inFigure 2, the GBDSO cartridge, despite itsrather complex function, contains a relativelysmall number of integrated circuits.
The GB is controlled by an 8-bit Z80-likeprocessor that gives a direct addressingrange of 64 kB. However internal devices e.g.,LCD, RAM, sound etc. use most of the top32 KB leaving 0000-7FFF available for exter-nal ROM and A000-BFFF for external RAM.The GBDSO program is stored in a low power27C256 32 kB EPROM, IC7, occupying lowermemory at 0000 to 7FFF which is executedupon power-on. The ADC and input gain con-trol chips occupy a single memory location atA000.
Address decoding consists of a74HC138 1-of-8 decoder, IC6, thatdecodes the address range down toA000-BFFF and provides two enablesignals: 1. A000./RD at pin 9 accesses theADC and reads CHA/B 8-bit datavalue while reinitialising the ADC forthe next sample.2. A000./WR at pin 10 accesses the74HC175 quad latch and writes datato the DS1267 gain control circuit, orselects the input sampling channelof the ADC.
The DS1267 from Dallas Semicon-ductor is a dual channel 10-kΩ digi-tal gain control potentiometer with256 wiper positions per channel.Data is transferred to the devicethrough a serial interface via the74HC175 latch, this updates both pot
values simultaneously. Onceupdated, the values are held untilthe next update or the power isremoved. A condensed datasheet ofthis interesting IC may be foundelsewhere in this issue.
The GBDSO analogue circuitryrequires ±5 V to operate, so aninverting capacitive charge pumpcircuit is used to provide the nega-tive supply. The device used for thisis a MAX828EUK (IC9) which has aninternal oscillator that operates at12 kHz. This allows relatively smallcapacitors to be used for smoothing.However, to prevent any high fre-quency noise being passed to thesensitive input amplifiers, additionalLC filters are used.
As already mentioned, the CHA/Binput amplifiers are designed to becompatible with 1:1 or 10:1 (0 or
TEST& MEASUREMENT
36 Elektor Electronics 10/2000
AUDIO _IN
RAM_CS
RESET
ECLK
+5V
K3
A10
A11
A12
A13
A14
A15
GND
WR
RD
A0
A1
A2
A310 A411 A512 A613 A714 A815 A916
17
18
19
20
21
22 D023 D124 D225 D326 D427 D528 D629 D730
31
32
1
2
3
4
5
6
7
8
9
74HC138DIC6
10
11
12
13
14
15DX
1
2
3
4
5
67
9&
0
1
2
3
4
5
6
7
0
2
G07
74HC175D
IC5
1314
15
11
1012
C1
1D
1
9
4
6
7
3
2
5
RC9
100n
C8
100n
C7
220p
C16
220p
6
5
7IC1b
6
5
7IC3b
R5
470k
1%
C3
1p8
C2
100n
C1
18p
R2
1M
1%
R3
4k
7
R1
1M
S1
R4
1M
D1
BAV199
100k
P1
K1
1%
CH B
5V 5VA
2V5 2V5
2
3
1IC3a
R12
470k
1%
C13
1p8
C11
100n
C1
18p
R9
1M
1%
R10
4k
7
R8
1M
S2
R11
1M
D2
BAV199
100k
P2
K2
1%
5V 5VA
2V5 2V5
R13
4k7
1%
R14
4k
7
1%
2
3
1IC1a
R6
4k7
1%
R7
4k
7
1%
C5
15p
C15
15p
C17
100n
D1
D0
D1
D2
D3
D4
D5
D6
D7
D0
D1
D2
D3
D4
D5
D6
D7
D4
D6
C18
100n
27C256
EPROM
IC7
PLCC
A10
A11
A12
VPP
A13
A14
25
11A0
A1
A2
A3
A4
A5
A6
A729
A828
A924
27
16
OE
23
CS
32
13D0
14D1
15D2
18D3
19D4
20D5
21D6
22D7
30
31
10
9
8
7
6
5
4
3
2
A13
A14
D0
D1
D2
D3
D4
D5
D6
D7
A0
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
A11
A12
A13
A14
A15
A15
A0
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
A11
A12
A13
A14
A15
MAX828
IC9
EUK
C– C+
4
2 1
3 5
C22
10µ6V
C25
10µ6V
C26
10µ6V
C28
10µ6V
C31
10µ6V
C33
10µ6V
C24
10µ6V
C23
100n
L1
100µH
IC5
16
8
IC6
16
8
L2
100µH
L3
100µH
C29
100n
C30
100n
6
5
7IC8b
R16
100k
1%
R17
100k
1%
C19
100n
R15
15
k
D3
ZR25D01
C20
100n
2
3
1IC8a
C21
100n
IC14
8
C4
100n
C5
100n
C12
100n
C14
100n
IC34
8
2V5
2V5
5VA
5V
2V5
2V5
CH A
CW
CW
5V
5VA
5VC
5VC
5VA
5V
5V
5V
5VA
5VC
5V5V5V
WR
ECLK
RD
RD
1V25
1V25
0V
0V
IC1 = MC33182D
IC3 = MC33182D
D7
D5
2V5
MAX114
IC4
MODE
REF+
REF–
INT
CAG
IN4
IN3
IN2
IN1
D0
24
12
D1
D2
D3
D417
D518
D619
D720
11
A022
A121
14
13
PD23
RD10
WR15
CS16
6
5
7
8
9
1
2
3
4
D1
DS1267S100
RESET
IC2
COUT
SOUT
CLK
H0
W0
16 13
12L0
11
W1
H1 L1
10
14DQ
VB
NC
NC15
8 5
3 4
6
9
1
2
7
C27
100n
8
4
IC8 = TLC27L2CD
990082 - 12
Figure 2. Circuit diagram of the GBDSO cartridge. Stop playing games — turn the Nintendo Gameboy into a sampling oscilloscope witha large clear display!
e.g., joypad, screen and sound generator. Formore information on software developmenthave a look through the list of referenceswhich will be given at the end of nextmonth’s concluding instalment.
User interface
On power up the GB starts to execute theGBDSO interface program that resides inexternal EPROM. The program initially dis-plays an intro screen and a set of four prede-fined start options which initialise the scopesettings: Single/Dual/Logic/AC. The scope isnow ready for use. Figure 3 shows a typicaldisplay screen with both channels enabled,
9 MΩ) probes, each input amplifierhaving a relatively high input imped-ance of 1 MΩ. This is achieved byfeeding the signal via a 1-MΩ resis-tor (R1; R8) into the negative input ofa CMOS opamp (IC1b/IC3a) typeMC33182D. This device is marked bylow power, high slew rate and JFETinputs. By utilising the negativeinput of the amplifier, the signal isfed to a virtual ground, reducingbandwidth limitations imposed bystray capacitance on the inputs.Input protection is provided byD1/D2, which are type BAV199 duallow-leakage diodes. The negativeinput also forms a current summingjunction for the DC zero preset(P1/P2) which is adjusted to reduceDC errors at high gain settings.
The variable-gain amplifier sec-tion consists of IC1a/IC3b and theelectronic potentiometer inside theDS1267. The amplifier is configuredas an inverting amplifier with thepotentiometer forming the input andfeedback resistors (wiper is W0). Bychanging the wiper position throughsoftware, the gain of the amplifiercan be varied between 0.004 and255, considerably reducing theamount of input circuitry requiredand eliminating the need formechanical switches.
Interfacing to the 8-bit ADC typeMAX114 from Maxim (IC4) requiresan input signal in the range 0-2.5 V.To achieve a stable reference voltagewith varying supply, a 2.5-Vbandgap diode type ZR25D01 isused. DC biasing of the CHA/Bamplified signal to match the ADCinput is achieved with two 4k7 resis-tors which transform the ±2.5-Vamplifier signal into 0-2.5 V for theADC. The MAX114 is identified byMaxim as a ‘1-Msps, 4 &8-Channel,8-bit ADC with 1-µA Power-Down’.The device is good for a conversiontime of 680 ns per channel, and fea-tures internal track/hold circuitrythat does not require an externalclock.
Finally, the power supply is rigor-ously decoupled to prevent high-fre-quency noise affecting the operationof the sensitive input circuitry. Acombination of electrolytic capaci-tors and smaller solid ones of 0.1 µF,plus two 100-µH chokes areemployed to keep supply-bornenoise to a minimum.
Gameboy softwareThe GBDSO software that resides inthe EPROM on the cartridge boardwas written in a mixture of assem-bler language and ‘C’, with assem-bler used for the real time dataacquisition and display and ‘C’ pro-vides the user interface. The ‘C’ com-piler used was GBDK V. 2.17, whichis a public domain program writtenby Pascal Felber and Michael Hope5.GBDK is an excellent means ofquickly developing dedicated soft-ware for the Gameboy, as it containsmany predefined functions for inter-facing to dedicated GB hardware
TEST& MEASUREMENT
3710/2000 Elektor Electronics
Figure 3. Typical view from dual trace screen.
Table 1. Key Function Menu
Highlighted Function Key
Joypad SELECT-‘TRIG’ START- ‘Timebase’ B - ‘CHB’ A - ‘CHA’
UP Trigger level Screen window Y Position Y Position Down Position
Right Trigger mode1 Timebase scale2 Input gain Input gain Left Scale3 scale3
Notes.1. Trigger modes for CHA are Auto, Auto, Normal, Normal.
Auto trigger — produces a trace if a trigger has not occurred within a set timeNormal trigger — holds the trace until a trigger occurs
2. Timebase scale range is 500,200,100,50S etc. up to 5 µS/DIV.3. Gain scale range is 10,5,2,1V,500,200,100,50 mV/DIV,GND,OFF
990082 - 13
Standard menusBy pressing A/B/Start/Select, the appropriatefunction will be highlighted on the bottomline of the scope (note CHA is highlighted).Once a function is highlighted, the joypadcontrol can be used to adjust the values asso-ciated with that function, as shown inTable 1.
Advanced menusThe function key menu provides a quickmeans of changing the standard scope set-tings with as few key presses as possible.However, if the highlighted function key ispressed a second time then an advancedmenu will be displayed. The advanced menuoptions may be found in Table 2.
Each advanced menu has three optionsand an exit. When an option is selected withthe function key it will be enabled immedi-ately and the screen will return to normaloperation. Some options switch between oneof two modes e.g., average on/off. The normalscreen will display which of the two modesis currently selected. The following sectiondescribes in greater detail the operation ofeach option.
‘A’ Advanced menu600/240pt, selects the number of points sam-pled each trace scan. By moving the screenwindow position with the ‘timebase + ↑↓’menu, it is possible to scroll through up tothree screens of data in 600pt mode. The cur-rent window position and size are shown inthe top right corner of the screen. The defaultmode is 240 points as this gives the fastestscreen update rate. In FFT mode this is fixedat 240 points.
Auto Trigger calculates the average value ofCHA relative to the current timebase setting,the trigger is set to this value.
Average, averages CHA (and CHB if enabled)using previous trace scans. The average iscalculated from X=X+(Xnew–X)/8. This canbe useful for removing uncorrelated noisefrom a trace, so the required signal can bemeasured.
‘START’ advanced menuCHA⇒REF, Stores the current trace of CHAto the reference channel and displays itallowing up to three traces on the screen atonce. Selecting this menu again will clear thereference. The letter R will appear in the left-hand column indicating a reference trace.
SCREEN⇒PC, The current scope screen willbe transferred to the PC computer via the linklead. When the start of transfer has been
acknowledged, the GB will beep andthe progress indicator will change onthe PC. At the end of transfer the GBwill beep again. The screen will beconverted to a black and white160x144 .BMP format by the PC andcan be saved to disk.
DATA⇒PC, The current data values(not screen) of CHA and CHB will betransferred to the PC computer in asimilar method to that above. Datacan be saved to disk as raw data orin MathCad 6.0 format for import-ing back into the computer for analy-sis. See the section on the PC Link
Interface (part 2) for more details.‘SELECT’ advanced menuFFT, changes scope operation to FFTmode. FFT mode produces a spec-trum analysis of the sampled data,where the horizontal axis representsfrequency and the vertical axis rep-resents amplitude in dB (10 dB/DIV).See the FFT section for more infor-mation on the FFT mode.
XY, changes the scope operation toXY mode with the horizontal tracedeflection set by CHA and the verti-cal deflection set by CHB. The tracepersistence (how long each point is
TEST& MEASUREMENT
38 Elektor Electronics 10/2000
Table 2. Advanced Menu Screens
Function Key Advanced menu screens
Select
Start
B Not used
A
10k
100nCHA CHB
500Hz6Vpk-pk
Time to XY
990082 - 14
Figure 4. RC network and XY mode.
Time to FFT
990082 - 15
Figure 5. FFT of 1 kHz 0 dB sinewave.
down. By comparison, the 1-kHz square waveof Figure 6 contains a fundamental and oddharmonics at 3, 5, 7 kHz, etc. which reduce inamplitude as the frequency increases.
Closer observation of Figure 5 shows aspurious spectral peak at 3 kHz which is30 dB down on the fundamental, this is in factproduced by the signal generator and repre-sents distortion of the pure sine wave. Thetime response gives no indications of thisproblem and it is clear that without the FFTmode this imperfection would not be mea-surable but it could cause problems whenanalysing circuits.
Using the FFT mode can often give unex-pected results and some experimentation andexperience is required to obtain meaningfulresults. Here are some points to consider.
Make full use of the 8bit samples, if possibleadjust the signal amplitude or referencemarker so that the input signal is at its max-imum i.e.: the highest peak is just below thereference marker. The Reference Markerrange is 35, 30, 20, 15, 10, 0, –5, –10 dB, GND.Do not increase the signal above this point asthis will saturate the scope amplifiers andintroduce spurious harmonics.
If a signal contains a wide spectrum of fre-quencies, often the frequency componentsthat extend beyond the FFT will be reflectedback so that they become visible again,which can be misleading. By increasing thetimebase frequency you can reduce thiseffect. The Timebase scale range is 10, 25,50 Hz etc., up to 100 kHz/DIV.
To lower the noise floor, use the averagingmode.
Measuring small signals with a large fun-damental, is possible if you use a notch filtercircuit (e.g., twin-T) to remove the fundamen-tal component before the signal is applied tothe scope. This effectively increases thescope’s dynamic range.
(990082-1)
Next month we continue with the PC LinkInterface, the construction of he cartridge,testing and calibrating the instrument.
displayed) can be set to 100 ms, 1 s,10 s, 100 s or OFF (infinite). The max-imum number of points plotted onthe screen at any time is 600. See theXY section for more information onthe XY mode.
TIME, changes the scope operationto normal scope mode with the hori-zontal axis representing Time afteran initial trigger point and the verti-cal axis representing amplitude inVolts.
XY Mode
The XY mode allows the horizontaland vertical deflection to be con-trolled by CHA and CHB respec-tively. This can be used to displayhow one circuit parameter is chang-ing with respect to another.
A simple RC network demon-strates how phase shift is introducedinto a circuit by the capacitive com-ponent, see Figure 4. The inputsinewave moves the trace horizon-tally and the ‘phase advanced’ out-put from the RC network moves thetrace vertically resulting in a circularimage. Changing the frequency andwaveform type gives some interest-ing effects.
In XY mode the trace persistence(how long each point is displayed)can be set from the timebase to100 ms, 1 s, 10 s, 100 s or OFF (infi-nite). When the persistence is set toOFF, the points plotted on the screenremain visible until the screen iscleared by pressing one of the func-tion keys. When the persistence isset to one of the time values, a max-imum of 600 points can be displayedat a time and they will remain visiblefor length of time defined by thetimebase setting. Therefore, the 100-ms setting is used to measure fastchanges and the 100-s setting for
measuring slow changes.
FFT Mode
Normally, signals are considered asvarying in amplitude with time andare therefore measured as a functionof voltage versus time. However, allcontinuous signals can be con-structed from a fundamental andharmonically related (Fourier) com-ponents which are best representedlogarithmically as magnitude (dB)versus frequency (Hz). This is morecommonly known as a spectralanalysis and is often used in audiosystems to measure the performanceof an amplifier, or the purity of a sig-nal. The GBDSO computes the spec-tral analysis using an algorithmknown as the fast Fourier transformor FFT which is a mathematicallyintensive method, normally associ-ated with high speed digital signalprocessors – DSPs. Nevertheless, bycoding the algorithm entirely inassembly language and optimisingits performance, the FFT is per-formed in just 0.8 seconds.
A full discussion on frequencyanalysis is beyond the scope of thisarticle, but by considering a fewexamples it will soon become clearhow useful the FFT mode is and inwhat circumstances it should beused. Figure 5 shows a 1-kHz sinewave of amplitude 0 dBVrms or1.414 Vpk (0 dB = 20log(1V rms),rms=pk x 0.707). The vertical scaleis fixed at 10 dB/DIV and the refer-ence marker (represented by a dot-ted line near the top of the screen) isdetermined by the ACH gain settingin dB. Since the sine wave containsonly one frequency component (thefundamental), the frequency spec-trum shows a single peak at 1 kHz.With the reference marker set to0 dB, the noise floor is about –45dB
TEST& MEASUREMENT
3910/2000 Elektor Electronics
Time to FFT
990082 - 16
Figure 6. FFT of 1 kHz 0 dB squarewave.
WarningWhen using 10:1 probes, the maximum inputvoltage applied to GBDSO must not exceed±50 V; with 1:1 probes the maximum inputmust not exceed ±16 V. Under no circum-stances should 230/110 V mains voltages beapplied to the GBDSO.
GBDSOGameboy Digital Sampling Oscilloscope (2)
The PC Link InterfaceData may be transferred from the GB to astandard PC computer via a link lead, whichconnects the GB link port to the PC printerport. The associated software utility to run onthe PC is called ‘DSOGrab’ and may beobtained on floppy disk (see Software Itemsinset). The GB link port is in fact a serial dataport but unfortunately the data format is non-standard and therefore has to be read as adata stream by the PC and converted backinto byte format. The connections of the GBlink port are shown in Figure 7.
All outputs and inputs to the GB link portare TTL compatible and can be connecteddirectly to the PC printer port. Extra care
must be taken when wiring the linklead to make sure all the connectionsare correct as errors could cause per-manent damage to the GB or PCports. The loop-back connectionbetween pins 4 and 11 is used totest if the software can see the con-nector and is used for fault diag-noses.
The GB link port contains an 8-bitshift register, which contains thecurrent data byte to be sent or read.Clocking of this register can be doneexternally by pin 3 of the printerport. Initial synchronisation betweenthe GB and PC is achieved when the
PC reads an initiation byte from theserial port via pin 10. The PC willthen write back to the GB via pin 2and serial transfer commences. Twomodes of transfer are possible:
Screen transfer where the entirescreen is sent to the PC and savedin a .BMP format.
Data transfer where the actual datavalues of CHA/B are sent to thePC.
The raw data format is as follows:
600 bytes of CHA data, 600 bytes ofCHB data.CHA position, CHB position, CHAgain, CHB gain, TIMEBASE setting(1 byte each).
The CHA/B data values are theactual screen points and have arange between 7 and 127. TheCHA/B position bytes are where thetrace zero reference markers are onthe screen, again between 7 and127. The CHA/B gain values arebetween 0 and 9, with 0=OFF and9=10V (see ‘Standard Menus’). InFFT mode 0=OFF and 9=35dB (see‘Getting the most out of the FFT’).The TIMEBASE setting is between 2and 26, with 2=5uS and 26=500S(see ‘Standard Menus’). In FFT mode2=100KHz and 12(max)=10Hz (see‘Getting the most out of the FFT’).
When data is saved as MathCad6.0 format, data and position valuesrange between 0 and 127. The GAIN
TEST&MEASUREMENT
12 Elektor Electronics 11/2000
Part 2: PC link, DSOGrab, construction and testing
Design by Steve Willis
and TIMEBASE values are converted to float-ing point values representing the actual scalesettings. A MathCad demonstration file isincluded in the Windows 95/98 link softwaredisk supplied for this project.
Assembly
Assembly will require a very steady hand andsome practice if you have never soldered sur-face mount assembly (SMA) componentsbefore. Soldering will require a fine tip ironwith a 1-mm tip, 26-gauge low melting pointsolder or solder paste and pair of fine tweez-ers. A solder wick is useful for removingexcess solder, but do not use a solder suckeras this will probably break the PCB tracks.There are two methods of building the circuit,if you are competent at SMA handling thenyou skip the step by step approach below.
The following steps allow each semiconductorto be soldered and tested in turn to check for
TEST&MEASUREMENT
1311/2000 Elektor Electronics
Figure 7. GB to PC link lead (view shows front of plugs).
Figure 8. PCB design for the double-sided through-plated cartridge board.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
PC CentronicsD25 plug
Game Boylink lead plug
990082 - 17
DATA
GND
GND
DATA
CLOCK
front view
C1
C2C3
C4
C5
C6
C7
C8 C9
C10
C11
C12
C13 C14
C15
C16
C17
C18
C19
C20
C21
C22
C23
C24
C25
C26
C27
C28
C29
C30
C31
C33
D1
D2
D3
IC1
IC2
IC3
IC4
IC5
IC6
IC7
IC8 IC9
K1K2
K3
L1
L2
L3
P1
P2
R1
R2
R3
R4
R5
R6 R7
R8
R9
R10
R11
R12
R13 R14
R15
R16
R17
S1S2
(C) ELEKTOR
990082-1
COMPONENTS LIST
All components SMA (surfacemount assembly)
Resistors:SMD case 0805, 0.1 wattR1,R2,R4,R8,R9,R11 = 1MΩ 1%R15 = 15kΩR5,R12 = 470kΩ 1%R3,R6,R7,R10,R13,R14 = 4kΩ7
1%R16,R17 = 100kΩ 1%P1,P2 = 100kΩ preset
Capacitors:SMD case 0805C1,C10 = 18pF NP0
C2,C4,C5,C8,C9,C11,C12,C14,C17-C21,C23,C27,C29,C30 = 100nF
C3,C13 = 1pF8 NP0C6,C15 = 15pF NP0C7,C16 = 220pF NP0
Electrolytic capacitorsSMD Case AC22,C24,C25,C26,C28,C31,C33 =
10µF 16V
Inductors:L1,L2,L3 = 100µH
Semiconductors:D1,D2 = BAV199 (print on case: JY)D3 = ZR25D01 (print on case: 25R)IC1,IC3 = MC33182D (Motorola)
IC2 = DS1267S100 (Dallas Semiconductor)IC4 = MAX114CAG (Maxim)IC5 = 74HC175DIC6 = 74HC138DIC7 = AT27C256R-12JC in PLCC44 case
(programmed, Publishers’ order code 996528-1) (Atmel)
IC8 = TLC27L2CDIC9 = MAX828EUK (print on case: AABI)
(Maxim)
Miscellaneous:S1,S2 = ‘’Secme’ slide switch, 1 changeover
contact, PCB mountK1,K2 = 3.5mm PCB mount stereo socket
(make sure it fits the board)PCB, Publishers’ order code 990082-1Disk, Publishers’ order code 996035-1
short circuits during assembly.1. Disassemble the plastic ROM case (see
below) and place the PCB in the bottom.Carefully plug it into the GB. Switch onand check the black scrolling start screenappears. If not, there is a short on one ofthe GB interface tracks.
2. Solder the EPROM onto the PCB taking theusual static precautions. A good tip is tosolder just two corner pins first and getthe device aligned before soldering therest of the pins. Place the PCB back intothe case and switch on. The GBDSO introscreen should now appear and all thescope menus should work. If not, check forshorts.
3. Now solder the MAX114 ADC and74HC138 and check that the unit stillstarts.
4. Finally solder the 74HC175 and DS1267EPOT devices and capacitors C17, C30.Check the unit still starts. If not, check forshorts.
Start with the resistors and small capacitors,taking care not to short any tracks or touchthe edge connector with solder. Some tracksrun under components, and care should betaken not to short out these tracks. The
inductors and tantalum capacitorsare next, followed by the semicon-ductors. Note that the tantalumcapacitors and semiconductors mustbe soldered the correct way around.Static precautions must be takenwhen soldering the sensitive inputamplifiers IC1 and IC3. Finally, sol-der the jack sockets and AC/DCswitches. It is advisable to cut thesocket leads flush to the boardbefore soldering and then gentlyfile/sand the joints to be flat to thePCB.
The ROM cartridge is a standard
case, which can be obtained from anold game. It is held together withone tamperproof screw that can beundone with a pair of fine nose pliersor cutters if the correct tool is notavailable. It is necessary to cut andfile out the back of the bottom plas-tic case to accommodate the jackand AC/DC switches at the rear ofthe ROM cartridge — see Figure 9and the photographs. The PCBshould now fit snugly into the bot-tom of the case. Finally, the top casesection must be cut to give enoughclearance for the jack sockets. It is
TEST&MEASUREMENT
14 Elektor Electronics 11/2000
990082- 19aCut Out
Plastic Strip
990082- 19b
Bottom View Top View
CHA DC:AC CHB DC:AC
Digital Sampling
Oscilloscope
Figure 9. ROM case cut outs, and home mademetal film.
Figure 10. Calibrating the 50 mV/DIV range on CHA and CHB
Figure 11. Completed cartridge board, ready for inserting into the Gameboyconsole.
990082 - 18
Did you knowthat all hyperlinks printed in this maga-zine are directly accessible through theHyperlinks page of our website athttp://www.elektor-electronics.co.uk ?No need to type urls anymore, plus we’lldo our best to keep track of websitesmoved since publishing the magazine.
7. Dr Pan’s Gameboy technical documentation:www.gbdev.org/news/dl.html
8. Paul Robson’s GB97 emulator:http://users.aol.com/autismuk/gameboy.htm
urls available as hyperlinks on the Hyperlinks pageof the Elektor Electronics website.
advisable to stick a thin sheet ofplastic (1×17×55mm) along the top ofthe cartridge for strengthening. Toimprove the GBDSO performancewhen measuring small signals, athin sheet of metal (copper or alu-minium) is bent around the case andstuck with double-sided tape. This isgrounded by the jack plug nuts. Thisreduces interference caused by theLCD controller that can be picked upby the high impedance input ampli-fiers.
Test and calibration
To test the scope, switch on with noinputs applied and select dual-chan-nel AC from the start screen. Set theAC/DC switches to DC (right), andboth traces should appear in linewith their respective A/B marker onthe left-hand side. If not, adjust theDC zero level of the input amplifierswith the presets P1/2 so the tracesare correctly aligned. If the traces arestill not visible, check the DC volt-ages around the input amplifiers andADC and compare these with the cir-cuit diagram. Next increase the inputsensitivity to 50 mV/DIV and adjustthe presets again to finely calibratethe DC levels as shown in Figure 10.Set the sensitivity back to 1 V/DIVand apply a 1 kHz 1 Vpk sine wave tothe either input channel and checkthat each trace responds to the sig-nal. Next, apply a DC voltage to theinputs (e.g., 5 V regulator) and checkthe Y scale calibration. If you switch
the inputs to AC then the tracesshould return to their zero position.
Scope probes
For normal operation, conventionalscope probes with a 1:1 or 10:1switch give ideal performance andextend the input voltage range by afactor of ten. The screen scale is cal-ibrated for 10:1 probes (9 MΩ resis-tance) and one should remember tomultiply the scale by a factor of tenwhen using 1:1 probes (0 MΩ resis-tance). Most commercial probescome with a BNC plug attached,which should be replaced with amono 3.5-mm jack plug to connect toGBDSO. Care must be taken whenselecting the probe to ensure thatthe compensation network is in theprobe end and not the BNC connec-tor. Often, soldering the inner wire isdifficult and plated wire should becleaned first.
(990082-1)
References:1. Digital signal Processing – Ifeachor
Jervis, ISBN 0-201-54413-X2. Z80 Assembly Language Program-
ming – L.A. Leventhal, ISBN 0-931988-21-7
3. Author’s Gameboy web page: www-ev.phy.cam.ac.uk
4. Jeff Frohwein’s Technical Page:www.devrs.com/gb/
5. Pascal Felber and Michael Hope’sGBDK: http://gbdk.sourceforge.net/
6. Ian James GBDS: www.geocities.com/Eureka/9827/
TEST&MEASUREMENT
1511/2000 Elektor Electronics
Figure 12. Rear view of Gameboy console with GBDSO cartridge removed (left) and installed (right).
Project SoftwareThe following software items may beobtained through the Elektor ElectronicsReaders Services:
EPROM AT27C256, ready-programmed,order code 996528-1.Disk, contains DSOGrab utility and MathCaddemonstration file, order code 996035-1.
Please note:these software items are not available asfree downloads from our website becausethe author retains the copyrights. Also, bycontract he receives royalty payments forevery copy sold of the project EPROM(996528-1) and disk (996035-1).
Ready-BuiltGBDSO CartridgeBoardsPlease check our website http://www.elek-tor-electronics.co.uk for a readership polland other information on ready-madeGBDSO cartridge boards with all SMA partssoldered in place.