0% found this document useful (0 votes)
82 views5 pages

Pic Graphics L.C.D. Scope: Ccoonnssttrruuccttiioonnaall Pprroojjeecctt

This document describes a new PIC microcontroller-based oscilloscope design called the G-Scope. The G-Scope uses a graphics LCD to display waveforms with higher resolution than previous designs. It can monitor audio frequency signals between 1 Hz to 15 kHz, displaying the frequency and amplitude. The circuit is similar to the previous M-Scope design but uses a graphics LCD requiring a negative voltage for contrast control. The PIC microcontroller samples the input signal and drives the LCD display. The G-Scope provides a self-contained tool for visually analyzing audio frequency signals.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views5 pages

Pic Graphics L.C.D. Scope: Ccoonnssttrruuccttiioonnaall Pprroojjeecctt

This document describes a new PIC microcontroller-based oscilloscope design called the G-Scope. The G-Scope uses a graphics LCD to display waveforms with higher resolution than previous designs. It can monitor audio frequency signals between 1 Hz to 15 kHz, displaying the frequency and amplitude. The circuit is similar to the previous M-Scope design but uses a graphics LCD requiring a negative voltage for contrast control. The PIC microcontroller samples the input signal and drives the LCD display. The G-Scope provides a self-contained tool for visually analyzing audio frequency signals.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Constructional Project

PIC GRAPHICS
L.C.D. SCOPE
JOHN BECKER
Like M-Scope, it also displays frequen-
Long awaited, a PIC and graphics l.c.d. cy and signal amplitude factors as alphanu-
design for monitoring audio frequency meric text lines.
G-Scope also provides sync (waveform
signals has arrived! synchronisation stability) on/off selection,
frequency/voltage monitoring on/off and a
choice of three sampling rates. The lowest
February ’01 issue of EPE con- The EPE Virtual Scope (V-Scope) of

O
UR sampling rate allows sub-Hertz signals to
tained a supplement in which the Jan-Feb ’98 was the most sophisticated of be slowly traced on screen while they
author’s researches into Using this family, interfacing a complex dual- occur.
Graphics L.C.D.s were published. In this channel hardware unit to a PC-compatible The signal source can be a.c. or d.c. and
demonstration (nay, semi-tutorial) article, computer, with a frequency maximum in waveforms up to 5V peak-to-peak can be
various programming routines were illus- excess of 10MHz. input without external attenuation. A simple
trated in conjunction with a specially Micro-PICscope (M-Scope) followed in pre-amp stage can be switched to provide ×1
designed printed circuit board. April ’00, in which a stand-alone unit used or ×10 amplification. The circuit does not
Demos 11 and 12, many of you will an ordinary alphanumerics l.c.d. to display permit negative d.c. voltages to be input.
recall, showed the results of experiments single waveforms on eight of its character
with creating waveform displays on the cells. It was intended principally as a visu- CIRCUIT DETAILS
screen. As the text said, these were created al signal tracer, catering for frequencies in The G-Scope circuit diagram in Fig.1 is
preparatory to designing the PIC Graphics the audio range, up to around 15kHz or so. closely similar to that for M-Scope. One
L.C.D. Scope (G-Scope) described here. October ’00 saw the publishing of the principal difference is the l.c.d. type used,
No doubt EPE will publish other graph- PIC Dual-Chan Virtual Scope (PIC V- in this case a Powertip PG12684 graphics
ics l.c.d. designs in the future, the “dam Scope) which used a PIC-controlled display (X2) – i.e. the same device dis-
having been broken”, so to speak. That is, hardware unit to interface to a PC. It was a cussed when examining the use of graphics
the mysteries of using such devices have considerably easier unit to build than the displays in the Feb ’01 Special
been revealed (and well hidden they were original V-Scope and used a cut-down Supplement.
previously!). The G-Scope, though, is such version of the same PC software. The fre- The second significant difference is that
an obvious application for them, that its quency range was nominally audio, the display requires a negative voltage to
design is inevitably the first to appear. although this extended well above and control the screen contrast. This is provid-
below the human hearing range. ed by the voltage inverter IC4. It is pow-
MULTI-SCOPING ered at +5V, as set by the positive voltage
G-Scope is, in fact, another addition to G-SCOPE regulator IC3, and outputs –5V from pin 5.
the widening family of oscilloscope-type The G-Scope described here is a self- Capacitor C8 sets the frequency at which
constructional projects published contained single channel unit, also catering the inverter operates and C9 smooths the
in EPE over the last nominally for the audio range. Like M- output voltage.
few years. Scope, it is a stand-alone design intended Preset potentiometer VR1 is then used
for visually monitoring signals, but having as a variable resistor to set the current
a greater resolution of the signal flowing through the l.c.d.’s pin 4, so con-
amplitude display. Whereas M- trolling the screen contrast.
Scope used a display area of 8 A further difference is that the display is
× 40 pixels, G-Scope’s controlled by PORTD of the PIC16F877
graphics screen has a microcontroller (IC2), instead of the previ-
pixel density of 64 × ous PORTB. This now allows PORTB to be
128 (vertical × used for the mode switches (S4 to S6), tak-
horizontal). ing advantage of this port’s internal pull-up
resistors in order to use two pushbutton
switches instead of three s.p.d.t. toggles.
The signal to be monitored is input via
socket SK1 to the gain-selecting switch
S2. At this point, the signal routing is
switchable via resistors R1 or R2. The gain
is determined by the value of the selected
input resistor in relation to that of the feed-
back resistor (R3) in the inverting op.amp
circuit around IC1a.
Following R1/R2, switch S3 selects for
d.c. or a.c. coupling, the latter routing
being through capacitor C4. Resistors R4
and R5 provide mid-rail bias (+2·5V) to
the op.amp’s non-inverting input (pin 3).

