Microcontrollers Versus Microprocessors Information Technology Essay

Published: November 30, 2015 Words: 6035

A compass is a navigational instrument for determining direction relative to the Earths magnetic poles. It consists of a magnetized pointer usually marked on the North end free to align itself with Earth's magnetic field. The compass greatly improved the safety and efficiency of travel, especially ocean travel.

A compass can be used to calculate heading, used with a sextant to calculate latitude, and with a marine chronometer to calculate longitude. It thus provides a much improved navigational capability that has only been recently supplanted by modern devices such as the Global Positioning System (GPS). A compass is any magnetically sensitive device capable of indicating the direction of the magnetic north of a planet's magnetosphere.

The face of the compass generally highlights the cardinal points of north, south, east and west. Often, compasses are built as a standalone sealed instrument with a magnetized bar or needle turning freely upon a pivot, or moving in a fluid, thus able to point in a northerly and southerly direction.

The compass was invented in ancient China sometime before the 2nd century, and was used for navigation by the 11th century. The dry compass was invented in medieval Europe around 1300. This was supplanted in the early 20th century by the liquid-filled magnetic compass [1].

Project Objective And Importance

In the last ten years there have been significant advances in technological methods for accessing information by blind people. However in many other areas, such as inexpensive devices for daily living, progress has been very slow. Another area beginning to attract interest is the design of terminals for the general public so that disabled people are not unnecessarily excluded from using these systems.

The majority of people, in both rich and poor countries, does not have access to high technology devices, and have to rely on inexpensive devices such as simple devices or even not electronic tools. The commercial companies have also rejected developing low technology devices because it is difficult to make a profit from selling low cost products to a specialist market.

Therefore there is a need to develop new mechanisms for the imaginative development and marketing of this type of product. That is where we started to think as engineers of a way to help these people; we have had the idea of building a Directional aid device.

1.3 Project Idea

Our project idea is to design portable directional aid device which is a PIC Microcontroller based system that is best described as an electronic compass, it finds the direction which the user is heading to and display it on a LCD screen and speak out the direction at the same time.

1.4 Project Implementation

In order to implement the system first we have to get the PIC microcontroller functioned and then to attach the LCD screen in order to display the direction for the user.

Then to get the Electronic Compass functioned and interface it with the PIC microcontroller in order to get the direction as binary serial data and process it, after that interfacing the audio chip (ISD) with the PIC microcontroller to speak out the desired direction according to the processed data from the electrical compass through the audio chip connected speaker.

1.5 Project Block Diagram:

Figure 1.1: Block Diagram

CHAPTER TWO

HARDWARE TOOLS

2.1 Introduction

Circumstances that we find ourselves in today in the field of microcontrollers had their beginnings in the development of technology of integrated circuits. This development has made it possible to store hundreds of thousands of transistors into one chip. That was a prerequisite for production of microprocessors, and the first computers were made by adding external peripherals such as memory, input-output lines, timers and other. Further increasing of the volume of the package resulted in creation of integrated circuits. These integrated circuits contained both processor and peripherals. That is how the first chip containing a microcomputer, or what would later be known as a microcontroller came about.

2.2 What is the PIC?

Microchip technology's series of Microcontroller is called PIC chips; micro chip secured a trade mark for the name PIC. PIC is generally assumed to mean (Peripheral Interface Controller) or (Programmable Interrupt Computer) is the IC, which was developed to control the peripheral device, dispersing the function of the main CPU. When comparing to the human being, the brain is the main CPU and the PIC shares the part of which is equivalent to the autonomic nervous[13].

2.3 Hitachi HMC6352 Compass Module

2.3.1 General Description

The Hitachi HMC6352 Compass Module is a dual-axis magnetic field sensor that can add a sense of direction to the project. The sensing device on the Compass Module is a Hitachi HMC6352 chip. An onboard regulator and resistor protection make the 3 volt HMC6352 chip compatible with 5 volt PIC microcontroller supply and signal levels. The Compass Module also makes all the power and signal connections on the tiny surface mount HMC6352 chip accessible in a breadboard-friendly 0.3 inch wide 6-pin DIP package. Acquiring measurements from the module is made PIC microcontroller's SHIFTIN and SHIFTOUT commands, which are designed for synchronous serial communication with chips like the HM55B.

