Академический Документы
Профессиональный Документы
Культура Документы
RECORDING
MAY, 2008
Specially dedicated to
My beloved family, teachers and lecturers who have
Encouraged, guided and inspired me throughout my journey of education.
Acknowledgement
First and foremost, I would like to grab this opportunity to express my sincere
gratitude to my project supervisor, En. Yusri Bin Md. Yunos for the guidance,
motivation, inspiration, encouragement and advice throughout the duration of
completing this project. Without his never ending support and interest, I have no idea
to process my project. My sincere appreciation also extends to my entire course
mates who have provided assistance at various occasions. Not forgetting my fellow
friends, who shared a lot of technical knowledge with me, encourage me to seek for
more knowledge and providing me some troubleshooting tips. I would like to thank
the senior (SET) from for providing me with the relevant idea. Last but not least, to
my beloved family who has always been there to encourage, comfort and give their
fullest support when I most needed them.
ABSTRACT
Objektif utama projek ini adalah merekabentuk satu sistem kawalan jauh
dengan satu IC rakaman suara (ISD2560). Projek ini bukan sahaja dapat mengawal
“hidup” atau “mati” beberapa alat perkakasan elektrik seperti televisyen and HI-FI,
ia juga dapat digunakan untuk merakam mesej kepada seseorang. Penggabungan
sistem rakaman suara, perhubungan tanpa wayar dan juga konsep “semua dalam
satu”, sistem ini didapati akan membantu menggurangkan bilangan komponen
kawalan jauh dalam setiap rumah dan menjadi hidup lebih menarik. Pengguna boleh
merakamkan mesej atau mengawal alat perkakasan elektrik tertentu dengan hanya
satu sistem sahaja. Terdapat dua bahagian penting dalam projek ini, ialah pembinaan
perkakasan dan penggunaan perisian. Pembinaan perkakasan termasuk mereka
skematik untuk sistem dan meguji komponen secara berasingan. Bagi pembangunan
perisian, pembinaan perhubungan litar dan menambahbaikan algoritma adalah
diperlukan. Beberapa andaian telah dibuat dalam sistem prototaip ini dan cadangan
pembaikan juga dikemukakan.
TABLE OF CONTENTS
TITLE PAGE i
DECLARATION ii
DEDICATION vi
ACKNOWLEDGEMENT vii
ABSTRACT viii
ABSTRAK ix
TABLE OF CONTENT x
LIST OF TABLE xiii
LIST OF FIGURES xiv
LIST OF ABBREVIATIONS xvi
LIST OF APPENDICES xviii
PART ONE
THESIS CONTENT
1 INTODUCTION
1.1 Overview 1
1.2 Project Objectives 2
1.3 Problem Statement 2
1.4 Project Scopes 3
1.5 Methodology and Approach 4
2 LITERATURE REVIEW
2.1 Overview 7
2.2 Conventional Remote Control system 7
2.3 Microcontroller 8
2.3.1 PIC16F877A Microcontroller 9
2.3.1.1 PIC16F877A Memory 11
Block
2.3.1.2 I/O Ports 14
2.4 ISD2560 18
2.4.1 Features 19
2.4.2 Detailed Description 20
2.4.3 Pin Description 20
2.4.4 Operation Modes 27
2.4.5 Typical Application Circuit 28
2.5 Voltage Regulator 29
2.5.1 Fixed Positive Voltage Regulator 29
7805
2.6 Infrared 30
2.7 Bootloader 31
2.8 MPLAB 7.62 32
3 Hardware Development
3.1 Introduction 34
3.2 Description of Remote Control with Message 34
Recording
3.3 Input and Output of the System 36
3.4 Assumptions of the System 36
3.5 Sk40A 37
3.6 ISD2560 40
3.7 Flow Chart 41
3.8 Infrared Module 43
3.9 System Schematic and Path List 44
4 Software Development
4.1 Overview 48
4.2 Software Development Environment 48
4.3 Programming with MPLAB 7.62 49
4.4 Bootloader with Hyper Terminal 55
4.5 Source Code 60
6 Conclusion
6.1 Overview 65
6.2 Conclusion 67
REFERENCES 67
Appendices A- C 70-89
LIST OF TABLES
Ω - Ohm
μ - micro
COM - Communication
CPU - Central processing unit
DC - Direct current
EEPROM - Electrical erasable programmable real – only memory
F - Farad
h - Hexadecimal
Hz - Hertz
IC - Integrated Development Environment
IR - Infrared
IrDA - Infrared Data Association
I/O - Input / Output
JDM - Jens Dyekjaer Madsen
LED - Light emitting diode
m - milli
MCU - Microcontroller unit
MSB - Most Significant bit
OEM - Object Exchange Model
OSC - Oscillate
PIC - Peripheral interface controller
PC - Personal computer
PWM - Pause width modulation
RAM - Random access memory
RC - Resistor and capacitor
RISC - Reduces instruction set computing
ROM - Read only memory
Rx - Receiver
s - Seconds
TTL - Transistor-transistor logic
TV - Television
Tx - Transmitter
UART - Universal Asynchronous Receiver Transmitter
USB - Universal Serial Bus
W - Watt
LIST OF APPENDICES
PROJECT OVERVIEW
1.1 Introduction
Nowadays, every home has remote control, something not only one, but a lot.
This already brings trouble to the users. Beside that, if a battery of one remote
control is finished. Other electronic device also can’t be operating.
Beside that, we always realize that most of the people prefer stick a small
paper in front of fridge for leaving a message to somebody. However, they do not
know that the small paper something will miss or fall always. And this will cause lot
problems. So that, with my project “all in one remote control with integrate sound
record” can overcome all of this problem and became one of the device that replace
traditional remote control.
1.4 Project Scope
This system design has consists of two parts, the first part would be the
message recording chip and another is PIC microcontroller. Human voice will be
input to the system and will be recorded to the chip and the voice can be play back.
However, the microcontroller plays the important role in setting up the connection
and became the mastermind behind the whole operation. The microcontroller will
receive input and process input from user through the switches and sending output to
the LED through infrared. Generally, there are four main scopes of work in this
project which includes:
System features design includes the initial idea of enhancing the current
remote control and the features that can be added into it. Then, hardware
development comes into places where various components are identified and
purchased. Later on, all the components needed are connected according to the
schematic and circuit designed. The circuit will be tested according to the schematic
and circuit designed. The circuit will be tested on the connectivity and will be
troubleshoot accordingly if the system fails. Training will be given to the system to
test on its functions and modes. Further testing is required to make sure that the
system is reliable and provides high quality output.
1.5 Methodology and Approach
1. hardware setup
2. programming for PIC microcontroller and testing
3. infrared connection setup and testing
4. ISD 2560 connection and testing,
5. PIC microcontroller and ISD 2560 integration.
The initial stage of the project would be planning and study on the component
needed to set up the prototype for microcontroller based circuit and ISD 2560.
Programming scripts are produced to enable microcontroller to communication with
the DIL switch and produce the output. Infrared connection is established
independently before integration.
The Figure 1.1 show the methodology and approaches for the project:
There are three different ways to burn the program into the PIC:
LITERATURE REVIEW
2.1 Introduction
The first TV remote control, called “Lazy Bones” was developed in 1950 by
Zenith Electronics Corporation (then knows as Zenith Radio Corporation). Lazy
Bones used a cable that ran from the TV set to the viewer. A motor in the TV set
operated the tuner through the remote control. Although customers liked having
remote control to their television, they complained that people tripped over the
unsightly cable that meandered across the living room floor. Then, in 1956, Robert
Adler invented the Wireless TV Remote Control. By the early 1980s, the industry
moved to infrared, or IR, remote technology. The IR remote works by using a low
frequency light beam, so low that the human eye can not see it, but which can be
detected by receiver in the TV. The light used in a standard remote control to carry
the commands from the user to the appliance is the near-infrared range frequency of
approximately 980 nanometers, the edge of visibility. Today, remote control is a
standard feature on the other consumer electronic products, including VCRs, cable
and satellite boxes, digital video disc player and home audio receivers. A simple
remote control basically has a few basic buttons such as button 0-9, channel up and
down, volume up and down, power on/off, enter and mute. They are usually powered
by small AAA or AA size batteries.
2.3 Microcontroller
From the block diagram above, PIC16F877A contains Data EEPROM and
FLASH Program Memory. The Data EEPROM and FLASH Program Memory are
readable and writeable during normal operation (over the full VDD range). There are
three memory blocks which are data memory, program memory as well as stack. The
program Memory and Data Memory have separate buses so that concurrent access
can occur.
Figure 2.4 indicates the program memory map and stack of PIC16F877A and
how subroutine being executed.
Figure 2.4 Program memory map and stack
The data memory is partitioned into multiple bank which contains the
General Purpose Registers and the Special Function Registers. Bits RP1 and RP0 are
the bank select bits. Each bank extends up to 7Fh (128 bytes). The lower locations of
the each bank are reserved for the Special Function Registers. Above the Special
Functional Registers are General Purpose Registers, implemented as static RAM. All
implemented banks contain Special Function Registers.
The Input/ Output are the means by which the microcontroller communicates
to the environment which is outside the microcontroller system. I/O tends to be
groped into bytes wide ports (8 bits). I/O direction is relative to the microcontroller.
There are several types of ports: input, output or bidirectional ports.
Port A is a six bit wide, bi-directional port. Reading the port A’s register
reads the status of the pins, whereas writing to it will write to the port latch. All write
operations are read-modify-write operations. Therefore, a write to a port implies that
the port pins are read; the value is modified and then written to the port data latch.
Pin RA4 is multiplexed with the Timer 0 module clock input to become the
RA4/TOCKI pin. The RA4/TOCKI pin is a Schmitt Trigger input and open-drain
output. all other Port A pins has TTL input levels and full CMOS output drivers.
Other Port A’s pins are multiplexed with analog inputs and the analog VREF input
for both the A/D converters and the comparators.
Port D is another eight bits port with Schmitt trigger input buffers. Each pin is
individually configurable as an input or output. Port D can be configured as an eight
bits wide microprocessor port (Parallel slave Port). In this mode, the input buffers are
TTL.
Port E has three pins only, which are individually configurable as input or
outputs. These pins have Schmitt trigger input buffers. The Port E pins become the
TTL. Port E pins are multiplexed with analog inputs. When selected for analog input,
these pins will read as zero. TRISE controls the direction of the RE pins, even when
they are being used as analog inputs. On a Power-on Reset, these pins are configured
as analog inputs.
The chip will be further explained from the aspect of sound quality produced,
the duration of the speech recording, the memory storage provided and the
programming availability of the chip. ISD2560 offered at 8.0 kHz sampling
frequency, allowing the sound quality produced to be quite good. The speech
samples are stored directly into on-chip nonvolatile memory without the digitization
and compression associated with other solutions. Direct analog storage provides a
very true, natural sounding reproduction of voice, music, tones, and sound effects not
available with most solid-state digital solutions.
Table 2.3 briefly describes the function of each pin of ISD2560 series and
Figure 2.10 shows the device pin outs.
The ISD2560 is designed with several built-in operational modes that provide
maximum functionality with minimum external components. The operational modes
are accessed via the address pins. When the two most significant bits (MSB) A8 and
A9 are HIGH, the remaining address bits are interpreted as mode bits Table 2.4
summarizes 6 operational modes for ISD2500 series. The mode control is set with
respective to the address pin. The jointly compatible feature allows some modes to
be used simultaneously.
2.6 Infrared
2.7 Bootloader
MPLAD 7.62 help to compile, assemble and link the software using the
assembler or compiler and linker to convert the code into “ones and zeros”, which is
machine code for the PIC micro MCUs. Its programmer’s Editor helps write correct
code with the language tools of choice. The Editor is aware of the assembler and
compiler programming constructs and automatically “color-key” the source code to
help ensure it is syntactically correct. The Project Manager enables to organize the
various files and library files. When building the code, you can control how
rigorously code will be optimized for size or speed by the compiler and where
individual variables and program data will be programmed into the device. If the
language tools run into errors when building the application, the offending line is
shown and can be “double-clicked” to go to the corresponding source file for
immediate editing. After editing, press the “build” button to try again. Often this
write-compile-fix loop is done many times for complex code.
The MPLAD also involves in testing the code. Usually a complex program
does not work exactly the way we imagined, and bugs need to be removed from the
design to get proper results. MPLAB 7.62 has components called “debuggers” and
free software simulators for all PIC microcontroller MCUs to help test the code.
CHAPTER III
Hardware Development
3.1 Introduction
This chapter will discuss about the development of the remote control system
using microcontroller and its interfacing circuit, ISD2560 and infrared module. The
hardware development generally involves the circuit design the whole system,
modular testing and how three different main modules were interconnected. This
chapter also provides the description of the project in detail based on the features of
this system.
This system is divided into 2 paths; there are ISD2560 sound recording and
remote control. When we are operating the ISD2560 sound record chip, it can use to
record and playback. The period for recording maximum is 60 second. However, at
the same time we can’t use the infrared until the sound chip is disabled. After the
sound chip switch off, the all in one remote control will functional. These remote
control dints like the normal remote control but it can control the electrical devices
depend on the program we write inside the microcontroller.
Stage 1
ISD2560 switch ON Speaker-
PIC Playback
Microcontroller ISD
Idle 2560
Mic-
Record
Stage 2
ISD2560 switch OFF
Infrared
Device 1
PIC
ISD2560 Idle microco Infrared
ntroller
Device 2
Referring to the Figure 3.2 above, there are different input and outputs for
each module from end to end. Table 3.1 show the signal that a module receives an
generates.
When a user switch on switch 1, a signal will send to the microcontroller for
run the ISD2560 sound recording while the remote control work like idle. The
PIC16F877A microcontroller acts as a central processing unit to receive the
incoming microcontroller signal. When the switch 1 OFF, switch 2 and 3 will be
used for control the electrical devices.
The project is proposed and designed to implement the idea of remote control
integrated with sound recording. Therefore, in order to prototype the system, several
assumptions are made.
• The status of LED shows the power state of device (ON or OFF).
• Switch is used to replace the keypad of remote control.
3.5 SK40A
The Reset and Boot button created can be used in development purpose.
Besides that, SK40A has onboard voltage regulator, 7805 which will provide stable
5V output to the PIC16F877A and other application from its wide range of input
voltages (7V-30V). therefore, user may extend the 5V from SK40A kit for external
use, no extra voltages is necessary. However, to overcome the problem of using
battery, adapter which can provide 5V, 0.5A was used. Once power is provided,
Power ON LED will light up. The features of the Sk40A do help to ready the
microcontroller. Once the program is ready and a hex file is generated, power is
provided to start-up kit, a serial cable is used to connect the SK40A to the serial
communication port at computer to enable the program uploading. Figure 3.3 show
the SK40A and some important indications on board and figure 3.4 shows the
schematic of Sk40A.
The microphone inputs (pins 17 and 18) are connected differentially via
22mF capacitor to a microphone for low noise operation. Audio output comes
directly from the ISD2560 via speaker pins 14 and 15. Additional circuitry composed
of 220Ω resistor turns on the recording indicator LED when pins27 (P/R’) are low.
Pin 27 (P/R’) is connected to a toggle switch which will determine whether the
ISD2560 is in record mode or playback mode. There are 10 address lines on the
ISD2560. these can be hardwired to the correct modes of operations. However, the
two Most Significant Bits are HIGH (A8 and A9) so that the other 8 address lines are
interpreted as Mode bits according to the Operational Modes. There is 480k of
memory on the chip and this can be accessed non-sequentially by using the address
lines. There are address from 00 to 257 hexadecimal. The messages can also be
played sequentially or one message can be played in a loop depending on what mode
the chip is in. As mentioned, some of the modes can be used simultaneously to
provide better solutions.
The circuitries on the other pins of the ISD2560 are connected so that the IC
will function as the steps below in push button modes:
• Bring PD high, then low to stop the current cycle and reset the devices.
• Set P/R’ high to play, low to record.
• CE’ pin (high-low-high) to start the cycle.
• Bring PD high to stop record cycle and reset the device.
3.7 Flow Chart
The flow chart describes the system flow of recording and playback process.
START
STOP/RESET (PD) =
low
LED Green = ON
Activate recording
process (P/R’= low)
LED Yellow = OFF
Press START/PAUSE
(CE’) button to start
LED Red = ON
Recording starts
User talks to the
microphone (>60s)
END
In this recording process (Figure 3.5), the PD pin (Stop/Reset) first has to be
low using a mini slide switch. LED green will light on. Also, the P/R’
(Playback/Record) pin is taken low to activate the record mode and at the same time
LED yellow will light on. Now, the system is ready for doing recording. We have to
press the CE’ pin (Start/Pause) button when speak to the microphone and release it
when stopping. The voice input will be saved in the memory inside the chip. The
maximum duration of the recording is 60 seconds. The chip will always monitor the
timing and user is expected not to recording a message more then 60 second length.
If the chip overflows, the chip will end the recording immediately.
START
STOP/RESET (PD) =
low
LED Green = ON
Activate recording
process (P/R’= high)
LED Yellow = ON
Starting playback
END
In this project, both wired and wireless communication techniques are applied
to implement this all in one remote control system. The processing circuit as
illustrated in figure 3.7 and figure 3.8 is the main circuit design of the system. This
part of the system comprises most of the components compared to the infrared
module which is only a modeling circuit to represent devices. The components used
in the processing circuit are as listed below:
Figure 3.7 show the schematic of the processing circuit while the figure 3.8
illustrates ISD2560 sound record path. The system is presented in two schematic
diagrams because of it complexity.
Figure 3.8 Processing circuit
Figure 3.9 ISD2560 connection
Table 3.2 summarizes the part list of two schematic diagrams above. Two
sets of infrared module are used to represent two devices to implement multiple
devices controlling.
SOFTWARE DEVELOPMENT
4.1 Overview
The software skills are important is this project in order to develop a fully
functional remote control system. In this chapter, the discussions are mainly about
the environment for programming, load the program into microcontroller and
modifications to simplify the program flow.
Two software programs are used in this project, which are MPLAB 7.62 as
compiler to the program, and Hyper Terminal for bootloader.
4.3 Programming with MPLAB 7.62
Then create a new project file by given a name “remote control” and browse
it location.
From the MPLAB 7.62, the program is ready and a *.hex file is generated.
Bootloader is used to load the program into SK40A. There are several procedures
before the loading process. The PIC16F877A is plugged in and the position is checked
to be correct. Power is provided to the start up kit. A serial cable is used to connect the
start up kit and the serial port of the computer as shown in Figure 4.2
Next, two steps needed to change the character delay. First, select “Call -
Disconnect”. Second, select “File - Properties - Setting” and go into “ASCII Setup”
submenu. The character delay is changed to 10miliseconds as illustrated in Figure
4.3(d) and Figure 4.3(e).
The connection is saved with filename preferred and the Hyper Terminal is
closed. The connection file saved is launched again from “Start - All Programs -
Accessories – Communication – Hyper Terminal - *.ht”. For SK40A to enter the boot
mode and wait for hex file, press and hold down the “Boot” button then press the
“Reset” button. The “Reset” button is released before release the “Boot” button. Once
the buttons are released, the wording www.cyctron.com.my will appear on the screen
as shown in figure 4.3(f). The *.hex file is transferred to the PIC16F877A through
“Transfer - Send Text File” and select “All files” from “Files of type”. The *.hex file
of program which is already complied and generated using MPLAB 7.62 is selected.
This process might take a couple minutes depending on the program length. When the
transfer is successful, the wording “Done! Reset PIC to run” will appear on the screen
as shown in Figure 4.3(g).
The complete program with comments of this remote control system is shown
like Figure 4.8 below. The program is written in C language.
5.1 Overview
For this chapter, some result obtained from the project testing were summarized
and discussed. The main important outcome of this project was the establishment of the
sound record and the functionality of this remote control system.
5.2 Result
As mentioned, the result of the system will be more focused on the signal
received by the infrared receiver and output quality of the ISD2560. With refer to the
table above, the system actually consists of two path: remote control and sound record.
3 switches in the system will use to control its function. With refer to the figure 5.1
below with more easy understand how this 3 switch control.
START
Switch 1 ON?
Yes No
END
5.3 Discussions
From the results, there were several clarifications and extra points that can
be summarized. Some main features of the system were discussed as well.
There are several problems that occurred in the progress of the accomplishing
the project, however, all the problems were solved and the system has been improved.
CONCLUSION
6.1 Overview
This chapter is to provide a summary of the project done and some future
improvements that can be made to enhance the system.
6.2 Conclusion
In short, the project developed was able to provide satisfaction and comfort to
users. The features of current remote control system in many aspects were enhanced to
provide best solution to user in their daily life problems. So, the objectives of the
project were achieved. This project has been completed in two semesters. Although the
project was performing well but some improvements as stated above were necessary in
the future. So, all information in this project may be used for future work of research
and improvement to fulfill an engineer’s duty that is to provide human welfare and
public interest.
REFERENCE
[1] Dogan Ibrahim, PIC Basic Programming and Project. Great Britain: Biddles
Ltd.
[2] Jack R. Smith (2005), Programming the PIC microcontroller with MBasic.
Amsterdam: Elsevier/ Newnes.
[4] John Iovine (2000). PIC Microcontroller Project Book. New York: Mc
Graw-Hill.
[7] Robert L. Boylestad, Louis Nashelsky (2006), Electronic Devices and Circuit
Theory. Prentice Hall.
[8] Peatman, John B (1998), Design with microcontrollers. Upper Saddle River,NJ:
Prentice Hall.
[12] Halpern, Richard (1997), C for Yourself: learning C using experiments. Oxford:
Oxford University Press.
[13] Cytron Enterprises (2005). SK40A PIC Microcontroller Start-Up Kit. 1st. ed.
Malaysia.
[14] Microchip Technology (2003). MPLAB 7.62 Quick Start Guide. 1st ed. USA.
[15] Microchip Technology (2003). MPLAB 7.62 User Guide. 1st ed. USA .
[16] Microchip Technology (2001). PIC16F877XA Data Sheet. 1st ed. USA.
[17] ChipCorder Technology (2006). Using Extrernal Speaker Amplifier with the
ISD Single Chip Voice Record/Plackback Devices. 1st ed. USA
[18] ChipCorder Technology (2006). Good Audio Design Practices. 1st. ed. USA
[23] Alkin, Glyn (1996), Sound Recording & Reproduction, Oxford: Focal Press.
[24] Otte,Rob (1999), Low-Power Wireless Infrared Communication, Boston, MA:
Kluwer Academic Publishers
[25] Chow Chee Siang (2007). Remote Control Using Bluetooth To Infrared
Converter. Universiti Teknologi Malaysia: Degree Thesis
[26] Yew Shan Ju (2007). Infrared Remote Control With Messaging Applications.
Universiti Teknologi Malaysia: Degree Thesis
APPENDIX A
Device Operation
APPENDIX C
Operation Modes