320 Everyday Practical Electronics, May 2001


From IC1a, the signal is fed to IC2 pin
RA0, which is configured as an analogue-
to-digital converter (ADC) input.
The PIC is operated at 5MHz, the max-
COMPONENTS
imum in keeping with the highest sam- Resistors See
pling rate that the PIC’s ADC can handle. R1, R4,
As usual with this author’s designs, the R5, R7 10k (4 off) SHOP
R2, R3 100k (2 off)
PIC can be programmed on-board, using a
programmer such as PIC Toolkit Mk2 R6 1k TALK
All 0·25W 5% or better. page
(May-June ’99). The programming con-
nections are via terminal pin block TB2. Potentiometer
Diode D1 and resistor R6 prevent the pro- VR1 22k (or 25k) min. round
gramming voltages from disturbing the preset, horiz.
rest of the circuit.
Resistor R7 holds l.c.d. pin CE (chip Capacitors
enable) high to prevent random display C1, C4, 22m radial elect. 10V
detail being created on screen while the C5, C8, C9 (5 off)
PIC is being programmed. C2, C3 100n ceramic disc, 5mm
pitch (2 off)
Pre-programmed PICs are available C6, C7 10p ceramic disc, 5mm
should you not have a PIC programmer. pitch (2 off)
This month’s Shoptalk page gives details
of this, and of obtaining the software (free) Semiconductors
via the EPE web site, or from the EPE D1 1N4148 signal diode
Editorial office on 3·5-inch disk (for which IC1 MAX492 dual op.amp
a nominal handling charge applies). (see text)
The unit may be powered by a 9V battery, IC2 PIC16F877-20P
(20MHz version),
or from an existing 7V to 12V d.c. mains pre-programmed
operated power supply (e.g. mains adaptor). (see text)
Current consumption is only a few milli- IC3 78L05 +5V 100mA
amps. Note that 9V PP3 batteries are typi- Printed circuit board, available from
voltage regulator the EPE PCB Service, code 300; plastic
cally rated at between 100mA/hr (NiCad) IC4 7660 negative voltage case 190mm x 110mm x 60mm (see
and 500mA/hr (alkaline) and are not suited converter text); p.c.b. supports, self-adhesive (4
to long term powering of the unit. off); 1mm pin-header terminal strips;
Miscellaneous 80pin d.i.l. socket (2 off); 40-pin d.i.l.
CONSTRUCTION X1
X2
5MHz crystal
PG12864 graphics l.c.d.
socket; mounting nuts and bolts to suit
Component positioning and track layout l.c.d.; connecting wire; solder, etc.
module (see text)
details for the G-Scope printed circuit S1 to S3, s.p.d.t. min. toggle
board are shown in Fig.2. This board is
available from the EPE PCB Service, code
S5
S4, S6
switch (4 off)
min. s.p. push-to-make
Approx. Cost
Guidance Only
excluding case.
£55
300. switch(2 off)

IN
IC3 OUT +5V
78L05