2.3.2 Features

• Sensitive to Microtesla (µT) variations in magnetic field strength

• Simplifies direction by resolving magnetic field measurements into two component axes

• Good for 6-bit (64-direction) resolution measurements after software calibration

Figure 2.1: hitachi compass.

• Only 30 to 40 ms between start measurement and data-ready

• Built-in resistor protection for data pins eliminates bus conflict risks

• Compact and breadboard-friendly 0.3 inch, 6-pin DIP package

• Compatible with all BASIC Stamp, Javelin Stamp and SX microcontrollers [6].

2.3.3 Theory of Operation

The Hitachi HMC6352 Compass Module has two axes, x and y. Each axis reports the strength of the magnetic field's component parallel to it. The x-axis reports (field strength) Ã- cos(θ), and the y-axis reports the (field strength) Ã- sin(θ). To resolve θ into a clockwise angle from north, use arctan(-y/x). The ATN command returns the angle in binary radians. To convert to degrees just apply */ 360 to the variable storing the binary radian measurement.

Angle θ = arctan(-y/x)

The Hitachi HM55B chip on the Compass Module reports its x and y axis measurements in terms of microteslas (µT) in 11-bit signed values. The HMC6352 is designed to return a value of 1 for a north magnetic field of 1 µT parallel to one of its axes. If the magnetic field is south, the value will be -1.

Keep in mind that these are nominal values. According to the HMC6352 datasheet, the actual µT value for a measurement of 1 could range anywhere from 1 to 1.6 µT. Also keep in mind that a negative 11-bit value will not appear negative in a word variable unless a mask is applied. For example, when bit-10 is 1, bits 11 to 15 are also changed to 1 with a mask in the test and calibration programs.

The microcontroller connected to the HMC6352 must control its enable and clock inputs and use synchronous serial communication to get the axis measurements from its data input and data output pins.

It takes the HMC6352 30 to 40 ms to complete a given measurement. The microcontroller can either perform other tasks during this time or poll until the measurement is complete. The polling is a combination of SHIFTOUT commands that request the status, and SHIFTIN commands that acquire the status. When the SHIFTIN receives status flags indicating that the measurement is complete, a second and third SHIFTIN command can then store the 11-bit x and y axis measurements in variables [7].

2.3.4 Precautions

• Do not apply voltages to the device that are outside the values stated in the Pin Definitions and Ratings section.

• Do not operate or store the Compass Module near sources of strong magnetic fields. Strong magnetic fields can be created by bar and ring magnets, electric motors, and other coil elements such as solenoids, relays, and large inductors.

• Do not apply magnetic fields in excess of 300 µT to the Compass Module. Magnetic fields stronger than 300 µT can permanently damage the sensor.

• Mount the Compass Module as far away as possible from magnetic field disturbances. These include magnets (including compass needles), motors, power cords, coils, metal boxes, and sometimes the ground.

2.4 Audio chip (ISD1420)

Single-Chip Voice Record/Playback Devices 16- and 20-Second Durations.

2.4.1 GENERAL DESCRIPTION

Information Storage Devices' ISD1400 Chip-Corder Series provides high-quality, single-chip record/playback solutions to short-duration messaging applications. The CMOS devices include an on-chip oscillator, microphone preamplifier, automatic gain control, ant aliasing filter, smoothing filter, and speaker amplifier. A minimum record/playback subsystem can be configured with a microphone, a speaker, several passives, two push-buttons, and a power source. Recordings are stored in on-chip nonvolatile memory cells, providing zero-power message storage. This unique, single-chip solution is made Possible through ISD's patented multilevel storage technology. Voice and audio signals are stored directly into memory in their natural form, providing high-quality, and solid-state voice reproduction [8].

FEATURES

• Easy-to-use single-chip voice Record/Playback solution

• High-quality, natural voice/audio reproduction

• Push-button interface- Playback can be edge- or levelactivated

• Single-chip durations of 16 and 20seconds

• Automatic power-down mode- Enters standby mode immediately

following a Record or Playbackcycle- Standby current 0.5mA (typical)

• Zero-power message storage- Eliminates battery backup circuits

• Fully addressable to handle multiplemessages

• 100-year message retention (typical)

• 100,000 record cycles (typical)

• On-chip clock source

