You are on page 1of 9

PR17B

Voice Recording and Playback: ISD1790

Version 1.0
August 2010
Cytron Technologies Sdn. Bhd.

Information contained in this publication regarding device applications and the like is intended through suggestion only and may be superseded by
updates. It is your responsibility to ensure that your application meets with your specifications. No representation or warranty is given and no liability is
assumed by Cytron Technologies Incorporated with respect to the accuracy or use of such information or infringement of patents or other intellectual
property rights arising from such use or otherwise. Use of Cytron Technologies’s products as critical components in life support systems is not
authorized except with express written approval by Cytron Technologies. No licenses are conveyed, implicitly or otherwise, under any intellectual
property rights.

OVERVIEW FEATURES
This document describes the development of Cytron PIC16F877A
Technologies DIY (Do It Yourself) Project No.17 - 8-bit microcontroller with 33 I/O
(PR17). This project will use PIC16F877A and - operate with 5V supply
ISD1790 to record and playback voice. Circuit - operating speed 20MHz
schematic and PIC source code will be provided. ISD1790
- single chip record and playback
- on chip non-volatile memory
- record up to 90 second
- support SPI mode as well as standalone mode
- able to control volume

Created by Cytron Technologies Sdn. Bhd. – All Rights Reserved 1


ROBOT . HEAD to TOE
PR17 – Voice Recording and Playback: ISD1790

SYSTEM OVERVIEW

LCD
ISD1790
SPI EEPROM
interface (nonvolatile
SPI line storage)
PIC16F877A

Control Control
line Unit ADC DAC Speaker

Push
Button LED
Microphone

GENERAL DESCRIPTION operation. To solve this, Global Erase must be


performed. Recordings are stored into on-chip
When we talk about voice recording, the first thing that nonvolatile memory cells, providing zero-power
comes to our mind is an old cassette player where we message storage. Voice and audio signals are stored
record voice, and playback the recorded voice. directly into memory in their natural form, providing
high-quality, solid-state voice reproduction. The
ISD1790 sampling frequency of ISD1790 can be adjusted from 4
kHz to 12 kHz with an external resistor, providing
greater flexibility in duration versus record quality.
Table below demonstrates the sampling frequency of
ISD1790 versus message duration as well as the
minimum storage resolution. Also, Rosc is the
oscillator resistor which influences the sampling
frequency.

Minimum
Sampling
Rosc Message Storage
Frequency
(kΩ) Duration Resolution
(kHz)
(msec)
12 53 60 83.3
8.0 80 90 125
6.4 100 112 156
Figure 1 5.3 120 135 187
4.0 160 180 250
Winbond® ISD1790 Chip Order® Series provides
high-quality, fully integrated, single-chip, Table 1
Record/Playback solutions for 90 second messaging
applications. In addition, it can be operated in either For detailed information about ISD1790, please refer to
standalone or SPI (microcontroller) mode. The CMOS the datasheet which can be found at ISD1790 Design
devices include an on-chip oscillator (with external Guide.
resistor control), microphone preamplifier with
automatic gain control (AGC), anti-aliasing filter,
Multi-Level Storage (MLS) array, smoothing filter,
volume control, Pulse Width Modulation (PWM) Class
D speaker driver and current/voltage output.
Furthermore, ISD1790 also supports an optional vAlert
(voiceAlert) feature that can be used as a new message
indicator. For example, if the vAlert blinks seven times
continuously, it indicates that something unusual has
occurred and the device fails to perform the requested

Created by Cytron Technologies Sdn. Bhd. – All Rights Reserved 2


ROBOT . HEAD to TOE
PR17 – Voice Recording and Playback: ISD1790

PIC16F877A Interface PIC16F877A with ISD1790