COM R4 R7 TB1
11 32 3
C3 10k 10k
100n R3 3
+VE +VE +VE
100k 19 10 10
2 PSP0/RD0 D0
RA0/AN0 20 11 11
3 PSP1/RD1 D1
RA1/AN1 21 12 12
AC/DC 4 PSP2/RD2 D2
R1 RA2/AN2/VREF- 22 13 13
5
x10
10k S3
8
*IC1a 6
RA3/AN3/VREF+
PSP3/RD3
PSP4/RD4
27 14 14
D3
X2
D4
2 MAX492 RA4/TOCK1
INPUT 28 15 15 L.C.D.
S2 7 PSP5/RD5 D5 GRAPHICS
1 RA5/AN4/SS 16 16
29
R2 C4 PSP6/RD6 D6 MODULE
SK1 100k 22µ
3 + 30 17 17 PG12864-F
PSP7/RD7 D7
+

x1 4 5 5
WR
15 6 6
T1OS0/T1CK1/RC0 RD
16 7 7
T1OS1/CCP2/RC1 CE
8 17 8 8
RE0/AN5/RD CCP1/RC2 C/D
9 18 9 9 4
RE1/AN6/WR SCK/SCL/RC3 RST CX
10 23 18 18
RE2/AN7/CS SDI/SDA/RC4 FS
C6 24 1
10p SD0/RC5 FG GND
13 25 2
OSC1/CLK IN TX/CK/RC6 1 2
ON/OFF 26 4
RX/DT/RC7 ADC RATE
S1
X1 S4
+ + a
5MHz IC2 INT/RB0
33
C1 C5 D1 PIC16F877-20P 34
C7 RB1
22µ 22µ 1N4148 35 8
k 10p SYNC
14 RB2
OSC2/CLK OUT 36 S5 +VE
PGM/RB3 VR1 2
R6 RB4
37 22k IC4 C+
1k 38 CONTRAST 7660 +
B1 RB5 5 C8
1 FREQ OUT
9V MCLR 39 22µ
PGCLK/RB6 1
40 S6 N.C. N.C.
PGDA/RB7 6 4
N.C. LV C
C2 R5 7
GND GND C9
100n 10k N.C. OSC
22µ+ GND
12 31
0V 3

6
* IC1b
MAX492
N.C.
7 TB2
N.C. *SEE TEXT
N.C.
5 + MCLR DATA CLK 0V
*PROGRAMMER

Fig.1. Complete circuit diagram for the PIC Graphics L.C.D. Scope.
Everyday Practical Electronics, May 2001 321
C4
+ Fig.2. Printed circuit board topside component layout,
INPUT
TO PIC PROGRAMMER
full-size copper foil master pattern and wiring to off-
SK1
R1
(SEE TEXT) board components.
R2 MCLR DATA CLK 0V
S2 S3
x1/x10 AC/DC 2 32IN (58mm)

R5

R
TB2
300
C5 IC1 3 R6
+ k
D1
+ R4
a
C8

IC4 IC2
C9
+ S4 S5 S6

3 36IN (84mm)
C3 7

ADC FREQ
C2 RATE
C6 C7 SYNC
S1 X1

+9V + IN IC3 OUT


C1
COM
POWER
VR1

0V

GRAPHIC LCD
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
TB1

FG +5V WR CE RST D1 D3 D5 D7
0V CX RD C/D D0 D2 D4 D6 FS

FG +5V WR CE RST D1 D3 D5 D7
0V CX RD C/D D0 D2 D4 D6 FS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Fig.3. Pinout
TOP FRONT details from
GRAPHIC LCD
the l.c.d. to
the circuit
board.
Assemble in order of component size, starting with link
wires, d.i.l. sockets (IC1, IC2 and IC4), and then upwards in
ascending order. The d.i.l. i.c.s should not be inserted until
after the board assembly and voltage output from IC3 have
been fully checked.
Note that resistors R1, R2 and capacitor C4 are hard-wired
between switches S2 and S3, which are mounted on the front
panel, along with S4 to S6.
The p.c.b. pinout connections for the l.c.d. are in the same
order as those on the l.c.d. module itself (see Fig.3).
Those of you who purchased a graphics l.c.d. in connection
with the “Using them” article will be able to interchange it
between the two units if you used a connector then.
Do not connect the l.c.d. until you know that +5V and –5V are
being correctly delivered by IC3 and IC4, respectively.