• No algorithm development required

2.4.2 DETAILED DESCRIPTION

2.4.2.1 Speech/Sound Quality

The ISD1400 Series includes devices offered at 6.4 and 8.0 KHz sampling frequencies, allowing the user a choice of speech quality options. 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 [9].

2.4.2.2 Duration

To meet end system requirements, the ISD1400 Series offers single-chip solutions at 16 and 20 seconds.

2.4.2.3 EEPROM Storage

One of the benefits of ISD's ChipCorder technology is the use of on-chip nonvolatile memory, providing zero-power message storage. The message is retained for up to 100 years typically without power. In addition, the device can be rerecorded typically over 100,000 times.

Figure 2.2: ISD1400 series block diagram

Figure 2.3: ISD1400 series pinout

2.4.2.4 Basic Operation

The ISD1400 ChipCorder Series devices are controlled by a single Record signal, REC, and either of two push-button control playback signals, PLAYE (edge-activated playback), and PLAYL (level-activated playback). The ISD1400 parts are configured for simplicity of design in a single-message application. Using the address lines will allow multiple message applications.

2.4.2.5 Automatic Power-Down Mode

At the end of a Playback or Record cycle, the ISD1400 Series devices automatically return to a low-power standby mode.

2.4.2.6 addressing (optional)

In addition to providing simple message playback, the ISD1400 Series provides a full addressing capability. The ISD1400 Series storage array has 160 distinct addressable segments

2.4.3 PIN DESCRIPTION

2.4.3.1Voltage Inputs (V CCA, V CCD)

Analog and digital circuits internal to the ISD1400 Series use separate power buses to minimize noise on the chip. These power buses are brought out to separate pins on the package and should be tied together as close to the supply as possible [9].

2.4.3.2Ground Inputs (V SSA, V SSD)

Similar to V CCA and V CCD, the analog and digital circuits internal to the ISD1400 Series use separate ground buses to minimize noise. These pins should be tied together as close as possible to the device [9].

2.4.3.3 Record (REC)

The REC input is an active-LOW Record signal. The device records whenever REC is LOW. This signal must remain LOW for the duration of the Recording. REC takes precedence over either Playback (PLAYE or PLAYL) signal. If REC is pulled LOW during a Playback cycle, the Playback immediately ceases and Recording begins [9].

2.4.3.4 Playback, Edge-Activated (PLAYE)

When a LOW-going transition is detected on this input signal, a Playback cycle begins. Playback continues until an end-of-message (EOM) is encountered or the end of the memory space is reached. Upon completion of the Playback cycle, the device automatically powers down into standby mode. Taking PLAYE HIGH during a

Playback cycle will not terminate the current cycle [9].

2.4.3.5 Playback, Level-Activated (PLAYL)

When this input signal transitions from HIGH to LOW, a Playback cycle is initiated. Playback continues until PLAYL is pulled HIGH, an EOM marker is detected, or the end of the memory space is reached. The device automatically powers down to standby mode upon completion of the Playback cycle.

2.4.3.6 Record LED Output (RECLED)

The output RECLED is LOW during a Record cycle. It can be used to drive an LED to provide feedback that a Record cycle is in progress. In addition, RECLED pulses LOW momentarily when an EOM is encountered in a Playback cycle.

2.4.3.7 Microphone Input (MIC)

The microphone input transfers its signal to the on-chip preamplifier. An on-chip Automatic Gain Control (AGC) circuit controls the gain of this preamplifier from -15 to 24 dB. An external microphone should be AC coupled to this pin via a series capacitor. The capacitor value, together with the internal 10 K Ohm resistance on this pin [9].

2.4.3.8 Microphone Reference (MIC REF)

The MIC REF input is the inverting input to the microphone preamplifier. This provides a noisecanceling or common-mode rejection input to the device when connected differentially to a microphone.

2.4.3.9 Analog Output (ANA OUT)

This pin provides the preamplifier output to th user. The voltage gain of the preamplifier is determined by the voltage level at the AGC pin.

2.4.3.10 Analog Input (ANA IN)

The ANA IN pin transfers the input 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.0 K W 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, capacitively coupled, into the ANA IN pin directly.

2.4.3.11 Address Inputs (A0-A7)

