Specifications
CONSTRUCTION
The 8-bit port-B of this device has
been used as an output port, which is
directly connected to the DAC. The 5-bit
port-A has been used both to input key-
press data and to output display data to
the LEDs. Actually, the I/O pins on this
port are time-shared/multiplexed between
the keys and the LEDs. This means the
same lines are used at one time for read-
ing the keys and at another time for out-
putting data to drive the LEDs directly.
The time-sharing is so fast that the dis-
play through LEDs appears to be stable,
or any key closure is detected error-free.
The circuit works on 5V power supply,
which can be derived from a 9V PP3 bat-
tery (or any other source capable of sup-
plying 7. 5V to 9V DC) by using commonly
available 7805 regulator. The current drain
of the circuit is less than 10 mA.
Although the circuit of Fig. 5 can be
easily assembled using a general-purpose
PCB, a proper actual-size single-sided
PCB for the same is given in Fig. 6 along
with its component layout in Fig. 7.
Software
The waveform generation technique is
pretty easy and one can implement it
with any other microprocesor or
microcontroller system (e.g. 8085,
8032, Z80, 6800, etc). The program
flowcharts for generation of various
waveforms are shown in Fig. 8. One
can write one’s software for the pur-
pose. However, source program for
generation of various waveforms us-
ing the circuit of Fig. 5, employing
PIC16C84 microcontroller, is given in
Appendix ‘A’.
For programming PIC
microcontroller, including the com-
plete development of a system, Mi-
crochip offers an integrated develop-
ment environment (IDE) software
TABLE III
Look-up table of sine values in decimal and
equivalent Hex values (within parenthesis)
at 10 degree interval
100(64) 187(BB) 19(13)
117(75) 177(B1) 6(6)
134(86) 164(A4) 2(2)
150(96) 150(96) 0(0)
164(A4) 134(86) 2(2)
177(B1) 117(75) 6(6)
187(BB) 100(64) 19(13)
194(C2) 88(58) 29(1D)
198(C6) 71(47) 41(29)
208(D0) 55(37) 55(37)
198(C6) 41(29) 71(47)
194(C2) 29(1D) 88(58)
called Mplab. It is available on Technical
Library CD-ROM offered (free, on request)
from its India Liaison Office, Bangalore.
The latest version of this software can
also be downloaded from the Microchip
Website ‘microchip.com’.
The Mplab IDE comes with editor, as-
sembler, and programmer software to sup-
port Microchip’s device programmers and
a software simulator. It also supports pro-
grams written in ‘C’ language.
For the present device (PIC 16C84),
the author has used Microchip PICSTART
PLUS development programmer. The soft-
ware for the same, in PDF format, is also
available on the Internet.
Operation
As stated earlier, the present circuit can
produce all standard waveforms. After
power-up, by default the circuit produces
squarewave signal. The LED marked
‘square’ also lights up to indicate that
function. When the ‘select’ key is pressed
once, the output changes to tri-wave. The
waveforms are selected sequentially on
every depression of the ‘select’ switch and
then repeated. Tested frequency range is
1 Hz to 100 Hz (all waveforms).
Sinewave generation. For wave-
forms other than sinewave, the data to
the DAC changes in binary ascending or
descending order. But since sine function
is not a linear function, each data is pre-
defined and a value table is used in this
case. The value for each step of the
sinewave is read and sent to the output
port. The resolution depends upon the
number of steps. The higher the step-
count, the greater is the resolution, or
vice-a-versa. A simple look-up table (val-
ues at 10
o
intervals), comprising 36 values
TABLE IV
Address Bank 0 Bank 1 Address
(Hex) registers registers (Hex)
00 Indirect Indirect 80
01 TMR0 Option 81
02 PCL PCL 82
03 Status Status 83
04 FSR FSR 84
05 Port Tris 85
06 Port Tris 86
07 — Not implemented — 87
08 EEdata Eecon1 88
09 Eeaddr Eecon2 89
0A Pclath Pclath 8A
0B Intcon Intcon 8B
0C General-purpose RAM 8C
| area starts |
| Bank 1 RAM not implemented |
||
2F RAM ends AF
www.electronicsforu.com
a portal dedicated to electronics enthusiasts
167