ENCLOSURE
The author used a suitable graphics l.c.d. viewing aperture in
a case. He had, however, come very close to rebelling against
this and almost used a case having a see-through lid, mounting
the display immediately below it!
For ease of screen viewing the l.c.d. should face upwards in
the case. This will allow the maximum amount of light to fall on
its transreflective face. Viewing from the side could cause diffi-
culties in a poorly lit workshop. It would be feasible, though, for
a back-lit version (somewhat more expensive) to be used
sideways in a different style of case.
The author cannot advise on back-lit types, other than to com-
ment that many use internal l.e.d.s as the illumination source and
thus probably require a fairly robust power source. Their data
sheets should be consulted on this point. Component layout on the completed prototype circuit board.

322 Everyday Practical Electronics, May 2001


GREAT EXPECTATIONS The software source code listing is
“commented” with brief notes on the mem-
Having cracked the code structure for
graphics l.c.d.s, the author had great ory and bank use. For a fuller understand-
expectations of not having to do much ing of multiple bank use, though, see next
further programming work in respect of month’s article on the subject.
this G-Scope. He had, after all, already
written the software for the seemingly PROGRAM BASICS
similar M-Scope. It was, then, just a mat- In common with the Using Graphics
ter of a few changes in order to suit the L.C.D.s demo software, G-Scope uses PIC
needs of G-Scope. PORTD for l.c.d. data input/output, and
But, the best laid progs o’ mice an’ men PORTC for its command control.
gang aft a-gley, almost said a certain Scot Following the usual basic initialisation
a wee two and half centuries ago! of program variables, an l.c.d. setup routine
Well, er, yes. While some routines were is called. In this, eight subroutines are
almost transported to G-Scope as library called which, to all intents and purposes,
items, from both M-Scope and the L.C.D. are direct copies of those discussed in the
Demo progs, the integration was consider- L.C.D.s article. A ninth routine (also of the
ably more complex than had first been same origin) outputs tabled text data to the
anticipated. screen.
The principle area of complexity was with The body of the program starts at label
the considerably greater quantity of data to MAIN. Here the choice of whether to moni-
be processed by G-Scope in comparison to tor with or without synchronisation is
M-Scope. The latter only needs 64 samples checked, according to the status of switch S5.
to be acquired and stored for intermediate If sync is needed, three subroutines
processing. G-Scope needs 128. (commencing with WAITS1) examine the
In addition, M-Scope has only eight verti- input signal and wait for it to doubly cross
cal screen positions to be filled or cleared. a “trigger window” before progressing.
G-Scope, though, has 64 – a significant dif- The clearing process is aided by keeping
ference that required an investigative inter- track of each sample’s value in relation that
ruption of program development. of the previous one. Suppose, for instance,
that the first sample at the start of the
DATA BANKS screen trace has a value of 32. The time
In normal use, the PIC16F877 has 96 axis (Y) for that sample is at screen column
bytes available for data storage. Not enough zero (Y = 0). A sample value of 32 requires
in which to store and process the sampled that pixel 32, counting upwards from the
128 data bytes for output to the l.c.d., let bottom of the screen, should be seen as
alone allow for the many other bytes needed active, i.e. at location X32/Y0.
for a variety of essential processes. However, data from the previous batch
It was necessary, therefore, to bring the of samples is displayed somewhere in the
PIC16F877’s additional banks of memory Y0 column. The software cannot be told
into play. Doing so required research into where it is since there is insufficient mem-
this aspect of the said PIC (and its other ory available in order to record the coordi-
family members of the PIC16F87x series). nates for 128 previous samples.
This resulted in the PIC16F87x Extended Because of this, all pixels of column Y0
Memory Use article which will be pub- have to be cleared in order to ensure that
lished next month, and to which you are the previous data is removed. Only then
referred for more information on this use- Graphics display module. can the pixel for the new value be activated
ful feature. Such research created quite at X32/Y0.
a detour in the process of G-Scope
completion. SAMPLES Sample two, now let’s suppose, has a
On acquisition of the sync-trigger flag, value of 40. Its coordinates are thus
Basically, members of the PIC16F87x X40/Y1 (next step along the time axis).
family have four banks (pages) of data or switched command to bypass sync, at
label SAMPLE1, 128 bytes of input sig- We know that a “real” oscilloscope
memory available, with a total capacity of draws a constant trace between each posi-
between 192 and 368 bytes, depending on nal data are sampled, converted from ana-
logue to digital, and stored in the memo- tion up and along its cathode ray tube
the device type. Any of this memory can be screen. It is hence necessary to try to simu-
used in any program, but you have to keep ry bytes allocated, 64 in Bank 0 and 64 in
Bank 1. This process is completed as late a similar situation on the l.c.d. screen.
a few wits about you in order to keep the Consequently a series of pixels between
banks correctly allocated, especially as rapidly as the PIC’s internal ADC allows
(also see later). X32/Y0 and X40/Y1 has to be activated,
some bytes have intentional joint-access and again the previous data cleared from
between the banks. Although the PIC’s ADC offers 10-bit
sampling, only the upper eight sample bits that column.
To sum up the memory allocation for It is wasteful of processing time to clear
G-Scope: are used, the lower two being ignored.
The 8-bit stored data is subsequently a full column on each step along the time
B generally accessed variables are held axis. It is better to clear only those pixels
in Bank 0 divided by four to limit the maximum value
to 64, this figure being the same number of above and below those that need to be
B the 128-byte ADC “recording memo- active.
ry” is split as 64 bytes in each of Bank 0 vertical pixels on the l.c.d. screen.
Each resulting data byte value now rep- The software thus clears the lowest
and Bank 1 value pixels in the column, sets those
B Bank 2 is used for the data compila- resents the actual line on which the data is
to be shown as part of the overall signal required, and then clears those above.
tion sent to the l.c.d. as graphics (wave- Before this happens, though, the software
form) drawing information trace. Its horizontal position is determined
by which sample number it is in the 128- has to compare the preceding and current
B Bank 3 is allocated for the variables values and ascertain which is the lowest.
used in decimalisation (from binary) of fre- sample batch.
Then the software uses the following
quency and amplitude values prior to their COORDINATES three sub-routines:
screen display as text characters. Drawing the screen line at the correct 1. Clear pixels X0/Y1 to XL/Y1
This leaves some data memory unused, horizontal/vertical address, though, is com- 2. Set pixels (XL + 1)/Y1 to XH/Y1
but insufficient for two-channel’s worth of plicated by having to clear any previous 3. Clear pixels (XH + 1)/Y1 to X63/Y1
signals to be processed, consequently G- data from that same region. Failing to do so where XL is the lowest value, XH is the
Scope has had to be designed as a single- would cause the screen to become rapidly highest, and X63 is the top of the l.c.d.
channel unit. filled with a congestion of lines. screen.