The Address Inputs have two functions, depending upon the level of the two Most Significant Bits (MSB) of the address.

2.4.4 FUNCTIONAL DESCRIPTION EXAMPLE

The following example operating sequence demonstrates the functionality of the ISD1400 Series devices.

Figure 2.4 chip recording circuit

1. Record a message filling the address space.

Pulling the REC signal LOW initiates a Record cycle from the beginning of the message space. If REC is held LOW, the Recording continues until the message space has been filled. Once the message space is filled, Recording ceases. The device will automatically power down after REC is pulled HIGH.

2. Edge-activated playback.

Pulling the PLAYE signal LOW initiates a Playback cycle from the beginning of the message space or at a selected location. The rising edge of PLAYE has no effect on operation. If a Recording has filled the message space, the entire message is played.

When the device reaches the EOM marker, it automatically powers down. A subsequent falling edge on PLAYE initiates a new Play cycle from the start address.

Finally figure 3.5 shows how we connect the ISD chip in our circuit

Figure 2.5 PIC connections to ISD chip

2.5 Liquid Crystal Display

A liquid crystal display (LCD) is a thin, flat display device made up of any number of color or monochrome pixels arrayed in front of a light source or reflector. It is often utilized in battery-powered electronic devices because it uses very small amounts of electric power.

In our project we use the character based LCD because we want a device to be the interface between the microcontroller and human being.

Although the LCD module data sheet specify a 5V DC supply , supplies of 6V and 4.5V both work well,The following figure shows the pinout function for all local types

Figure 2.6: pinout function for Lcd.

Figure 2.7 :lcd pinout.

-pin3 is a control pin, Vee which is used to alter the contrast of the display ideally this pin should be connected to a variable supply

-pin4 is the register select (R.S) line. The first of the three command control inputs, when this line is low, data bytes transferred to the display are treated as commands, and by setting the R.S line high , character data can be transferred to the module.

-pin5 is the read\write (R\W) line, this line is pulled low in order to write command or character dat to the module,

-pin6 is the enable (E) line, this input is used to initiate the actual transfer of commands or character data between module and the data lines when writing to the display, data is transferred only on the high to low transition of the signal.

Pins7-14 are the eight bus lines(D0-D7) data can be transferred to and from the display either as single 8-bit byte or as two 4-bit (nibbles) in the later case only the upper four data lines (D4-D7) are used

This 4-bit mode is beneficial when using a microcontroller as a fewer input\output lines are required.

In order for the LCD to work well it needs to be initialized first, to initialize the LCD we first put logic low on the (RS) pin then fed it with the appropriate initializing code [10].

Figure 3.8 shows the command control codes that should be used to initialize the LCD

Figure 2.8: commands control codes to Lcd.

2.5.1 LCD command:

Since we want to save the input\output pins of the microcontroller we will use the four-bit mode, in this mode we send each byte that represent the ASCII code into two part (4-bit each) .

Finally the figure below shows how we connect the LCD to our circuit

Figure 2.9: connection of Lcd to circuit.

2.6 Voltage Regulator

For a proper function of any microcontroller, it is necessary to provide a stable source of supply; a sure reset when you turn it on, According to technical specifications by the manufacturer of PIC microcontroller, supply voltage should move between 2.0V to 6.0V in all versions.

The simplest solution to the source of supply is using the voltage stabilizer LM7805 (Figure 3.10) that gives stable +5V on its output., in order to have stable 5V at the output (pin 3), input voltage on pin 1 of LM7805 should be between 7V through 24V.

Depending on current consumption of device we will use the appropriate type of voltage stabilizer LM7805. There are several versions of LM7805. For current consumption of up to 1A we should use the version in TO-220 case with the capability of additional some capacitors shunted to the input and output pins of regulator; pin 1 and pin 3 respectively to reduce any unwanted high frequency signals or what we called noise. These capacitors are working as a low pass filters to pass a DC component and reject any AC ripples.

Figure 2.10: LM7805 Regulator.

In our circuit we used a DC power supply so there is no need of the capacitor on the input of the regulator, but we attached a 470uF capacitor on the output to stabilize a +5V on the output, the following figure 3.11 shows how exactly we connect the regulator in our circuit [11].

Figure 2.11: Regulator Connection.

2.7 LED as output for PIC microcontroller

