REMOTE CONTROL USING INFRARED WITH MESSAGE RECORDING
GUY KANG SHEN
UNIVERSITI TEKNOLOGI MALAYSIA 2008
REMOTE CONTROL USING INFRARED WITH MESSAGE RECORDING
GUY KANG SHEN
This thesis is submitted as a partial fulfillment For the Degree of Bachelor In Electrical Engineering
Faculty of Electrical Engineering Universiti Teknologi Malaysia
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
The primary objective of this project is to design a remote control system integrated with a sound record IC (ISD2560). This project not only can let user turn on or off multiple devices such as television and HI-FI, it also can leave message to somebody. The combination of sound record system, wireless communication and also the concept of “all in one” are adapted to the design which helps to reduce the number of remote control at home and make the life more interesting. The users either can leave a message or control the desired devices by just using this system only. There are two main parts in the system, which are hardware and software development. The schematic design for the system and components testing in standalone state are include in hardware development. While the software skill developed include drive circuit connection establishment and improvements to algorithm.
Some
assumptions
are
made
in
the
recommendations or future improvements are suggested.
prototype
system
and
ABSTRAK
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
CHAPTER
TITLE
PAGE
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
2
1.3
Problem Statement
2
1.4
Project Scopes
3
1.5
Methodology and Approach
4
LITERATURE REVIEW 2.1
Overview
7
2.2
Conventional Remote Control
2.3
Microcontroller
8
2.3.1
PIC16F877A Microcontroller
9
2.3.1.1
11
system
PIC16F877A Memory
7
Block 2.3.1.2 2.4
2.5
I/O Ports
14
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
Voltage Regulator
29
2.5.1
29
Fixed Positive Voltage Regulator 7805
3
2.6
Infrared
30
2.7
Bootloader
31
2.8
MPLAB 7.62
32
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
4
5
6
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
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
Result and Discussion 5.1
Overview
61
5.2
Result
62
5.3
Discussion
63
5.4
Problem Encountered
64
Conclusion 6.1
Overview
65
6.2
Conclusion
67
REFERENCES
67
Appendices A- C
70-89
LIST OF TABLES
TABLE
TITLE
PAGE
2.1
PIC16F877A devices features
10
2.2
PIC16F877A memory Bank select bits
14
2.3
Positive voltage regulator
20
2.4
Pin name, number and its function
27
3.1
In/ Out different modules
36
3.2
Port list for remote control system
47
5.1
Result
62
LIST OF FIGURES
FIGURE
TITTLE
PAGE
1.1
Methodology and Approach
4
2.1
Block diagram of a single chip microcontroller
8
2.2
Block diagram of a center processing unit (CPU)
8
2.3
Block diagram of PIC16F877A
11
2.4
Program memory map and stack
13
2.5
Simplified input- output unit
14
2.6
Block diagram of RA3:RA0 pins
15
2.7
Block diagram of RB3:RB0 pins
16
2.8
Block diagram of RB7:RB4 pins
17
2.9
ISD2560 device block diagram
18
2.10
ISD2560 device pin outs
26
2.11
ISD2560 application schematic examples
28
2.12
Fixed linear voltage regulator 7805
30
2.13
Bootloader enabled PIC16F877A schematic
32
3.1
Basic system flow
35
3.2
System flow
35
3.3
SK40A
38
3.4
Schematic of SK40A
39
3.5
Recording process in flowchart
41
3.6
Playback process in flowchart
42
3.7
Infrared module
43
3.8
Processing circuit
45
3.9
ISD2560 connection
46
4.1(a)
MPLAB 7.62
49
4.1(b)
Project wizard
50
4.1(c)
Device selection
50
4.1(d)
Active tool suite
51
4.1(e)
Project name and browse
51
4.1(f)
File adding
52
4.1(g)
Project parameter
52
4.1(h)
Build the project
53
4.1(i)
Build option
54
4.1(j)
Linker option
54
Preparation for bootloader
55
4.3(a)
New connection
56
4.3(b)
Connect using COM1
56
4.3(c)
COM1 properties
57
4.3(d)
Bootloader properties
58
4.3(e)
ASCII setup
58
4.3(f)
Bootloader started
59
4.3(g)
Bootloader ended
59
4.4
Source code
60
5.1
Flow of the system
63
4.2
LIST OF ABBREVIATIONS
Ω
- 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 I/O
- Infrared Data Association - 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 RC
- Random access memory - 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 USB W
- Universal Asynchronous Receiver Transmitter - Universal Serial Bus - Watt
LIST OF APPENDICES
APPENDIX
TITLE
PAGE
A
ISD 2560 Voice Record/ Playback Device
70
B
Device Operation
74
C
Operation Mode
79
NO.
CHAPTER I
PROJECT OVERVIEW
1.1
Introduction
In the mid-1980s, many of the external system components such as microprocessor, memory and other build in peripherals has been integrated into the same chip, resulting integrated circuit called microcontroller, and widespread use of the embedded systems became feasible. By the end of the 80s, embedded systems were the norm rather than the exception for almost all electronics devices. Embedded system is a system that has a microcomputer or microcontroller inside which can reads the input , process them and gives the feedback according to the preprogram condition. Embedded systems are designed to do some specific tasks and have minimal requirements for memory and program length. Since microcontroller can provide high usability, this all in one remote control system using infrared with sound recording is designed to support in turning on and off multiple electrical devices such as TV, radio, DVD player at home to provide better performance and functionality compared to current conventional remote control system. Beside that, it also integrated with a sound record chip which use for message recording.
1.2
Project Objective
The objective of this thesis is to implement and monitoring the controlling of all electrical devices and also include sound recording. The comfort offered by this all in one remote control will bring users to the most satisfaction in daily life and thus provider better quality of life. With the least number of remote control, user can control most of the devices at home. With the sound recording chip integrated together, user also can easy to leave messages for their family members. The system is able to provide greater mobility and many more advantages then the conventional remote control system. By using it, users are not required to purchase other message recording system in order to leave message to someone. Through this, people can easy to control and leave message.
1.3
Problem Statement
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:
1.
System features design
2.
Hardware development and prototyping
3.
Software development and testing
4.
System integration and implementation
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
The thesis is organized into five phases to be achieving this project:
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:
Figure 1.1 Methodology and approach
The model of microcontroller that will be used in this project is PIC 16F877A. There is two different way to program the PIC, which is to write the source codes in assembly language (low level language) or C language (high level language). Assembly language can highly optimize the performance and memory usage. However in writing a program for a system, high level language is recommended because it is easier to organize and offers platform independent. A compiler is need to compile the high level language (*.c file) to assembly language and assembler is to produce machine codes (*.hex file) from assembly language. In this project, a MPLAB 7.62 which can function as an editor, compiler as well as assembler is used.
There are three different ways to burn the program into the PIC:
1.
Universal Programmer (ALL-11);
2.
Home Made Programmer (JDM Programmer);
3.
Bootloader
A universal programmer can be used to burn the machine code in various type of PIC microcontroller. JDM programmer is more portable and able to maximize the usage of input and output pin. While for bootloader, the microcontroller could be attached with the circuit board while loading the program to test. In other words, bootloader requires no expensive programmer and avoid the chip from being pulled out from the circuit board. This can further simplify the process of program loading and reduce the risk of damaging the microcontroller chip. We just need a serial cable, microcontroller with bootloader firmware and simple circuitry. So bootloader is chosen for this project for simplicity and low cost.
CHAPTER II
LITERATURE REVIEW
2.1
Introduction
The review of some technical knowledge and additional information about current available solution to conventional remote control system are necessary to identify the major components and design the entire system. In this chapter, some of important hardware devices and software skill which were used in the project are discussed.
2.2
Conventional Remote Control System
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
A microcontroller is a single-chip device that contains memory for program information and data. It has logic for programmed control reading inputs, manipulating data and sending outputs. It is a programmable integrated circuit that can be used to control the operation of the system. In other words, it has built-in interfaces for input/output (I/O) as well as central processing unit (CPU).
Microcontroller differs from a microprocessor in many ways. Microprocessor needs other component like memory, or components for receiving and sending data. However, microcontroller which integrates a number of the components of a microprocessor system onto a single microchip, i.e. the central processing unit (CPU) core, memory for both read only memory (ROM) and random access memory (RAM) and some parallel digital Input/Output.
Figure 2.1 Block Diagram of a single chip microcontroller
Figure 2.1 shows a generic block diagram of microcontroller unit (MCU). Internally, it has three basic parts: the central processing unit, memory and registers. They are connected by an internal bus. Externally, it has pins for power, input/output (I/O), and some special signals. I/O pins are grouped into units called I/O ports.
Figure 2.2 Block Diagram of a Central Processing Unit (CPU)
The CPU controls the operation of the microcontroller. It executes program instructions. Note that the COU has its own registers. The program counter is a special register that tell the CPU where to get an instruction or data byte. The other registers store specialized data or address information. The instruction decoder tells the arithmetic and logic unit what to do with the data. The control sequencer manages the transfer of instruction and the data bytes along the internal data bus. The address register set the condition of the address bus. The external address bus selects a specified location in memory. The data driver conditions data signals to be sent to or from memory or I/O registers.
2.3.1
PIC16F877A Microcontroller
PIC is the family of Reduces Instruction Set Computer (RISC) microcontrollers made by Microchip Technology. It is generally regarded that PIC stands for Peripheral Interface Controller, although General Instruments’ original acronym for the PIC was “Programmable Intelligent Computer”. F is the referred to flash program memory. The PIC16F877A is chosen because of its economical and low cost, available of the chip and its related software and developer. Table 2.1 shows some device features about PIC16F877A.
Table 2.1 PIC16F877A devices features
Some features of PIC16F877A are summarized as follows:
1.
Single-cycle intrusions, except for program branches
2.
Up to 8K words of
Flash Program Memory, 368 bytes of Data
Memory (RAM) and 256 bytes of EEPROM Data Memory 3.
Timer0: 8-bit timer/counter with 8-bit prescaler
4.
Timer1: 8-bit timer/counter with prescaler, can be incremented during sleep Mode Via external.
5.
Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler
6.
Typically 100,000 erase/write cycle Enhanced Flash Program memory
7.
Typically 1,000,000 erase/write cycle Data EEPROM memory
8.
Support both assembly and high level language
9.
Wide operating voltage range (2.0 volts to 5.5 volts)
10.
Low power high speed Flash/EEPROM technology
11.
Low power consumption
12.
Commercial and Industrial temperature ranges
The block diagram of the PIC16F877A is shown in Figure 2.3
Figure 2.3 Block diagram of PIC16F877A
2.3.1.1
PIC16F877A Memory Block
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.
Program memory has been realized in FLASH technology, which makes it possible to program a microcontroller many times before it is installed into a device and even after its installment if eventual changes in program or process parameters should occur. PIC16F877A devices have a 13-bit program counter capable of addressing an 8K words × 14 bit program memory space with an address range from 000h to 1FFFh. Addresses above the range will wraparound the beginning of program memory. The Reset vector is at 000h and the interrupt vector is at 0004h.
PIC16F877A has a group of 8 memory locations of 13 bits width with special function. This group memory is known as stack. It basic role is to keep the value of return address after a jump from the main program to a subprogram. In order for a program to know how to go back to the point where it started from, it has to return the value of a program counter from a stack. When calls a subroutine counter is being pushed onto a stack. When executing instructions such as RETURN, RETLW or RETFIE, which were executed at the end of a subprogram, program counter was taken from a stack so that program could continue where it was stopped before it was interrupted. Besides, the parameter passing from main program to subprogram will cause a temporary memory location build in the stack.
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
Data memories consist of data EEPROM and RAM memories. EEPROM data memory consists of 256 bytes locations whose contents are not lost during losing of power supply. EEPROM is accessed indirectly through EEADR and EEDATA registers. An EEPROM memory usually serves for storing important parameters. There is a strict procedure for waiting in EEPROM, which must be followed in order to avoid accidental writing. RAM memory is partitioned into four banks, which contains the General Purpose Register and the Special Function Registers. Each bank extends up to 128 bytes.
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.
Table 2.2 PIC16F877A Memory bank select bits
2.3.2
I/O Ports
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.
Figure 2.5 Simplified input-output unit
PIC16F877A has five ports with a total 33 input/output pins. Each pin is individually configurable as an input or output. The data direction depends on the setting of the register TRIS at each port. If at the appropriate place in TRIS register a logical “1” is written, then that pin is defined as an input pin , and if is “0” it will become an output pin. Every port has its own address such as Port A is at 05h, Port B is addressed at 06h, Port C at 07h, followed by Port D at 06h and port E at 09h.
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.
Figure 2.6 Block diagram of RA3:RA0 pins
Port B is an 8-bit wide, bidirectional port. Each pin on the Port B has a weak internal pull-up function and is activated by clearing bit RBPU. However, it is automatically turned off when the port pin is configured as an output. The pulls-ups are disabled on the Power-on Reset. There pins of Port B are multiplexed with the InCircuit Debugger and Low-Voltage Programming function: RB3/PGM, RB6/PGC and RB7/PGD.
Another four pins of port B, RB&:RB4 have interrupt-on-change features. This feature occurs when their status changes from logical one into logical zero and opposite. Only pins configured as input can cause this interrupt to occur ,the input pins on RB7:RB4 are compared with the old value latched on the last read of port B. The mismatch output of RB7:RB4 are OR’ed together to generate the RB Port changes interrupt with flag bit RBIF. This interrupt option along with internal pull-up resisters is recommended for wake-up on key depression operation.
Figure 2.7 Block diagram of RB3: RB0 pins
Figure 2.8 Block diagram of RB7:RB4 pins
Port C is an 8-bits wide and bidirectional port. Port C is multiplexed with several peripheral functions. Port C pins have Schmitt Trigger input buffers. When enabling peripheral functions, care should be taken in defining TRIS bits for each Port C pin. Some peripherals override the TRIS bit to make a pin an output, while other peripherals override the TRIS bit to make a pin an input. Since the TRIS bit override is in effect while the peripheral is enabled, read-modify-write instructions with TRISC as the destination should be avoided. RC6 is used for UART (Universal Asynchronous Receive Transmitter) asynchronous transmit while RC7 for asynchronous receive. There two pins are important in data transfer between the RS232 port at PC and microcontroller chip.
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.
2.4
ISD 2560
Information Storage Devices ISD2560 Chip Corder series provides high quality, single chip record/playback solutions for 60 second messaging application. The CMOS devices include an on–chip oscillator, microphone preamplifier, automatic gain control, anti aliasing filter, smoothing filter, speaker amplifier, and high density multilevel storage array. Recordings are stored in on-chip nonvolatile memory cells, providing zero-power message storage. The unique, single chip solution is made possible through ISD patented multilevel technology. Voice and audio signal are stored into memory in their natural form, providing high quality, solid-state voice reproduction.
Figure 2.9 ISD2560 device block diagram
2.4.1
Features
Some features of ISD2560 are:
1.
Easy-to-use single chip voice record/playback
2.
High-quality, natural voice/audio
3.
Manual switch playback can be edge- or level-activated
4.
Directly cascadable for longer durations
5.
Automatic Power-Down (Push- Button mode) •
6.
Fully addressable to handle multiple messages
7.
Zero- power messages storage •
2.4.2
Standby current 1μA (typical)
Eliminates battery backup circuit
8.
On-chip clock source
9.
single +5 volt power supply
10.
100 years message retention (typical)
11.
100,000 record cycles (typical)
12.
Programmer support for play-only application
Detailed Description
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.
ISD2560 offer single-chip solution at 60seconds. Parts may also be cascaded together for longer durations. One of the benefits of ISD’s Chip order technology is the use of on-chip nonvolatile memory; provide zero-power message storage. The message can be re-recorded typically 100,000 times. ISD2560 is ideal for playbackonly applications, where single or multiple messages are referenced through buttons or switches. It also includes all the necessary for microcontroller-driven applications. Once the desired message configuration was created, duplicates can easily be generated via an ISD programmer, which is expensive ($250).
2.4.3
Pin Description
Table 2.3 briefly describes the function of each pin of ISD2560 series and Figure 2.10 shows the device pin outs.
Table 2.3 ISD2560 Pin name, number and its function Pin Name
Pin Number
Ax/Mx
1-10/1-7
Function Address/Mode Inputs: The Address/Mode inputs have two functions depending on the level of the two Most Significant Bits (MSB) of the address (A8 and A9). If either or both of the MSBs are LOW, the inputs are all interpreted as address bits and are used as the start address for the current record and playback cycle. The address pins are inputs only and do not output
internal address information as the operation progresses. Address inputs are latched by the falling edge of CE’. If both MSBs are HIGH, the Address/Mode inputs are interpreted as Mode bits according to the Operational Mode table. There are six Operational Modes (M0…M6) available as indicated in Table 2.2. It is possible to use multiple Operational Modes simultaneously. Operational Modes sampled are each falling edge of CE’, and thus Operational Modes and direct addressing are mutually exclusive. AUX IN
11
Auxiliary Input: The Auxiliary input is multiplexed through to the output amplifier and speaker output pins when CE’ is HIGH, P/R’ is HIGH, and playback is currently not active or if the device is in playback overflow. When cascading multiple ISD2500 devices, the AUX IN pin is used to connect a playback signal from a following device to the previous output speaker drives. For noise considerations, it is suggested that the auxiliary input not be driven when the storage array is active.
VSSA, VSSD
13, 12
Ground: The ISD2500 series of devices utilizes separate analog and digital ground busses. These pins should be connected separately through a low-impedance path to power supply ground.
SP+/SP-
14, 15
Speaker Outputs: All devices in the ISD2500 series include an on-chip differential speaker
driver, capable of driving 50mW into 16Ω from AUX IN (12.2mW from memory). The speaker outputs are held at VSSA levels during record and power down. It is therefore not possible to parallel speaker outputs of multiple ISD2500 devices or the outputs of other speaker drivers. Connection of speaker outputs in parallel may cause damage to the device. A single output may be used alone (including a coupling capacitor between the SP pin and the speaker). These outputs may be used individually with the output signal taken from either pin. Using differential outputs results in a 4 to 1 improvement in output power. Note, never ground or drive an unused speaker output. VCCA,
16, 28
VCCD
Supply Voltage: To minimize noise, the analog and digital circuits in the ISD2500 series devices use separate power busses. These voltage busses are brought out to separate pins and should be tied together as close to the supply as possible. In addition, these supplies should be decoupled as close to the package as possible.
MIC
17
Microphone: The microphone input transfers its signal to the on-chip preamplifier. An onchip Automatic Gain Control (AGC) circuit controls the gain of this preamplifier from -15 to 24dB. An external microphone should be AC coupled to this pin via a series capacitor. The capacitor value, together with the internal 10kΩ resistance on this pin, determines the low-
frequency cutoff for the ISD2500 series passband. MIC REF
18
Microphone Reference: The MIC REF input is the inverting input to the microphone preamplifier. This provides a noise-canceling or common-mode rejection input to the device when connected to a differential microphone.
AGC
19
Automatic
Gain
Control:
The
AGC
dynamically adjusts the gain of the preamplifier to
compensate
for
the
wide
range
of
microphone input levels. The AGC allows the full range of whispers to loud sounds to be recorded with minimal distortion. The “attack” time is determined by the time constant of a 5kΩ internal resistance and an external capacitor connected from the AGC pin to VSSA analog ground. The “release” time is determined by the time constant of an external resistor and an external capacitor connected in parallel between the AGC pin and VSSA analog ground. Nominal values of 470kΩ and 4.7μF give satisfactory results in most cases ANA IN
20
Analog Input: The analog input pin transfers its signal to the chip for recording. For microphone inputs, the ANA OUT pin should be connected via an external capacitor to the ANA IN pin. This capacitor value, together with the 3.0kΩ input impedance of ANA IN, is selected to give additional cutoff at the lowfrequency end of the voice passband. If the desired input is derived from a source other
than a microphone, the signal can be fed, capacitive coupled, into the ANA pin directly. ANA OUT
21
Analog
Output:
This
pin
provides
the
preamplifier output to the user. The voltage gain of the preamplifier is determined by the voltage level at the AGC pin. OVF
22
Overflow: This signal pulses LOW at the end of memory space, indicating the device has been filled and the message has overflowed. The OVF’ output then follows the CE’ input until a PD pulse has reset the device. This pin can be used to cascade several ISD2500 devices together to increase record/playback durations.
CE’
23
Chip Enable: The CE’ pin is taken low to enable all playback and record operations. The address inputs and playback/record input (P/R’) are latched by the falling edge of CE’. CE’ has additional functionality in the M6 (Push Button) Operational Mode described later.
PD
24
Power Down: When not recording or playing back, the PD pin should be pulled HIGH to place the part in a very low power mode. When overflow (OVF’) pulses LOW for an overflow condition, PD should be brought HIGH to reset the address pointer back to the beginning of the record/playback space. The PD pin has additional functionality in the M6 (Push Button) Operational Mode described later.
EOM’
25
End-Of-Message: A nonvolatile marker is automatically inserted at the end of each
recorded message. It remains there until the message recorded over. The EOM’ output pulses LOW for a period of TEOM at the end of each message. In addition, the ISD2500 series has an internal VCC detect circuit to maintain message integrity should VCC fall below 3.5V. In this case, EOM’ goes LOW and the device is fixed in playback-only mode. When the device is configured in Operational Mode M6 (Push Button Mode), this pin provides
an
active-HIGH
RUN
signal,
indicating the device is currently recording or playing. This signal can conveniently drive an LED for a visual indicator of a record or playback operation in process. XCLK
26
External Clock: The external clock input for the ISD2500 devices has an internal pull-down device. These devices are configured at the factory with an internal sampling clock frequency centered to approximately 1 percent of
specification.
The
frequency
is
then
maintained to a variation of approximately 2.25 percent over the entire commercial temperature and operating voltage ranges. The internal clock has approximately 5 percent tolerance over the industrial temperature and voltage range. A regulated power supply is recommended for industrial temperature range parts. If the XCLK is not used this input must be connected to ground. P/R’
27
Playback/Record: The P/R’ input is latched by
the falling edge of the CE’ pin. A HIGH level selects a playback cycle while a LOW level selects a record cycle. For a record cycle, the address inputs provide the starting address and recording continues until PD or CE’ is pulled HIGH or an overflow is detected (i.e. the chip is full). When a record cycle is terminated by pulling PD or CE’ HIGH, an End-of-Message (EOM’) marker is stored at the current address in memory. For a playback cycle, the address inputs provide the starting address and the device will play until an EOM’ marker is encountered. The device can continue past an EOM’ marker in an Operational Mode, or if CE’ is held LOW in address mode.
Figure 2.10 ISD2560 device pin outs
2.4.4
Operation Modes
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.
Table 2.4 Operational modes Mode
Function
Typical Use
Jointly Compatible
Message cueing
Fast forward
M4, M5, M6
Control M0
through messages M1
Delete EOM’
Position EOM’
marker
marker at
M3, M4, M5, M6
the end of the last message M2
Not applicable
Reserved
N/A
M3
Looping
Continuous
M1, M5, M6
playback from Address 0
M4
Consecutive
Record/Play
addressing
multiple
M0, M1, M6
consecutive messages M5
CE’ level-activated
Allows message
M0, M1, M3, M4
pausing M6
Push button control
Simplified device
M0, M1, M3
interface
2.4.5
Typical Application circuit
Figure 2.11 ISD2560 application schematic examples
Figure 2.12 indicates the typical ISD2500 series application design schematic. The input to the chip is voice or audio to microphone and the output is speaker. The chip enable is pulled up using a 100kΩ resistor (R4).
2.5
Voltage Regulator
A voltage regulator is an electrical regulator designed to automatically maintain a constant voltage level. It may be use an electromechanical mechanism, or passive or active electronic components. Depending on the design, it may be used to regulate one or more AC or DC voltages. With the exception of shunt regulators, all voltage regulators operate by comparing the actual output voltage is too low, the regulation element is commanded to produce a higher voltage. For some regulators if the output voltage is too high, the regulation element is commanded to produce a lower voltage; however, many just stop sourcing current and depend on the current draw of whatever it is driving to pull the voltage back down. In this way, the output voltage is held roughly constant. The control loop must be carefully designed to produce the desired tradeoff between stability and speed of response.
2.5.1
Fixed Positive Voltage Regulator 7805
7805 is an integrated three-terminal positive fixed linear voltage regulator. It supports an input voltage of 10 volts to 35 volts and output voltage of 5 volts. It has a current rating of 1 amp although lower current models are available. Its output voltage is fixed at 5.0V. The 7805 also has a built-in current limiter as a safety feature.
7805
is
manufactured
by
many
companies,
including
National
Semiconductors and Fairchild semiconductors. The 7805 will automatically reduce output current if it gets too hot.
It belongs to a family of three-terminal positive fixed regulators with similar specifications and differing fixed voltages from 8 to 15 volts. There are usually packaged in TO220 chip carries, but smaller surface-mount and larger TO3 packages are also available. The last two digits represent the voltage; for instance, the 7805 is a 5-volt regulator. The 7805 is one of the most common and well-know of the 78xx series regulators, as its small component count and medium power regulated 5V make it useful for powering TTL devices.
Figure 2.12 Fixed linear voltage regulator 7805
2.6
Infrared
Infrared (IR) radiation is electromagnetic radiation of a wavelength longer then that of visible light, but shorter then that of radio wave. IR data transmission is employed in short-range communication. Remote controls and IrDA devices use infrared light-emitting diodes (LEDs) to emit infrared radiation which is focused by a plastic lens into a narrow beam. The beam is modulated, i.e. switched on and off, to encode the data. The receiver uses a silicon photodiode to convert the infrared radiation to an electric current. It responds only to the rapidly pulsing signal created by the transmitter, and filters out slowly changing infrared radiation from ambient
light. Infrared communication are useful for indoor use in areas of high population density. IR does not penetrate walls and so does not interface with other devices in adjoining rooms. Infrared is the most common way for remote controls to command appliances.
2.7
Bootloader
The PIC16F877A microcontroller from Microchip features flash based program memory. The flash program memory can be written by running code allowing the devices to be reprogrammed in process without an expensive EEPROM. The Design Devices bootloader enabled PIC16F877A microcontroller contains a special program that resides in the upper 255 instructions of program memory. This special program executes when the microcontroller is powered on or reset. The program check the B5 input pin and if it high it begins to read a MPLAB hex file program and writes it to user program memory. The hex file data is uploaded using the microcontroller’s SSP serial interface with the help of a special DOS upload program called loader.exe. if the B5 input pin is low the bootloader program transfers execution to the current user program in flash memory. Loader.exe is a program used to communication to a Design Devices bootloader enabled PC microcontroller. It is a simple program that can be run in a DOS window under Windows.
Figure 2.13 Bootloader enabled PIC16F877A schematic
2.8
MPLAB 7.62
MPLAB 7.62 is software program that runs on a computer to develop applications for Microchip microcontroller. MPLAB 7.62 runs on a PC and contains all the components needed to design and deploy embedded systems applications.
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.
3.2
Description of Remote Control with Message Recording
Before the implementation of the system, it is essential to model the system flow in simple block diagram. There are two major part in this project, as illustrated in Figure 3.1
Infrared ISD2560 Record and Playback
Device 1 PIC 16F877A microcontroller
Switch
Device 2 Figure 3.1 Basic system flows
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 PIC Microcontroller Idle
SpeakerPlayback
ISD 2560
MicRecord
Stage 2 ISD2560 switch OFF
ISD2560 Idle
Infrared PIC microco Infrared ntroller
Figure 3.2 System flow
Device 1
Device 2
3.3
Input and Output of the system
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.
Table 3.1 In-Out different Modules PIC16F877A
ISD2560
Device 1/2
Input
Switch 1/2/3
Audio/Voice
Infrared signal
output
Infrared
SP+ and SP_
LED
signal/microcontroller signal
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.
3.4
Assumptions of the System
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).
•
3.5
Switch is used to replace the keypad of remote control.
SK40A
In this project, the SK40A which is a PIIC microcontroller start up kit developed by CYTRON Enterprises was used, SK40A which comes with bootloader capability helps to ease the process of loading program and the further save development time and cost. However, a few pins have been used for bootloader function. Pins that involved were:
•
MCLR (pin1),used as reset and connected to ‘Reset’ button.
•
RB0 (pin 33), used as ‘Boot’ button and is pulled up through a 4.7kΩ resistor to 5V
•
RC (pin 26), used as RxD and connected to MAX232
•
RC6 (pin 25), used as TxD and connected to MAX232
•
RD2 (pin 21), used as RTS and connected to MAX232
•
RD3 (pin 22), used as CTS and connected to MAX232
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.
Figure 3.3 SK40A
Figure 3.4 Schematic of SK40A
3.6
ISD2560
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 Figure 3.5 Recording process in flowchart
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
Press once time START/PAUSE (CE’) button to start playback LED Red = ON
Starting playback
END Figure 3.6 Playback process in flowchart
Figure 3.6 shows the flow of playback process. The PD pin (Stop/Reset) is set to low and P/R’ pin (Playback/Record) is taken high to activate playback mode. When the CE’ (Start/Pause) is pulsed low one time, the playback starting play. The maximum duration of playback period exceeds 60 seconds. However when we pulsed high pin (Stop/Reset), all the progress will stop and reset.
3.8
Infrared Module
A simple infrared module was developed to represent the current infrared remote control. The infrared transmitter was powered with +5V, so that it can always generate signal. The same goes to the receiver to be able to detect the signal. The simple infrared is developed as illustrated in figure 3.6 below.
Figure 3.7 Infrared module
3.9
System Schematic and Path List
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:
•
SK40A, used as central processing unit
•
ISD2560 used as the sound record
•
Infrared transmitter
•
Some common components such as resistors, capacitor, switches, etc.
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.
Table 3.2 Part list for the remote control system Item
Value
Description
Amount
SK40A
Microcontroller start up kit
1
PIC16F877A
Microcontroller
1
ISD2560
Sound record IC
1
Infrared Tx
1x2
Infrared Rx
1x2
LEDs
1x5
Mini slide switch
1x4
Resistor(Ω)
Capacitor(F)
10K
1x2
470K
1
1K
1
100K
1
5.1K
1
220
1x7
220u
1
0.1u
1x5
22u
1
4.7u
1
CHAPTER IV
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.
4.2
Software Development Environment
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
An additional language tool is selected to support this project together with MPLAB 7.62 to create the software environment for programming, which is HITEACH. It is a C compiler, Assembler and Linker. The following figures will show how to create a project environment in MPLAB 7.62 with HI-TEACH PICC tool suite.
Figure 4.1(a) MPLAB 7.62
Figure 4.1(a) shows the start up window for MPLAB 7.62 program. A new project is set up using Project Wizard as illustrated in Figure 4.1(b).
Figure 4.1(b) Project Wizard
After the new project is set up, a suitable microcontroller, PIC16F877A is chosen as shown in Figure 4.1(c).
Figure 4.1 (c) Device Selection
When the correct device is selected, the HI-TECH C compiler is appeared like shown in Figure 4.1(d).
Figure 4.1(d) Active Tool suite
Then create a new project file by given a name “remote control” and browse it location.
Figure 4.1(e) Project name and Browse
After we add the program in text file to the existing file, the final parameters with configuration will be obtain. Figure 4.1(f) show how to add the text file while the Figure 4.1(g) is the project parameters.
Figure 4.1(f) File Adding
Figure 4.1(g) Project parameter
The project then is ready to be build as shown is Figure 4.1(h).
Figure 4.1 (h) Build the project
MPLAB 7.62 generates a *hex file that will be transferred to the PIC16F877A using the bootloader. There are some other changes when using C programming PICC Lite compiler. There must be offset 200h in the Linker option as shown in Figure 4.1(i) and Figure (j). the offset 200h is to set the staring address of our program so that it will not overlap with the firmware program in PIC16F877A as this create reset vector error during bootloader process.
Figure 4.1(i) Build option
Figure 4.1(j) Linker option
4.4
Bootloader with Hyper Terminal
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
Figure 4.2 Preparation for bootloader
Hyper Terminal is the software available in all windows. This program is launched from “Start - All Program - Accessories - Communications – HyperTerminal”. The name (Bootloader) of the connection is given and icon is selected as shown in Figure 4.3(a), followed by serial communication port selection (COM1) as illustrated in Figure 4.3(b)
n
Figure 4.3(a) New connection
Figure 4.3(b) Connect using COM1
Some details about the communication port properties are modified as shown in Figure 4.3(c).
•
Bits per second
: 9600
•
Data bits
:8
•
Parity
: None
•
Stop bit
:1
•
Flow control
: None
Figure 4.3(c) COM1 Properties
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).
Figure 4.3(f) Bootloader started
Figure 4.3(g) Bootloader ended
4.5
Source Code
The complete program with comments of this remote control system is shown like Figure 4.8 below. The program is written in C language.
Figure 4.4 Source Code
CHAPTER V
RESULTS AND DISCUSSION
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
Table 5.1 Result ISD 2560
PIC 16F877A
Stage 1
Message Recorded/Play back
PIC Idle
Stage 2
Non Message Recorded
PIC operate fellow in instruction ‘1’- LED 1 will on ‘2’-LED 1 and 2 will on All the operation depend on my program *LED 1 represent TV *LED 2 represent HI- FI
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 Switch 2 will on the LED1 (TV) OR Switch 3 will on the LED2(TV) and LED3(HI-FI)
Recording/Play back Remote control will do nothing.
END
Figure 5.1 Flow of the system
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.
1.
The PIC16F877A is providing a good in control the whole system and it was friendly used.
2.
Only 2 devices were implementing in this remote control system. So, the LED 1 and 2 can be turned ON/OFFT controlled by the switch.
3.
There is almost no delay occurred in the remote control system. The command issued from the user was executed within un-detectable delay.
4.
Since the remote control system involves infrared, so the distance between transmit infrared and Rx is around 6cm and must in light of sight (LOS).
5.
The angle range for Rx infrared is about 24° and this has different with the accurate value.
6.
The sound quality during playback on this device was found to be greatly depending on the microphone and the speaker that were used in the circuit. When using a higher quality microphone and speaker, we found that the sound quality was very good.
7.
Adapter 5V/0.5A suitable for using in this system for providing the stable power supply.
5.4
Problems Encountered
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.
1.
The program has to written as short as possible. Many modifications are made in hardware configuration and connection to keep the code simple.
2.
There are many components very different from the design. So we has to find out the datasheet and understand the features of that component.
3.
Unstable power supply was solved but putting the 5V/0.5A adapter to make sure the system work properly.
CHAPTER VI
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
As the conclusion, the system performs as desired. The prototype developed was easy to operate and very user friendly. The system not only can for message recording, but also can control the electrical devices. Beside that, through this system people can record the reminder instead of writing on a paper. The number of remote control can also be reducing as by using this all in one remote control.
There are some improvements that can be made to further enhance the system as listed below.
1.
Amplifier circuit can be added to provide better voice reproduction with least noise.
2.
The ISD2560 can be connected to voice recognition IC HM2007 to help people with talking disabilities. The ISD2560 will be pre-recorded with several most commonly used phrases and the HM2007 will be trained to be recognize some short phrase by the user.
3.
The switches in the system can replace by using Bluetooth to make the system easier to control.
4.
Replace the infrared with Bluetooth technology for overcome short distance transmissions and line of sigh (LOS).
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.
[3]
Gradre, Dhananjay V (2001),Programming and Customizing the AVR Microcontroller. New York : Mc Graw Hill.
[4]
John Iovine (2000). PIC Microcontroller Project Book. New York: Mc Graw-Hill.
[5] [6]
D.W. Smith (2002), PIC in Practice. London: Newness. Duarte, Lawrence A (1998), The Microcontroller beginner’s handbook, Indianapolis, IN: Prompt Publications.
[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.
[9]
James L. Antonakos (2004), The 68000 Microprocessor. Prentice Hall.
[10]
Charles K. Alexander, Matthew N.O Sadiku (2001), Fundamental of Electrical Circuits, Mcgraw –Hill.
[11]
Herbert Schildt, C++ The Complete Reference, Osborne McGraw-Hill
[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
[19]
ChipCorder Technology (2006). ISD2560/75/90/120 Product. 1st. ed. USA
[20]
Windbond Electronics (2003). ISD2560/75/90/120. 1st .ed. USA
[21]
ChipCorder Technology (2006). Reducing Noise in Designs with ISD Multilevel Storage Devices. 1st. ed. USA.
[22]
ChipCorder Technology (2006). Application Information For All ChipCorder Products. 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
ISD 2560 Voice Record/Playback Device
APPENDIX B
Device Operation
APPENDIX C
Operation Modes