Everyday Practical Electronics, May 2001 323


Obviously, various programming inter- When the functions are turned off, the
cepts have to be included to cater for such screen is cleared of the related text
situations as XL = XH, XL = 0, XH = 63, “messages”.
etc. When monitoring is in use, decimalisa-
In order to use the same routines for tion of the voltage and frequency binary
each of the 128 time axis columns, prior to values is performed by a routine which is
entering the controlling loop the program based in Bank 3. After conversion, leading
sets XL = XH = the value of the first sam- zeros are blanked for the frequency read-
ple, which is destined for column Y0. ing, but not for the voltage reading.
Whilst it is easy to write to individual
pixels on the l.c.d. graphics screen, it is far ADC RATES
quicker to compile the data for eight In common with M-Scope, three ADC
columns as a series of 64 8-bit bytes, and Examples of waveforms sampled at sampling rates can be selected by switch
then write the 64 bytes to the screen. After different rates, showing the peak-to- S4. The rates are stepped through cyclical-
which the next 8-column batch can be peak voltage and the frequency. An ly at each switch press. The screen dis-
assembled similarly. The process is so fast example of a display without the text plays the rate selected by its allocated
that the eye does not notice that it is a captions is shown earlier. number, between 0 and 2, but not in terms
stepped assembly and display taking place. of specific time values.
As said earlier, the raw sampled data is The rates are set according to the value
held in data memory Bank 0 and Bank 1, by which the PIC’s master clock oscillator
while the screen data is assembled in is divided within the ADCON0 prescaler.
Bank 2. Bits 7 and 6 of ADCON0 control the divi-
sion rate and the displayed numerical
AMPLITUDE value represents the value set into those
ASSESSMENT bits (see the PIC16F87x data sheet, Table
Having displayed a full 128-byte batch 11-1).
of data on screen, frequency and mini- Rate 0 (bits 7 and 6 = binary 00 = 0) is
mum-maximum amplitude values are the fastest sampling rate for a conversion
assessed. time of 400ns when using a 5MHz crystal
Amplitude min-max values are easily oscillator. The data sheet refers to this rate
ascertained. First, two temporary vari- as 2Tosc. Theoretically, the rate is faster
ables, MIN and MAX are set so that MIN holding the preset value counts down to than the data sheet recommends, but the
is greater than or equal to the highest value zero. The trigger-crossing count represents author has frequently run the PIC’s ADC at
expected, and MAX is set to be less than or the frequency of the input signal in Hertz. this rate in other designs without experi-
equal to the minimum value expected. In The technique is remarkably accurate, encing problems.
this instance they are set for MIN = 255 but is subject to slight deviation from cor- Rate 1 (bits 7 and 6 = binary 01 = 1) sets
and MAX = 0. rect values for systems not operating at the 8Tosc rate, in which the conversion
It is then a matter of repeatedly check- exactly the same rate as the author’s. time is 1.6ms at 5MHz. Rate 2 (bits 7 and
ing each data value against both MIN and Should readers wish to correct for their 6 = binary 10 = 2) sets the rate at 32Tosc
MAX. If the sample is less than MIN then controlling crystal’s actual oscillation rate, with a conversion time of 6·4ms at 5MHz.
MIN is set to now equal the sample. If the the preset values can be corrected within The data sheet shows a fourth rate
sample is greater than MAX, then MAX is the software. It is necessary, though, to selected with bits 7 and 6 = binary 11 =
set to equal the sample. This checking have a signal generator and frequency 3, but this rate (conversion period 2ms to
occurs for all 128 data byte values. counter so that the signal frequencies can 6ms) is reserved for when the PIC is run
At the end of the process, MIN is sub- be compared with those shown on the G- under RC (resistor-capacitor oscillator)
tracted from MAX and the result convert- Scope screen. It is also necessary to have a mode. It is not suitable for implementing
ed from its binary value to a 3-byte BCD suitable PIC programmer (such as Toolkit) with G-Scope.
(binary coded decimal) format. This is to allow the source code to be recompiled Rate 0 is the one required for sampling
then output to the l.c.d.’s text screen as a 3- and downloaded to the PIC. signals having higher frequency rates.
digit number with a decimal point inserted The routines to be amended start at label Rate 2 is well suited to sampling sub-Hertz
between the lefthand and middle digits, GETFREQ0, with sufficient notations in frequencies.
referencing the reading to the scale of the the source code to clarify the appropriate
PIC’s ADC. ones. There are three involved, catering for PROBES
An ADC value of 255 actually repre- each of the ADC sampling rates (more on It is not essential that a proper oscillo-
sents the supply line voltage at which the which in a moment). scope probe is used with G-Scope, although
PIC’s ADC is referenced, i.e. nominally The author was interested to find, how- using one will help to keep the monitored
5V. The routines prior to decimalisation ever, that the factors originally ascertained signal free of external interference, and pro-
double the ADC values so that a MAX - with M-Scope still applied to G-Scope, vide a convenient probed or clipped connec-
MIN result of 5V (255) is represented as even though the 5MHz crystal was physi- tion to the monitored circuit.
510, and displayed as 5·10V. No attempt cally another component, bought at a dif- In many situations, though, using your
has been made to exactly “tune” the ferent time. multimeter’s leads will provide an ade-
displayed value to the “real” value. The The M-Scope and G-Scope test models quate coupling solution, and more cheaply.
displayed value, therefore, should only be achieved the following maximum frequen- If you choose this option, socket SK1 can
treated as a guide to actual min-max cy input values while still maintaining be replaced by two sockets to suit your
voltages. good accuracy: meter leads. One should be the signal input
It should also be noted that the PIC does socket, and the other for the 0V (GND)
not monitor which gain setting has been Rate Sig-Gen Display connection that is required between the
selected via switch S2. The voltage read- 0 17007Hz 16984Hz unit and the circuit being monitored.
ing simply represents that arriving at the 1 17007Hz 16998Hz
PIC’s RA0 pin. 2 5827Hz 5812Hz SOFTWARE
If programming your own PIC, it must
FREQUENCY MONITORING ON/OFF be initialised with the settings stated at the
CALCULATION Using the frequency and voltage mon- head of the source code.
Frequency calculation uses the same itoring routines adds to the time taken to The source code (.ASM) is written in
technique as in M-Scope. During develop- process each sampled signal batch. Even TASM, for which the assembled file is in
ment of the latter, the author fine-trimmed though the process is still quite fast, it .OBJ format, such as required by Toolkit
some counter reference values set into the was felt worthwhile to allow it to be Mk2. For those who work in MPASM, the
program. In operation, the number of times bypassed. Switch S6 controls this func- .ASM file can be translated to that dialect
that a signal value crosses a trigger level is tion, toggling between the on and off using Toolkit’s software, even if you do not
counted during the period that a counter states. have the Toolkit hardware. 6

324 Everyday Practical Electronics, May 2001

You might also like