One I/O pin is needed for one LED as output of PIC microcontroller. The connection for a LED to I/O pin is shown in Figure 2.17. The function of R11 is to protect the LED from over current that will burn the LED. When the output is in logic 1, the LED will ON, while when the output is in logic 0, the LED will OFF.

Figure 2.12: connection for a LED to I/O pin.

2.8 Push Button as input for PIC microcontroller

One I/O pin is needed for one push button as input of PIC microcontroller. The connection of the push button to the I/O pin is shown in Figure 2.18. 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.

Figure 2.13:circuit of push button.

CHAPTER THREE

SOFTWARE TOOLS

3.1 Programming a PIC:

3.1.1 The program:

MikroBasic is a powerful, feature rich development tool for PIC microcontrollers. It is designed to provide the customer easiest possible solution for developing applications for embedded systems, without compromising performance or control. [12]

We use Mikrobasic V7.0.0.2 program to write our program, this program can be downloaded free from internet and it is not difficult to use it, figure below shows the front page of Mikrobasic.

Figure 3.1: front page of mikrobasic.

3.1.2 Features

MikroBasic allows you to quickly develop and deploy complex applications:

Write your BASIC source code using the built-in Code Editor (Code and Parameter Assistants, Syntax Highlighting, Auto Correct, Code Templates, and more…)

Use the included MikroBasic libraries to dramatically speed up the development: data acquisition, memory, displays, conversions, communications… Practically all P12, P16, and P18 chips are supported.

Monitor your program structure, variables, and functions in the Code Explorer.

Generate commented, human-readable assembly, and standard HEX compatible with all programmers.

Inspect program flow and debug executable logic with the integrated Debugger.

Get detailed reports and graphs: RAM and ROM map, code statistics, assembly listing, calling tree, and more…

We have provided plenty of examples for you to expand, develop, and use as building bricks in your projects. Copy them entirely if you deem fit - that's why we included them with the compiler.

3.1.3 Built-in Routines

MikroBasic compiler provides a set of useful built-in utility functions. Built-in functions do not have any special requirements; you can use them in any part of your project.

And after writing the code and compiling it we need to install this program on the PIC so we need software and hardware.

3.1.4 PIC programmer software:

IC-PROG universal serial program which converts our source code to hexadecimal machine language, figure below shows the front page of IC-PROG also free download from internet.

Figure 3.2:front page of IC programmer.

3.1.5 PIC programmer hardware:

The program can be easily downloaded on the PIC using a small circuit called programmer.

This programmer is connected to computer by parallel port. It is used for all PDIP PIC's ranges from 8pins to 40 pins.

Figure 3.3:IC porogrammer.

CHAPTER FOUR

IMPLEMENTATION

4.1 introduction

In this project we have designed a speaking compass system that can the direction and display it on an LCD screen and can be heard through a small speaker, we have reached the smallest possible size for our project as a prototype.

First we have connected the LCD screen with PIC microcontroller so that we can display the items name, we have made the interface through a 4-bit data transfer mode, enable and register select bit.

Then in order to let our system speak out the desired item name we have used the ISD audio chip and connected it with PIC microcontroller so we can control it and playback the items name.

After that we have interfaced compass module with the PIC microcontroller through an I2C interface, we faced some problem with compass transmitted data, and the data form, also it was not easy to find the I2C compass.

Then we have saved the direction on the PIC microcontroller as a database for the system to compare with, and recorded their names with our voice on the audio chip so it can be played back whenever one of them is found by the compass module

4.2 Microcontrollers versus Microprocessors

Microcontroller differs from a microprocessor in many ways. First and the most important is its functionality. In order for a microprocessor to be used, other components such as memory, or components for receiving and sending data must be added to it. In short that means that microprocessor is the very heart of the computer. On the other hand, microcontroller is designed to be all of that in one. No other external components are needed for its application because all necessary peripherals are already built into it. Thus, we save the time and space needed to construct devices [2].

4.3 Memory unit

Memory is part of the microcontroller whose function is to store data.

The easiest way to explain it is to describe it as one big closet with lots of drawers. If we suppose that we marked the drawers in such a way that they can not be confused, any of their contents will then be easily accessible. It is enough to know the designation of the drawer and so its contents will be known to us for sure.

Figure 4.1:example of simplified model of a memory unit.

