The only difference between the EPROM- and RAM-based circuits is the use of RAM chip in place of EPROM and a
key-Fig. 14: LED indicator circuit
tAbLE i
Music Frequency Data Hex Variable Variable Maximum note of music character value resistor resistor value of
note (preset) in-circuit variable
(Hz) number value (ohm) resistor
Lower octave
Fig. 13: Wiring connections for car-reverse horn
The inputs of N1 are shorted and connected to the ground via resistor R7. So the output of N1 becomes high, which keeps IC1 oscil-lating.
After a stop-clock (active ‘high’) sig-nal appears at the input of NAND gate N1, its output goes low. When switch S1 is pressed, the output of N1 goes high and IC1 starts oscillating again. Gates N2 and N3 are used to provide read and write logic for RAM. In read condition, the output of N3 is at logic 0 because its inputs are at logic 1. Pressing of switch S5 provides ‘write’ condition, since the Fig. 15: Keyboard and probe for programming RAM
board for programming the RAM in RAM-based circuits. Besides, an LED panel is used for displaying the selected RAM address.
Switch S2 is used to manually provide clock pulses to IC2. Similarly, switch S3 is used to manually reset IC2 before and after programming. Both switches (S2 and S3) are integrated into Fig. 2. The connec-tor K1 in between IC2 and IC3 is used to connect to K5(M) connecter along with the associated LEDs as shown in Fig. 14. EPROM 2732 (IC3) is replaced with an 8-bit, 2k SRAM (6116). Pin 21
of 6116 is WE (write enable – active low).
Switch S6 is to be kept in position ‘b’ while working with RAM.
At the time of writing (programming) data into the RAM, there is no connection between connectors K2(F) and K3(M).
Also, jumper J1 is removed. To program the RAM, K4(M) is to be mated with K2(F). After programming is over, K2(F) is connected to K3(M).
IC6 (CD4011) contains four NAND gates, of which NAND gate N1 is used for stop-clock signals. It functions in the same manner as in an EPROM-based circuit.
{printf(“\n enter tune :”);
scanf(“%s”,&ch1);
output of gate N3 is at logic 1 and that of gate N2 at logic 0.
LED connector. A separate male connec-tor K5(M) is fabricated with LEDs as shown in Fig. 14. This connector should be connected to K1(F). The LEDs indicate addresses of memory locations of RAM. Glowing of LED1 through LED11 together means that last RAM loca-tion is being addressed. (We are using a 2kB RAM.)
Keyboard. The circuit diagram of key-board is shown in Fig. 15. Male
connec-tor K4(M) should be connected to K2(F) during pro-gramming. The circles shown with the corresponding hex values are simple metallic contacts (or tabs) that avoid the use of a large number of switches. To enter the hex data, the probe is touched to the corresponding metallic contact tab.
The keyboard can be easily wired us-ing a general-purpose board. To test the keyboard after wiring, connect point ‘A’ to the ground via a 100-ohm resistor (R18) as shown in Fig. 15. Now touch each and every tab one by one using the metallic probe and verify that the data shown by the LEDs (LED13 through LED20) is
consistent with the hex value shown on the tab/circle. After checking, disconnect resistor R18.
Connector K3 should be soldered to the PCB by using a ribbon cable of ad-equate length, so that it could be easily connected to K2(F) after programming.
The outputs from IC4 and IC5 go to preset-array part of the tone oscillator.
Wiring is done similar to that in an EPROM version.
Programming. Connect LED con-nector K5(M) to K1(F) and keyboard connector K4(M) to K2(F). Press switch S3 momentarily to reset IC2. No LED glows on the LED connector, indicating the initial address as zero. Now touch the tab marked ‘00’ with the probe. Press S5 momentarily and lift the probe. Glowing of no LED on the keyboard indicates that
‘00’ is entered in the initial memory loca-Fig. 16: Block diagram of ROM-based melody generator
Fig. 17: Schematic diagram of ROM-based melody generator
PArts List Semiconductors:
IC1 - NE555 timer
IC2, IC3 - CD4017 decade counter IC4, IC5 - CD4069 hex inverters T1-T10 - BC547 npn transistor T11-T110 - BC558 pnp transistor
Resistors (¼-watt ±5% carbon, unless other-wise stated)
R1 - 10-kilo-ohm R2 - 100-kilo-ohm R3 - 680-ohm R4 - 1-mega-ohm R5 - 1-kilo-ohm R6 - 68-ohm Capacitors:
C1 - 2.2µF, 12V electrolytic C2, C3 - 0.01µ ceramic disc Miscellaneous:
S1 - Push-to-off switch
tion. (It is good to enter ‘00’ in the first memory location.)
Now get the hex dump values of the tunes. Press switch S2 to go to the next memory location, indicated by LED1 (cor-responding to address line A0), on the LED connector strip. Touch the appropriate tab with the probe to enter the corresponding hexadecimal value at memory location 1.
Press switch S5 and lift the probe. The data entered into memory location 1 is shown by keyboard LEDs in binary form.
Hex data values (refer Table I) are such that any of the four LEDs cor-responding to either D0 through D3 bits or D4 through D7 bits would glow to show the data entered. So it is easy to identify whether the data entered is correct or not. If necessary, make a table of binary data along with corresponding hex values.
After entering all the tunes, discon-nect keyboard from K2(F) and condiscon-nect K3(M) to K2(F). Now connect external jumper J1 as shown in the circuit dia-gram.
Switch S4 across jumper J1 termi-nals is not necessary but it may prove useful if any readjustment of variable resistors is needed (as in the case of EPROM), or for checking each and every tune one by one.
The programming steps are summa-rised as below:
1. Press switch S3.
2. Touch tab 00 with the probe.
3. Press and release switch S5.
4. Lift the probe.
5. Press S2 to go to the next memory location.
6. Repeat from step 2 onwards for the next hex value programming.
7. After last data is entered, press S3.8. Keep S4 pressed to check all the tunes that have been entered.
9. Connect jumper J1 if all tunes are entered.
The data table (Table I), writing of musical notes, conversion of notes to hex values, preset-array alignment, and flow charts for door-bell and car-reverse tune are also applicable for the RAM version.
Now we shall study a programmable melody generator using home-brewed