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 Technologiess 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


Technologies DIY (Do It Yourself) Project No.17
(PR17). This project will use PIC16F877A and
ISD1790 to record and playback voice. Circuit
schematic and PIC source code will be provided.

PIC16F877A
- 8-bit microcontroller with 33 I/O
- operate with 5V supply
- operating speed 20MHz
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

ROBOT . HEAD to TOE


PR17 Voice Recording and Playback: ISD1790

SYSTEM OVERVIEW

LCD

ISD1790
SPI line

SPI
interface

EEPROM
(nonvolatile
storage)

PIC16F877A
Control
line

Push
Button

Control
Unit

ADC

DAC

Speaker

LED
Microphone

GENERAL DESCRIPTION
When we talk about voice recording, the first thing that
comes to our mind is an old cassette player where we
record voice, and playback the recorded voice.

ISD1790

Figure 1
Winbond ISD1790 Chip Order Series provides
high-quality,
fully
integrated,
single-chip,
Record/Playback solutions for 90 second messaging
applications. In addition, it can be operated in either
standalone or SPI (microcontroller) mode. The CMOS
devices include an on-chip oscillator (with external
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

operation. To solve this, Global Erase must be


performed. Recordings are stored into on-chip
nonvolatile memory cells, providing zero-power
message storage. Voice and audio signals are stored
directly into memory in their natural form, providing
high-quality, solid-state voice reproduction. The
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.
Sampling
Frequency
(kHz)

Rosc
(k)

Message
Duration

12
8.0
6.4
5.3
4.0

53
80
100
120
160

60
90
112
135
180

Minimum
Storage
Resolution
(msec)
83.3
125
156
187
250

Table 1
For detailed information about ISD1790, please refer to
the datasheet which can be found at ISD1790 Design
Guide.

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

ROBOT . HEAD to TOE


PR17 Voice Recording and Playback: ISD1790

PIC16F877A
This powerful (200 nanosecond instruction execution)
yet easy-to-program (only 35 single word instructions)
CMOS FLASH-based 8-bit microcontroller packs
Microchip's powerful PIC architecture into an 40- or
44-pin package and is upwards compatible with the
PIC16C5X, PIC12CXXX and PIC16C7X devices.
Features of the device:

256 bytes of EEPROM data memory


self programming
ICD (in circuit debugging function)
2 Comparators
8 channels of 10-bit Analog-to-Digital (A/D)
converter
2 capture/compare/PWM functions
synchronous serial port can be configured as
either 3-wire Serial Peripheral Interface
(SPI) or the 2-wire Inter-Integrated Circuit
(IC) bus
Universal Asynchronous Receiver Transmitter
(UART).

All of these features make it ideal for more advanced


level A/D applications in automotive, industrial,
appliances and consumer applications.

Figure 2
Figure 2 shows the pin diagram for PIC16F877A. For
more information about the PIC microcontroller, please
refer to the datasheet. The datasheet can be found in
microchip web site at: http://www.microchip.com

Interface PIC16F877A with ISD1790


Pin
24
23
26

Name
REC
PLAY
FWD
VOL

Pin function
Record(Standalone)
Play(Standalone)
Forward(Standalone)

22
7
6
5
4

FT
SS
SCLK
MOSI
MISO

10

MIC+

11

MIC-

Feed-Through
Slave Select
Serial Clock
Master Out Slave In
Master In Slave Out
Non-inverting input
of differential
microphone signal
Inverting input of
differential
microphone signal

20

Rosc

Oscillator Resistor

18

AGC

Automatic Gain
Control

LED

LED

VCCD

Supply voltage
(digital)

28

VSSD

Ground (digital)

21

VCCA

Supply voltage
(analog)

VSSA

Ground (analog)

14

VCCP

16

VSSP1

12

VSSP2

19

HARDWARE
This project will require following hardware:
a.
b.
c.
d.
e.
f.

1 x PIC16F877A
1 x PR17 Printed Circuit Board (PCB)
1 x ISD1760
1 x 2x16 LCD
1x Jack Socket
Related electronic components

Please refer to Appendix A for the PCB layout of PR17.


The PCB layout is provided free therefore Cytron
Technologies will not be responsible for any further
modification or improvement.

Volume Control

Supply voltage
(PWM Speaker
Driver)
Ground ( Positive
PWM Speaker
Driver)
Ground ( Negative
PWM Speaker
Driver)

15

SP+

SP+

13

SP-

SP-

Connection
RA0
RE2
RC0
Connect to
push button
RD3
RE1
RC3
RC5
RC4
Connected
to MIC
Connected
to MIC
Connected
to 82k
resistor
Connected
to 4.7uF
electrolytic
capacitor
Connected
to LED
Connected
to 5V
Connected
to GND
Connected
to 5V
Connected
to GND
Connected
to 5V
Connected
to GND
Connected
to GND
Connected
to positive
pin of
speaker
Connected
to negative
pin of
speaker

Table1
*For more information about pin that is not shown in
the table 1, please refer to ISD1790 datasheet.

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

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
microcontroller

programming

PIC

Figure 3

Power supply for the circuit

Figure 7
Figure 4
User can choose either AC to DC adaptor (not included
in the DIY project set) or 9V-12V battery (not included
in the DIY project set) to power up the circuit. Higher
input voltage will produce more heat at LM7805
voltage regulator. Typical voltage is 12V. Anyhow,
LM7805 will still generate some heat at 12V. There are
two type of power connector for the circuit, DC plug
(J1) and 2510-02 (Power Connector). Normally AC to
DC adaptor can be plugged to J1 type connector.
Refer to Figure 4, the D1 is used to protect the circuit
from wrong polarity supply. C1 and C3 are used to
stabilize the voltage at the input side of the LM7805
voltage regulator, while the C2 and C4 are used to
stabilize the voltage at the output side of the LM7805
voltage supply. LED is a green LED to indicate the
power status of the circuit. R13 is a resistor to protect
LED from excessive current that will burn the LED.

Push Button
microcontroller

as

input

for

The basic connection for In-Circuit Serial Programmer


(ICSP) is as displayed in Figure 5. There are several
types of USB in-circuit programmer can be found in
Cytron, for example, UIC00B. However, programmer
is not included in this DIY project package since the
programmer can be reused for other projects.
For the instruction of using a PIC programmer, please
refer to the particular PIC programmer users manual at
Cytron website (http://www.cytron.com.my)

Interface LCD (2x 16 Character) with


PIC16F877A
To use the LCD display, users have to solder 16 pin
header pin to the LCD display. LCD used in this
project is RT1602C, for other type of LCD, please
refer to its data sheet.

PIC

Figure 8

Figure 5
One I/O pin is needed for one push button as input of
PIC microcontroller. The connection of the push button

Figure 8 is a 2X16 character LCD. LCD connection pin


and function of each pin is shown:

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

ROBOT . HEAD to TOE


PR17 Voice Recording and Playback: ISD1790
Pin
1
2
3

Name
VSS
VCC
VEE

RS

R/W

7
8
9
10
11
12
13
14
15

DB0
DB1
DB2
DB3
DB4
DB5
DB6
DB7
LED+

16

LED-

Pin function
Ground
Positive supply
for LCD
Brightness adjust

Select
register,
select instruction
or data register
Select read or
write
Start data read or
write
Data bus pin
Data bus pin
Data bus pin
Data bus pin
Data bus pin
Data bus pin
Data bus pin
Data bus pin
Backlight positive
input
Backlight
negative input
Table 2

Connection
GND
5V
Connected to
a trimmer to
adjust LCD
brightness
RD6

PCB circuit board


1
2

11
4

12
10

15
13

19
16

GND
20

RD7
RB0
RB1
RB2
RB3
RB4
RB5
RB6
RB7
a resistor to
limit
excessive
current
GND

17

18

14
Figure 10
Component:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.

Figure 9

13.
14.
15.
16.
17.
18.
19.
20.

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

2510-02 connector, (to use either 9V battery


or 12V battery to power up the circuit).
Slide switch (to ON or OFF the circuit).
AC-DC adaptor socket (to use power supply
from AC-DC adaptor).
Power indicator LED (to indicate the power
status of the circuit).
Crystal (20MHz).
PIC 16F877A (the main brain of the system).
Push buttons.
Diode (to protect the circuit from wrong
polarity power input).
Capacitor (to stabilize the output voltage of
the 7805 voltage regulator).
LED.
LM7805 (voltage regulator, supply 5V for
PIC).
ICSP box header (to connect to PIC
programmer to program the microcontroller).
ISD1760 (chip to record and playback voice).
Reset button (to reset the microcontroller).
ISD1760 support component.
Microphone (to record voice).
2510-02 connector, (to connect to an external
speaker).
LM386 (Low Voltage Audio Power Amplifier)
Audio Socket
LCD (2x16 characters)

ROBOT . HEAD to TOE


PR17 Voice Recording and Playback: ISD1790
For more information about the software for this
system, please refer to the source code provided. The
explanation of each instruction is provided in the
source code as the comment of each line.

SOFTWARE
Flow Chart:

The source code is provided free and Cytron


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

Start

GETTING START

Initialize PIC

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.
Is Select
pressed?

Yes

Increase
mode

1.

No

Is Enter
pressed?

Yes

Execute
current mode

No

Mode 1: SPI mode


Control ISD 1790 using SPI interface (Play and
record messages at certain locations). There are
two options in recording sound clip which are
either using mic or audio input.
Beware that before entering this mode, user is
advised to perform Global Erase operation if
Standalone mode is used earlier to avoid
overlapping of messages. If the Alert LED flashes
seven times, Global Erase operation must be
performed as an error has been occurred.
Mode 2: Standalone mode
Control ISD 1790 using I/O ports where it can
playback, record and forward to the next message.
The number of message to be recorded is
unlimited as long as the memory is not full yet.
There are two options in recording sound clip
which are either using mic or audio input. Beware
that before entering this mode, user is advised to
perform Global Erase operation if SPI mode is
used earlier to avoid overlapping of messages. If
the Alert LED flashes seven times, Global Erase
operation must be performed as an error has been
occurred.
Mode 3: Erase mode
In this mode, there are two options which are
Erase operation and Global Erase operation. For
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.

Once user has the hardware set, soldering


process can be started. Please solder the
electronic components one by one according
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.

Caution: Make sure all the connectors (2510) are


soldered in proper side. Those electronic
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.
Warning: Before the battery (Power) is plugged in,
make sure the polarity is correct to prevent
explosion. Wrong polarity of capacitor also
may cause explosion.
2.

Please download the necessary files and


document from Cytron Technologies website.
These included documentation, sample source
code, schematic, component list and software.

3.

The next step is to install MPLAB IDE and


HI-TECC C PRO into a computer. The
MPLAB IDE and HI-TECC C PRO can be
www.cytron.com.my.
downloaded
from
Please refer MPLAB IDE installation step
document to install the software. The
documents can be used to any version of
MPLAB IDE software.

4.

After the installation complete, open the


project file provided using MPLAB IDE.
Please refer MPLAB Open Project document
to open the sample program.

5.

Plug in power supply for the circuit. User can


choose to use battery or AD to DC adaptor.

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

ROBOT . HEAD to TOE


PR17 Voice Recording and Playback: ISD1790

AC to DC adaptor:

9.

Have fun!

TEST METHOD
SPI Mode
1.

2.
12V Polarity
Figure 11 (not included in DIY project set)

9V battery connector:
3.

Figure 12 (not included in DIY project set)

Connection to the PCB board:

Figure 13
6.

7.

8.

Build the project and load the hex file into the
PIC microcontroller using the USB In-Circuit
Programmer (UIC00B). When user builds the
project, MPLAB IDE will generate hex file.
The hex file generated from MPLAB IDE will
be named according to project name, not C
file name. Cytron Technologies also provides
hex file for user. Do not forget to switch ON
the power. The programmer is not included in
the hardware set but it can be found at Cytron
website. (User manual is provided at website
as well).
User can modify this program. After
modification, build the project once again and
load the hex file into the PIC microcontroller
using Cytron USB In-Circuit Programmer
(UIC00B).
Test the functionality of the PCB board.

4.
5.

Switch ON the power


Power Led (green) will turn ON.
LCD will display Select Mode and 1.
SPI Mode.
Press Enter button
LCD will display Switch Mode and 1.
Play.
When press Select button, the second line
of LCD display will change to 2.
Record
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.
However, if 2. MIC is selected;
the sound clip will be recorded
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
recording process has finished.
The procedures are the same if user
chooses to record for Message 2.
Press Reset button
Choose Play under SPI mode.
If user wants to play back the Message 1
that has recorded, choose Message 1
for the Location.
LCD will display **playing the first
message** and will display
***halt*** when 46 seconds are over.
If user wants to play back the recorded
Message 2, press Select button again and
choose for Message 2.
Same procedures for playing back
Message 2.

Standalone Mode
1. Reset the PIC
2. If user has recorded for both Message 1 and
Message 2, it is advisable to perform Global

Created by Cytron Technologies Sdn. Bhd. All Rights Reserved

ROBOT . HEAD to TOE


PR17 Voice Recording and Playback: ISD1790

3.
4.

Erase operation to avoid overlapping of


messages. Otherwise, user can skip this step.
Choose Erase mode before entering
Standalone mode.
Select Global Erase and press Enter.
LCD will display Memory Cleared.
All messages have been erased.
Press Select button and Enter button to choose
for Standalone mode.
Choose Record mode under Standalone mode.
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.
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**.

5.

User can only erase the first or the last


message each time.
If user wants to delete all the messages,
choose Global Erase operation under Erase
mode.
LCD will display Memory Cleared.
All messages have been erased.

If all the steps mentioned above can be executed, your


project is done successfully. Congratulation!!

WARRANTY
No warranty will be provided as this is DIY project.
Thus, user is advised to check the polarity of each
electronic component before soldering it to board.

5.

6.

If user to wish to record another sound


clip, repeat step 3 and 4 after pressing
Reset button.
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.
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

ROBOT . HEAD to TOE


PR17 Voice Recording and Playback: ISD1790

Appendix A
PCB Layout:
Adaptor
2510-02 Socket LM7805
Connector

20MHz
Crystal

E-Cap
10uF
c-cap 104

Box
Header

Preset 2510-02
E-Cap LM386 103 Connector
100uF
E-Cap
c-cap 562 220uF
ISD1790

PIC16F877A

E-Cap
4.7uF Jack Socket
Preset
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

You might also like