Memory components are exactly like that. For a certain input we get the contents of a certain addressed memory location and that's all. Two new concepts are brought to us: addressing and memory location. Memory consists of all memory locations, and addressing is nothing but selecting one of them.

This means that we need to select the desired memory location on one hand, and on the other hand we need to wait for the contents of that location. Beside reading from a memory location, memory must also provide for writing onto it. This is done by supplying an additional line called control line.

We will designate this line as R/W (read/write). Control line is used in the following way: if r/w=1, reading is done, and if opposite is true then writing is done on the memory location. Memory is the first element, and we need a few operation of our microcontroller [2].

4.4 Program Memory Organization

Mid-Range MCU devices have a 13-bit program counter capable of addressing an 8K x 14 program memory space. The width of the program memory bus (instruction word) is 14-bits. Since all instructions are a single word, a device with an 8K x 14 program memory has space for 8K of instructions. This makes it much easier to determine if a device has sufficient program memory for a desired application.

This program memory space is divided into four pages of 2K words each (0h - 7FFh, 800h - FFFh, 1000h - 17FFh, and 1800h - 1FFFh). Figure 2.2 shows the program memory map as well as the 8 level deep hardware stack. Depending on the device, only a portion of this memory may be implemented. Please refer to the device data sheet for the available memory.

To jump between the program memories pages, the high bits of the Program Counter (PC) must be modified. This is done by writing the desired value into a SFR called PCLATH (Program Counter Latch High). If sequential instructions are executed, the program counter will cross the page boundaries without any user intervention. For devices that have less than 8K words, accessing a location above the physically implemented address will cause a wraparound. That is, in a 4K-word device accessing 17FFh actually addresses 7FFh. 2K-word devices (or less) do not require paging [3].

Figure 4.2: Architectural program memory map and stack

4.5 Data Memory Organization

Data memory is made up of the Special Function Registers (SFR) area, and the General Purpose Registers (GPR) area. The SFRs control the operation of the device, while GPRs are the general area for data storage and scratch pad operations.

The data memory is banked for both the GPR and SFR areas. The GPR area is banked to allow greater than 96 bytes of general purpose RAM to be addressed. SFRs are for the registers that control the peripheral and core functions. Banking requires the use of control bits for bank selection.

These control bits are located in the STATUS Register (STATUS<7:5>).

To move values from one register to another register, the value must pass through the W register.

This means that for all register-to-register moves, two instruction cycles are required.

The entire data memory can be accessed either directly or indirectly. Direct addressing may require the use of the RP1:RP0 bits. Indirect addressing requires the use of the File Select Register (FSR). Indirect addressing uses the Indirect Register Pointer (IRP) bit of the STATUS register for accesses into the Bank0 / Bank1 or the Bank2 / Bank3 areas of data memory [4].

4.5.1 General Purpose Registers (GPR)

Some Mid-Range MCU devices have banked memory in the GPR area. GPRs are not initialized by a Power-on Reset and are unchanged on all other resets.

The register file can be accessed either directly, or using the File Select Register FSR, indirectly.

Some devices have areas that are shared across the data memory banks, so a read / write to that area will appear as the same location (value) regardless of the current bank. We refer to this area as the Common RAM [4].

4.5.2 Special Function Registers (SFR)

The SFRs are used by the CPU and Peripheral Modules for controlling the desired operation of the device. These registers are implemented as static RAM.

The SFRs can be classified into two sets, those associated with the "core" function and those related to the peripheral functions. Those registers related to the "core" are described in this section, while those related to the operation of the peripheral features are described in the section of that peripheral feature.

All Mid-Range MCU devices have banked memory in the SFR area. Switching between these banks requires the RP0 and RP1 bits in the STATUS register to be configured for the desired bank. Some SFRs are initialized by a Power-on Reset and other resets, while other SFRs are unaffected.

The register file can be accessed either directly, or using the File Select Register FSR, indirectly.

Note: The Special Function Register (SFR) Area may have General Purpose Registers (GPRs) mapped in these locations [4].

4.6 Central Processing Unit

Let add 3 more memory locations to a specific block that will have a built in capability to multiply, divide, subtract, and move its contents from one memory location onto another. The part we just added in is called "central processing unit" (CPU). Its memory locations are called registers.