This powerful (200 nanosecond instruction execution) Pin Name Pin function Connection
yet easy-to-program (only 35 single word instructions) 24 REC Record(Standalone) RA0
CMOS FLASH-based 8-bit microcontroller packs 23 PLAY Play(Standalone) RE2
Microchip's powerful PIC® architecture into an 40- or 26 FWD Forward(Standalone) RC0
44-pin package and is upwards compatible with the VOL Connect to
PIC16C5X, PIC12CXXX and PIC16C7X devices. 19 Volume Control
push button
Features of the device: 22 FT Feed-Through RD3
• 256 bytes of EEPROM data memory 7 SS Slave Select RE1
• self programming 6 SCLK Serial Clock RC3
• ICD (in circuit debugging function) 5 MOSI Master Out Slave In RC5
• 2 Comparators 4 MISO Master In Slave Out RC4
Non-inverting input
• 8 channels of 10-bit Analog-to-Digital (A/D) Connected
10 MIC+ of differential
converter to MIC
microphone signal
• 2 capture/compare/PWM functions
Inverting input of
• synchronous serial port can be configured as Connected
11 MIC- differential
either 3-wire Serial Peripheral Interface to MIC
microphone signal
(SPI™) or the 2-wire Inter-Integrated Circuit
Connected
(I²C™) bus
20 Rosc Oscillator Resistor to 82kΩ
• Universal Asynchronous Receiver Transmitter
resistor
(UART).
Connected
All of these features make it ideal for more advanced Automatic Gain to 4.7uF
18 AGC
level A/D applications in automotive, industrial, Control electrolytic
appliances and consumer applications. capacitor
Connected
2 LED LED
to LED
Supply voltage Connected
1 VCCD
(digital) to 5V
Connected
28 VSSD Ground (digital)
to GND
Supply voltage Connected
21 VCCA
(analog) to 5V
Connected
8 VSSA Ground (analog)
to GND
Supply voltage
Connected
14 VCCP (PWM Speaker
Figure 2 to 5V
Driver)
Figure 2 shows the pin diagram for PIC16F877A. For Ground ( Positive
more information about the PIC microcontroller, please Connected
16 VSSP1 PWM Speaker
refer to the datasheet. The datasheet can be found in to GND
Driver)
microchip web site at: http://www.microchip.com Ground ( Negative
Connected
12 VSSP2 PWM Speaker
to GND
HARDWARE Driver)
Connected
This project will require following hardware: to positive
15 SP+ SP+
a. 1 x PIC16F877A pin of
b. 1 x PR17 Printed Circuit Board (PCB) speaker
c. 1 x ISD1760 Connected
d. 1 x 2x16 LCD to negative
13 SP- SP-
e. 1x Jack Socket pin of
f. Related electronic components speaker
Table1
Please refer to Appendix A for the PCB layout of PR17. *For more information about pin that is not shown in
The PCB layout is provided free therefore Cytron the table 1, please refer to ISD1790 datasheet.
Technologies will not be responsible for any further
modification or improvement.

Created by Cytron Technologies Sdn. Bhd. – All Rights Reserved 3


ROBOT . HEAD to TOE
PR17 – Voice Recording and Playback: ISD1790

to the I/O pin is as shown in Figure 5. The I/O pin


should be pull up to 5V using a resistor (with value
range 1K-10K) and this configuration will result an
active-low input. When the button is being pressed,
reading of I/O pin will be in logic 0, while when the
button is not pressed, reading of that I/O pin will be
logic 1.

ICSP for programming PIC


microcontroller
Figure 3

Power supply for the circuit

Figure 7