Figure 4.3:example of simplified central processing unit.

Registers are therefore memory locations whose role is to help with performing various mathematical operations or any other operations with data wherever data can be found. Look at the current situation. We have two independent entities (memory and CPU) which are interconnected, and thus any exchange of data is hindered, as well as its functionality. If, for example, we wish to add the contents of two memory locations and return the result again back to memory, we would need a connection between memory and CPU. Simply stated, we must have some "way" through data goes from one block to another [2].

4.6.1 Bus

That "way" is called "bus". Physically, it represents a group of 8, 16, or more wires there are two types of buses: address and data bus. The first one consists of as many lines as the amount of memory we wish to address and the other one is as wide as data, in our case 8 bits or the connection line. First one serves to transmit address from CPU memory, and the second to connect all blocks inside the microcontroller.

Figure 4.4:using buses to connect memory to central unit.

As far as functionality, the situation has improved, but a new problem has also appeared: we have a unit that's capable of working by itself, but which does not have any contact with the outside world, or with us! In order to remove this deficiency, let's add a block which contains several memory locations whose one end is connected to the data bus, and the other has connection with the output lines on the microcontroller which can be seen as pins on the electronic component [2].

4.6.2 Input-output unit

Those locations we've just added are called "ports". There are several types of ports: input, output or bidirectional ports. When working with ports, first of all it is necessary to choose which port we need to work with, and then to send data to, or take it from the port.

Figure 4.5:example of simplified I/O unit.

When working with it the port acts like a memory location. Something is simply being written into or read from it, and it could be noticed on the pins of the microcontroller [5].

4.7 Timer unit

Since we have the serial communication explained, we can receive, send and process data.

Figure 4.6:Timer unit.

However, in order to utilize it in industry we need a few additionally blocks. One of those is the timer block which is significant to us because it can give us information about time, duration, protocol etc. The basic unit of the timer is a free-run counter which is in fact a register whose numeric value increments by one in even intervals, so that by taking its value during periods T1 and T2 and on the basis of their difference we can determine how much time has elapsed. This is a very important part of the microcontroller whose understanding requires most of our time.

Finally, the microcontroller is now completed, and all we need to do now is to assemble it into an electronic component where it will access inner blocks through the outside pins. The picture below shows what a microcontroller looks like inside [2].

Figure 4.7: Physical configuration of the interior of a microcontroller

4.8 Project Schematic Diagram

4.9 Project Flowchart

CHAPTER FIVE

CONCLUSION

5.1 Introduction

This chapter includes the project evaluation, conclusions, future work recommendations for this project.

5.2 project evaluation

*It gave team members a great learning experience with a newly-emerging technology, and exposed them to a variety of electronic topics.

* It gave us a great lesson in team-work, and time management.

5.3 Conclusion

In this project we have dealt with many interfaces and found that each interface have an advantage over another one, as I2C interface have a high speed and accuracy that the serial interface lack off, the serial interface does not need an additional clock in order to transfer data.

Also we used the ISD audio chip because it's much easier to interface, deal with, record, and playback any audio message, with a simple interface, unlike if we use an external EEPROM to record the voice and play it, since we face many problems with memory size, addressing and accessing the data in a matter that makes the EEPROM an unsuitable choice to make this function.

The LCD screen and its interface have given us an easy, flexible design in both software and hardware sides, since it much clear and better from seven-segments displays for example, and it can be controlled easily through the PIC microcontroller.

We also conclude that such a system almost impossible to be done without using a microcontroller because off the above, we have chosen the PIC microcontroller in our project for many reasons first its advantages over other microcontrollers and because it is available in the local market with its programming tools unlike the other microcontrollers.

5.4 future work

Developing this project by applying the following:

As we finished the implementation of our project practically we started to think of new applications and developments as a future work for our project like adding A GPS (global positioning system) which can give our system more capabilities not only the direction but also the position and speed etc…, with some extra database the system can define places and names and much more like it could give us instructions to reach any place of our choice.

More over as we are Muslims we can add an extra feature to the system that it can find the geble direction and display it on the LCD screen so that will be sure of its direction where ever we are, not only that but also we could add an athan reminder to the system so it can remind us with the five prayer times.

Appendix A

INSTRUCTION SET

STATUS Register