Figure 4
The basic connection for In-Circuit Serial Programmer
User can choose either AC to DC adaptor (not included (ICSP) is as displayed in Figure 5. There are several
in the DIY project set) or 9V-12V battery (not included types of USB in-circuit programmer can be found in
in the DIY project set) to power up the circuit. Higher Cytron, for example, UIC00B. However, programmer
input voltage will produce more heat at LM7805 is not included in this DIY project package since the
voltage regulator. Typical voltage is 12V. Anyhow, programmer can be reused for other projects.
LM7805 will still generate some heat at 12V. There are
two type of power connector for the circuit, DC plug For the instruction of using a PIC programmer, please
(J1) and 2510-02 (Power Connector). Normally AC to refer to the particular PIC programmer user’s manual at
DC adaptor can be plugged to J1 type connector. Cytron website (http://www.cytron.com.my)

Refer to Figure 4, the D1 is used to protect the circuit


from wrong polarity supply. C1 and C3 are used to
Interface LCD (2x 16 Character) with
stabilize the voltage at the input side of the LM7805 PIC16F877A
voltage regulator, while the C2 and C4 are used to To use the LCD display, users have to solder 16 pin
stabilize the voltage at the output side of the LM7805 header pin to the LCD display. LCD used in this
voltage supply. LED is a green LED to indicate the project is RT1602C, for other type of LCD, please
power status of the circuit. R13 is a resistor to protect refer to its data sheet.
LED from excessive current that will burn the LED.

Push Button as input for PIC


microcontroller

Figure 8
Figure 5
One I/O pin is needed for one push button as input of Figure 8 is a 2X16 character LCD. LCD connection pin
PIC microcontroller. The connection of the push button and function of each pin is shown:

Created by Cytron Technologies Sdn. Bhd. – All Rights Reserved 4


ROBOT . HEAD to TOE
PR17 – Voice Recording and Playback: ISD1790

Pin Name Pin function Connection


PCB circuit board
1 VSS Ground GND
2 VCC Positive supply 5V
1 3 12 18 17
for LCD 11
3 VEE Brightness adjust Connected to
a trimmer to 2 8 4 10 15 19
9
adjust LCD 5 13
brightness 16
4 RS Select register, RD6 6
select instruction
or data register 7
5 R/W Select read or GND
write 20
6 E Start data read or RD7
write
7 DB0 Data bus pin RB0 14
8 DB1 Data bus pin RB1
9 DB2 Data bus pin RB2 Figure 10
10 DB3 Data bus pin RB3
Component:
11 DB4 Data bus pin RB4
12 DB5 Data bus pin RB5 1. 2510-02 connector, (to use either 9V battery
13 DB6 Data bus pin RB6 or 12V battery to power up the circuit).
14 DB7 Data bus pin RB7 2. Slide switch (to ON or OFF the circuit).
15 LED+ Backlight positive a resistor to 3. AC-DC adaptor socket (to use power supply
input limit from AC-DC adaptor).
excessive 4. Power indicator LED (to indicate the power
current status of the circuit).
16 LED- Backlight GND 5. Crystal (20MHz).
negative input 6. PIC 16F877A (the main brain of the system).
7. Push buttons.
Table 2 8. Diode (to protect the circuit from wrong
polarity power input).
9. Capacitor (to stabilize the output voltage of
the 7805 voltage regulator).
10. LED.
11. LM7805 (voltage regulator, supply 5V for
PIC).
12. ICSP box header (to connect to PIC
programmer to program the microcontroller).
13. ISD1760 (chip to record and playback voice).
14. Reset button (to reset the microcontroller).
15. ISD1760 support component.
16. Microphone (to record voice).
17. 2510-02 connector, (to connect to an external
Figure 9
speaker).
18. LM386 (Low Voltage Audio Power Amplifier)
19. Audio Socket
20. LCD (2x16 characters)

Created by Cytron Technologies Sdn. Bhd. – All Rights Reserved 5


ROBOT . HEAD to TOE
PR17 – Voice Recording and Playback: ISD1790

SOFTWARE For more information about the software for this


system, please refer to the source code provided. The
Flow Chart: explanation of each instruction is provided in the
source code as the comment of each line.

The source code is provided free and Cytron


Start Technologies will not be responsible for any further
modification or improvement.

Initialize PIC GETTING START


User can obtain the hardware set for this project (PR17)
either by online purchasing (www.cytron.com.my) or
purchase it in Cytron Technologies Shop.

Yes 1. Once user has the hardware set, soldering


Is Select Increase
pressed?
process can be started. Please solder the
mode
electronic components one by one according
No the symbols or overlays on the Printed Circuit
Board (PCB). Ensure the component value
and polarity is correctly soldered. Please refer
to PCB Layout in Appendix A.
Is Enter Yes Execute
pressed? current mode Caution: Make sure all the connectors (2510) are
soldered in proper side. Those electronic
No components have polarity such as capacitor,
diode, PIC, LM7805 and LED should be
soldered in right polarity or it may cause the
circuit board fail to work.
Mode 1: SPI mode
Control ISD 1790 using SPI interface (Play and Warning: Before the battery (Power) is plugged in,
record messages at certain locations). There are make sure the polarity is correct to prevent
two options in recording sound clip which are explosion. Wrong polarity of capacitor also
either using mic or audio input.
may cause explosion.
Beware that before entering this mode, user is
advised to perform Global Erase operation if
Standalone mode is used earlier to avoid 2. Please download the necessary files and
overlapping of messages. If the Alert LED flashes document from Cytron Technologies website.
seven times, Global Erase operation must be These included documentation, sample source
performed as an error has been occurred. code, schematic, component list and software.

Mode 2: Standalone mode 3. The next step is to install MPLAB IDE and
Control ISD 1790 using I/O ports where it can HI-TECC C PRO into a computer. The
playback, record and forward to the next message. MPLAB IDE and HI-TECC C PRO can be
The number of message to be recorded is downloaded from www.cytron.com.my.
unlimited as long as the memory is not full yet. Please refer MPLAB IDE installation step
There are two options in recording sound clip document to install the software. The
which are either using mic or audio input. Beware
documents can be used to any version of
that before entering this mode, user is advised to
perform Global Erase operation if SPI mode is MPLAB IDE software.
used earlier to avoid overlapping of messages. If
the Alert LED flashes seven times, Global Erase 4. After the installation complete, open the
operation must be performed as an error has been project file provided using MPLAB IDE.
occurred. Please refer MPLAB Open Project document
to open the sample program.
Mode 3: Erase mode
In this mode, there are two options which are 5. Plug in power supply for the circuit. User can
Erase operation and Global Erase operation. For choose to use battery or AD to DC adaptor.
Erase operation, it can delete message row by
row, however, it is restricted to first or last
message only. For Global Erase operation, all
messages are deleted at once.

Created by Cytron Technologies Sdn. Bhd. – All Rights Reserved 6


ROBOT . HEAD to TOE
PR17 – Voice Recording and Playback: ISD1790

AC to DC adaptor: 9. Have fun!

TEST METHOD

SPI Mode

1. Switch ON the power


• Power Led (green) will turn ON.
• LCD will display “Select Mode” and “1.
SPI Mode”.
2. Press Enter button
• LCD will display “Switch Mode” and “1.
12V Polarity
Play”.
Figure 11 (not included in DIY project set)
• When press Select button, the second line
of LCD display will change to “2.
9V battery connector: Record”
3. Choose Record operation
• Select the methods of recording which
either using “1. Analog Input” or “2.
MIC”.
¾ If “1. Analog Input” is selected;
connect the audio wire between
the jack socket and PC. It will
behave similarly as headset.
Then, play music using PC.
Figure 12 (not included in DIY project set) ¾ However, if “2. MIC” is selected;
the sound clip will be recorded
Connection to the PCB board: via MIC by putting the source
near the MIC.
• Select the location user wishes to store at.
• If “1. Message 1” is selected, ISD1790
will start to record for around 46 seconds.
• While recording, the LCD will display
“**recording the first message**”.
• When 46 seconds has reached, the LCD
will display”***halt***” to indicate that
Figure 13 recording process has finished.
• The procedures are the same if user
6. Build the project and load the hex file into the chooses to record for Message 2.
PIC microcontroller using the USB In-Circuit 4. Press Reset button
Programmer (UIC00B). When user builds the 5. Choose Play under SPI mode.
project, MPLAB IDE will generate hex file. • If user wants to play back the Message 1
The hex file generated from MPLAB IDE will that has recorded, choose “Message 1”
be named according to project name, not C for the Location.
file name. Cytron Technologies also provides • LCD will display “**playing the first
hex file for user. Do not forget to switch ON message**” and will display
the power. The programmer is not included in “***halt***” when 46 seconds are over.
the hardware set but it can be found at Cytron • If user wants to play back the recorded
website. (User manual is provided at website Message 2, press Select button again and
as well). choose for Message 2.
• Same procedures for playing back
7. User can modify this program. After Message 2.
modification, build the project once again and
load the hex file into the PIC microcontroller Standalone Mode
using Cytron USB In-Circuit Programmer 1. Reset the PIC
(UIC00B). 2. If user has recorded for both Message 1 and
Message 2, it is advisable to perform Global
8. Test the functionality of the PCB board.

Created by Cytron Technologies Sdn. Bhd. – All Rights Reserved 7


ROBOT . HEAD to TOE
PR17 – Voice Recording and Playback: ISD1790

Erase operation to avoid overlapping of • User can only erase the first or the last
messages. Otherwise, user can skip this step. message each time.
• Choose Erase mode before entering 5. If user wants to delete all the messages,
Standalone mode. choose Global Erase operation under Erase
• Select Global Erase and press Enter. mode.
• LCD will display “Memory Cleared”. • LCD will display “Memory Cleared”.
• All messages have been erased. • All messages have been erased.
3. Press Select button and Enter button to choose
for Standalone mode. If all the steps mentioned above can be executed, your
4. Choose Record mode under Standalone mode. project is done successfully. Congratulation!!
• Select the methods of recording which
either using “1. Analog Input” or “2.
MIC”.
WARRANTY
¾ If “1. Analog Input” is selected;
connect the audio wire between No warranty will be provided as this is DIY project.
the jack socket and PC. It will Thus, user is advised to check the polarity of each
behave similarly as headset. electronic component before soldering it to board.
Then, play music using PC.
¾ However, if “2. MIC” is
selected; the sound clip will be
recorded via MIC by putting the
source near the MIC.
• It will start recording and Alert LED will
turn ON.
• LCD will display “**record**” and
“select to stop”
• If user wishes to stop recording, press
Select button. LCD will display “**stop
recording**”.

• If user to wish to record another sound


clip, repeat step 3 and 4 after pressing
Reset button.
5. To play back the recorded sound clip, press
Select and Enter button to choose Play under
Standalone mode.
• Alert LED will flash continuously while
playing the recorded sound clip
• ISD 1790 will stop automatically when a
sound clip is finished playing and Alert
LED will stop blink and turn OFF.
6. To play the next sound clip, one has to
forward the playback pointer. To do this,
choose “Forward” under Standalone mode.
• The Alert LED will flash twice and LCD
will display “**forward**” at the second
line.
• Do not press any buttons while Alert
LED is flashing.
• User can now repeat step 5 if wants to
play back the next sound clip.

Erase Mode
1. Reset PIC.
2. Press Select and Enter buttons to choose Erase
mode.
3. Press Select and Enter buttons to choose Erase
mode.
4. If user wants to erase message one by one,
user can choose Erase operation. However,
this mode is not suitable for SPI mode.

Created by Cytron Technologies Sdn. Bhd. – All Rights Reserved 8


ROBOT . HEAD to TOE
PR17 – Voice Recording and Playback: ISD1790

Appendix A

PCB Layout:

Adaptor Box Preset 2510-02


E-Cap LM386 103 Connector
2510-02 Socket LM7805 Header
100uF
Connector E-Cap
c-cap 562 220uF
E-Cap ISD1790 E-Cap
20MHz
10uF 4.7uF Jack Socket
Crystal c-cap 104 Preset
PIC16F877A 502 Microphone
E-Cap
4.7uF

10K

LCD
10K

10K Reset
Button

Figure 14

Figure 15

Created by Cytron Technologies Sdn. Bhd. – All Rights Reserved 9

You might also like