Académique Documents
Professionnel Documents
Culture Documents
CHAPTER 1
INTRODUCTION
The records of various parameters of weather like temperature, humidity and
pressure are vital for day-to-day activity of the people involved in agriculture, fishing etc
and also for industries like salt industry, food processing industry, food storage etc.
Therefore it is proposed to develop a monitoring system for various parameters of
weather using appropriate sensors like humidity sensor, temperature sensor, pressure
sensor for moistures, temperature. These sensors can be interfaced to microcontroller and
the corresponding parameter values can be measured and displayed it on PC.
1.1 MOTIVATION:
The majestic system is developed by using both PC based and microcontroller
section because this system offers low cost, compact, reliable due to integration of CPU,
memory and peripheral devices in a single chip and also mainly the system has been
developed in PC using modem and cordless section. Then we monitor the status on from
any remote area through PC by wireless communication simplex method.
For communication purpose between PC to PC simplex wireless communication
as been developed. The transmitter PC will send serial data at a specified baud rate
through its serial port, which is converted to TTL levels by MAX 232 and converted to
analog. The modulates the analog signal and then transmit through wireless
communication.
In the reception section there is one receiver to receive the data from the
transmitter. The receiver section will receive the transmitted signal and demodulate to
mark and space frequencies. The binary information is converted to RS-232C standard
levels and fed to serial port of receiver PC, which is in remote location area
1.2 Objective
The project deals with the voice recognisation based home automation control
system which is very useful for adults and physical disabled persons.Their was many
projects existed in the market for home automations.
Home Automation industry is growing rapidly; this is fuelled by provide
supporting systems for the elderly and the disabled, especially those who live alone.
Coupled with this, the world population is confirmed to be getting older.
1
Home
CHAPTER 2
EMBEDDED SYSTEM
2.1 INTRODUCTION
An embedded system is a system which is going to do a predefined specified task
is the embedded system and is even defined as combination of both software and
hardware. A general-purpose definition of embedded systems is that they are devices used
to control, monitor or assist the operation of equipment, machinery or plant. "Embedded"
reflects the fact that they are an integral part of the system. At the other extreme a generalpurpose computer may be used to control the operation of a large complex processing
plant, and its presence will be obvious. 3
All embedded systems are including computers or microprocessors. Some of these
computers are however very simple systems as compared with a personal computer.
The very simplest embedded systems are capable of performing only a single
function or set of functions to meet a single predetermined purpose. In more complex
systems an application program that enables the embedded system to be used for a
particular purpose in a specific application determines the functioning of the embedded
system. The ability to have programs means that the same embedded system can be used
for a variety of different purposes. In some cases a microprocessor may be designed in
such a way that application software for a particular purpose can be added to the basic
software in a second process, after which it is not possible to make further changes. The
applications software on such processors is sometimes referred to as firmware.
The simplest devices consist of a single microprocessor (often called a "chip),
which may itself be packaged with other chips in a hybrid system or Application Specific
Integrated Circuit (ASIC). Its input comes from a detector or sensor and its output goes to
a switc or activator which (for example) may start or stop the operation of a machine or,
by operating a valve, may control the flow of fuel to an engine.
As the embedded system is the combination of both software and hardware
Embedded
System
Software
1.
ALP
2.
3.
VB
Hardware
1.
Process
or
2.
Periphe
Etc.,
rals
3.
memor
y System
Figure:2.1 Block diagram of Embedded
Software deals with the languages like ALP, C, and VB etc., and Hardware deals with
Processors, Peripherals, and Memory.
Memory: It is used to store data or address.
Peripherals: These are the external devices connected
Processor: It is an IC which is used to perform some task
Applications of embedded systems
Manufacturing and process control
Construction industry
Transport
Buildings and premises
Domestic service
Communications
Office systems and mobile equipment
Banking, finance and commercial
Medical diagnostics, monitoring and life support
Testing, monitoring and diagnostic systems
Instruction set: The set of instructions that the microprocessor can execute.
Clock speed : Given in megahertz (MHz), the clock speed determines how many
ALU
CU
Memory
Figure:2.3
Controller (c)
Analog circuits to provide clocks and interface to the real world which is analog in
nature
Harvard Architecture
Von-Neumann Architecture
Harvard Architecture
o Computers have separate memory areas for program instructions and data.
There are two or more internal data buses, which allow simultaneous
access to both instructions and data. The CPU fetches program instructions
on the program memory bus.
Von-Neumann Architecture
o A computer has a single, common memory space in which both program
instructions and data are stored. There is a single internal data bus that
fetches both instructions and data. They cannot be performed at the same
time
o The von Neumann architecture is a design model for a stored-program
digital computer that uses a central processing unit (CPU) and a single
separate storage structure ("memory") to hold both instructions and data. It
is named after the mathematician and early computer scientist John von
Neumann. Such computers implement a universal Turing machine and
have a sequential architecture.
CHAPTER 3
HARDWARE DIAGRAM
3.1 WORKING
OPERATION:
The input voltage to the diodes 1 and 2 is supplied from a transformer and is equal
to the peak AC voltage of the secondary winding of the transformer as shown in
graph 1.
The circuit consisting of the combination of the two diodes is called full wave
rectifier.
These diodes combined with a capacitor are known as full wave rectifier with a
capacitor. This capacitor is known as filtering capacitor improves the output of the
rectifier and the efficiency of this rectifier is 81.2%.
8
The resistor is used to limit the voltage and current those are supplied to the
regulator in order to avoid the regulator from getting damaged.
The diode 3 is used to protect the diodes 1 and 2 from the back current discharged
by the capacitor.
The output at this point is not completely regulated since there is still some
amount of ripple present in the rectified voltage.
Therefore a regulator is used to ensure low voltage ripple and excellent load and
line voltage regulation.
The resistor after the regulator is used to limit the current supplied to the LED.
When the voltage supplied is greater than 3.8V, the LED will glow. The regulated
DC voltage output is taken across the capacitor and is further supplied to other
applications.
CHAPTER 4
ARM MICROPROCESSOR
4.1. Introduction
System-on-chip solutions based on ARM embedded processors address many
different market segments including enterprise applications, automotive systems, home
networking and wireless technologies. The ARM Cortex family of processors provides
a standard architecture to address the broad performance spectrum required by these
diverse technologies. The ARM Cortex family includes processors based on the three
distinct profiles of the ARMv7 architecture; the A profile for sophisticated, high-end
applications running open and complex operating systems,the R profile for real-time
systems; and the M profile optimized for cost-sensitive and microcontroller applications.
The Cortex-M3 processor is the first ARM processor based on the ARMv7-M
architecture and has been specifically designed to achieve high system performance in
power- and cost-sensitive embedded applications, such as microcontrollers, automotive
body systems, industrial control systems and wireless networking, while significantly
simplifying programmability to make the ARM architecture an option for even the
simplest applications.
and 1985
Problems with CISC:
Slower then memory parts
Clock cycles per instruction
11
Variable-length instructions
12
5-stage pipeline:
Reduces work per cycle =>
Separates data and instruction memory => reduction of CPI (average number of
clock Cycles Per Instruction)
13
FIQ mode: A privileged mode that is entered whenever the processor accepts an
FIQ interrupt.
IRQ mode: A privileged mode that is entered whenever the processor accepts an
IRQ interrupt.
Supervisor (svc) mode: A privileged mode entered whenever the CPU is reset or
when an SVC instruction is executed.
Abort mode: A privileged mode that is entered whenever a prefetch abort or data
abort exception occurs.
Undefined mode: A privileged mode that is entered whenever an undefined
instruction exception occurs.
System mode (ARMv4 and above): The only privileged mode that is not entered
by an exception. It can only be entered by executing an instruction that explicitly
writes to the mode bits of the CPSR.
14
15
CHAPTER 5
HARDWARE REQUIERMENT
5.1 MICRO CONTROLLER
The LPC1768 is a ARM Cortex-M3 based microcontroller for embedded
applications featuring a high level of integration and low power consumption.The ARM
Cortex-M3 is a next generation core that offers system enhancements such as enhanced
debug
features
and
higher
level
of
support
block
integration.The
The LPC1769 operates at CPU frequencies of up to 120 MHz. The ARM CortexM3 CPU incorporates a 3-stage pipeline and uses a Harvard architecture with separate
local instruction and data buses as well as a third bus for peripherals. The ARM CortexM3 CPU also includes an internal prefetch unit that supports speculative branching.
The LPC1769/68/67/66/65/64/63 are pin-compatible to the 100-pin LPC236x
ARM7-based microcontroller series.
16
Four UARTs with fractional baud rate generation, internal FIFO, and DMA
support.One UART has modem control I/O and RS-485/EIA-485 support, and one
UART has IrDA support.
Two SSP controllers with FIFO and multi-protocol capabilities. The SSP
interfaces can be used with the GPDMA controller.
Three enhanced I2C bus interfaces, one with an open-drain output supporting full
I2C specification and Fast mode plus with data rates of 1 Mbit/s, two with
standard port pins. Enhancements include multiple address recognition and
monitor mode.
70 (100 pin package) General Purpose I/O (GPIO) pins with configurable pullup/down resistors. All GPIOs support a new, configurable open-drain operating
mode. The GPIO block is accessed through the AHB multilayer bus for fast access
and located in memory such that it supports Cortex-M3 bit banding and use by the
General Purpose DMA Controller.
17
Four general purpose timers/counters, with a total of eight capture inputs and ten
compare outputs. Each timer block has an external count input. Specific timer
events can be selected to generate DMA requests.One motor control PWM with
support for three-phase motor control.
o Quadrature encoder interface that can monitor one external quadrature
encoder.
o One standard PWM/timer block with external count input.
o RTC with a separate power domain and dedicated RTC oscillator. The
RTC block includes 20 bytes of battery-powered backup registers.
WatchDog Timer (WDT). The WDT can be clocked from the internal RC
oscillator,the RTC oscillator, or the APB clock.
ARM Cortex-M3 system tick timer, including an external clock input option.
Each peripheral has its own clock divider for further power savings.
Standard JTAG test/debug interface for compatibility with existing tools. Serial
Wire Debug and Serial Wire Trace Port options.
Four reduced power modes: Sleep, Deep-sleep, Power-down, and Deep powerdown.
Clock output function that can reflect the main oscillator clock, IRC clock, RTC
clock,CPU clock, and the USB clock.
The Wake-up Interrupt Controller (WIC) allows the CPU to automatically wake
up from any priority interrupt that can occur while the clocks are stopped in deep
sleep,Power-down, and Deep power-down modes.
Processor wake-up from Power-down mode via any interrupt able to operate
during Power-down mode (includes external interrupts, RTC interrupt, USB
activity, Ethernet wake-up interrupt, CAN bus activity, Port 0/2 pin interrupt, and
NMI).
Brownout detect with separate threshold for interrupt and forced reset.
PLL allows CPU operation up to the maximum CPU rate without the need for a
high-frequency crystal. May be run from the main oscillator, the internal RC
oscillator, or the RTC oscillator.
FUNCTIONAL DESCRIPTION
5.4
Architectural Overview
The ARM Cortex-M3 includes three AHB-Lite buses: the system bus, the I-code
bus, and the D-code bus. The I-code and D-code core buses are faster than the system bus
and are used similarly to TCM interfaces: one bus dedicated for instruction fetch (I-code)
and one bus for data access (D-code). The use of two core buses allows for simultaneous
operations if concurrent operations target different devices.
The LPC1768 use a multi-layer AHB matrix to connect the ARM Cortex-M3
buses and other bus masters to peripherals in a flexible manner that optimizes
19
5.5
5.6
flash accelerator maximizes performance for use with the two fast AHB-Lite buses.
5.7
On-chip SRAM
The LPC1768 contain a total of 64 kB on-chip static RAM memory. This includes
the main 32 kB SRAM, accessible by the CPU and DMA controller on a higher-speed
bus, and two additional 16 kB each SRAM blocks situated on a separate slave port on the
AHB multilayer matrix.
This architecture allows CPU and DMA accesses to be spread over three separate
RAMs that can be accessed simultaneously.
5.8
21
5.9
Memory Map
The LPC1768 incorporates several distinct memory regions, shown in the
following figures. Figure 4 shows the overall map of the entire address space from the
user program viewpoint following reset. The interrupt vector area supports address
remapping.
The AHB peripheral area is 2 MB in size and is divided to allow for up to 128
peripherals. The APB peripheral area is 1 MB in size and is divided to allow for up to 64
peripherals. Each peripheral of either type is allocated 16 kB of space. This allows
simplifying the address decoding for each peripheral.
22
Interrupt Sources
Each peripheral device has one interrupt line connected to the NVIC but may have
several interrupt flags. Individual interrupt flags may also represent more than one
interrupt source.
Any pin on Port 0 and Port 2 (total of 42 pins) regardless of the selected function,
can be programmed to generate an interrupt on a rising edge, a falling edge, or both.
Single DMA and burst DMA request signals. Each peripheral connected to the
DMA Controller can assert either a burst DMA request or a single DMA request.
The DMA burst size is set by programming the DMA Controller.
Memory-to-memory,
memory-to-peripheral,
peripheral-to-memory,
and
Scatter or gather DMA is supported through the use of linked lists. This means
that the source and destination areas do not have to occupy contiguous areas of
memory.
One AHB bus master for transferring data. The interface transfers data when a
DMA request goes active.
Programmable DMA burst size. The DMA burst size can be programmed to more
efficiently transfer data.
Raw interrupt status. The DMA error and DMA count raw interrupt status can be
read prior to masking.
GPIO registers are accessed through the AHB multilayer bus so that the fastest
Mask registers allow treating sets of port bits as a group, leaving other bits
unchanged.
Bit level set and clear registers allow a single instruction to set or clear any
number of bits in one port.
5.14 Ethernet
The Ethernet block contains a full featured 10 Mbit/s or 100 Mbit/s Ethernet MAC
25
Supports 10 Mbit/s or 100 Mbit/s PHY devices including 10 Base-T, 100 BaseTX,100 Base-FX, and 100 Base-T4.
Fully compliant with 802.3x full duplex flow control and half duplex back
pressure.
Memory management:
o Independent transmit and receive buffers memory mapped to shared
SRAM
o DMA managers with scatter/gather DMA and arrays of frame descriptors.
o Memory traffic optimized by buffering and pre-fetching.
26
While USB is in the Suspend mode, the part can enter one of the reduced power
modes and wake up on USB activity.
Supports DMA transfers with all on-chip SRAM blocks on all non-control
endpoints.
Includes a programmable timer required for HNP and Session Request Protocol
(SRP).
Supports any OTG transceiver compliant with the OTG Transceiver Specification
(CEA-2011)
Features
12-Bit ADC
The LPC17xx contain a single 12-bit successive approximation ADC with eight
channels and DMA support.
Features
29
Power-down mode.
Individual result registers for each ADC channel to reduce interrupt overhead.
DMA support.
20-bit DAC
The DAC allows to generate a variable analog output. The maximum output value
of the DAC is VREFP.
Features
10-bit DAC
Buffered output
Power-down mode
DMA support
5.20 UART
The LPC1768 each contain four UARTs. In addition to standard transmit and
receive data lines, UART1 also provides a full modem control handshake interface and
support for RS-485/9-bit mode allowing both software address detection and automatic
address detection using 9-bit mode.
The UARTs include a fractional baud rate generator. Standard baud rates such as
115200 Bd can be achieved with any crystal frequency above 2 MHz.
Features
30
Built-in fractional baud rate generator covering wide range of baud rates without a
need for external crystals of particular values.
Auto baud capabilities and FIFO control mechanism that enables software flow
Control implementation.
UART1 equipped with standard modem interface signals. This module also
provides full support for hardware flow control (auto-CTS/RTS).
Maximum data bit rate of one eighth of the input clock rate
31
Compatible with Motorola SPI, 4-wire Texas Instruments SSI, and National
I2C0 is a standard I2C compliant bus interface with open-drain pins. I2C0 also
supports Fast mode plus with bit rates up to 1 Mbit/s.
I2C1 and I2C2 use standard I/O pins with bit rates of up to 400 kbit/s (Fast I2Cbus).
All I2C-bus controllers support multiple address recognition and a bus monitor
mode.
The interface has separate input/output channels each of which can operate in
master or slave mode.
Configurable word select period in master mode (separately for I2S-bus input and
output).
Two 8-word FIFO data buffers are provided, one for transmit and one for receive.
Controls include reset, stop and mute options separately for I2S-bus input and I2Sbus output.
Two 32-bit capture channels per timer, that can take a snapshot of the timer value
when an input signal transitions. A capture event may also generate an interrupt.
34
5.27
Connected to APB.
Watchdog timer
The purpose of the watchdog is to reset the microcontroller within a reasonable
amount of time if it enters an erroneous state. When enabled, the watchdog will generate a
system reset if the user
36
5.29 Applications:
Photoresistors come in many different types. Inexpensive cadmium sulfide cells
can be found in many consumer items such as camera light meters, street lights, clock
radios, alarms, and outdoor clocks.
They
are
also
used
in
some dynamic
compressors together
with
37
LDRs or Light Dependent Resistors are very useful especially in light/dark sensor
circuits. Normally the resistance of an LDR is very high, sometimes as high as 1000 000
ohms, but when they are illuminated with light resistance drops dramatically.
The animation opposite shows that when the torch is turned on, the resistance of the
LDR falls, allowing current to pass through it.
Circuit Wizard software has been used to display, the range of values of
aORP12,LDR. When a light level of 1000 lux (bright light) is directed towards it, the
resistanceis
400R(ohms).
When a light level of 10 lux (very low light level) is directed towards it, the resistance has
risen dramatically to 10.43M (10430000 ohms).
38
Basic structure:
5.30 Operation:
Light Dependent Resistor made of a high resistance semiconductor, if light falling
on the is of high enough efficiently, photon absorbed by the semiconductor give bound
electrons enough energy to jump into the conduction band. The resulting free electron
(and its hole partner) conduct electricity, thereby lowering resistance.
In intrinsic devices, the only available electrons are in the valence band, and hence
the photon must have enough energy to excite the electrons across the entire band gap.
Extrinsic devices have impurities added , which have a ground state energy closer to the
39
1000
100
Res.
10
0.1
1.0
10
100
( Ftc )*
*1 Ftc = 10.764 lumens
Fig 3.3.2: - Characteristics of LDR
40
Clock radios.
Security alarms.
Optical switches.
Streetlights.
5.33 DC MOTOR
DC motors are configured in many types and sizes, including brush less, servo,
and gear motor types. A motor consists of a rotor and a permanent magnetic field stator.
The magnetic field is maintained using either permanent magnets or electromagnetic
windings. DC motors are most commonly used in variable speed and torque.
Motion and controls cover a wide range of components that in some way are used
to generate and/or control motion. Areas within this category include bearings and
bushings, clutches and brakes, controls and drives, drive components, encoders and
resolves, Integrated motion control, limit switches, linear actuators, linear and rotary
motion components, linear position sensing, motors (both AC and DC motors),
orientation position sensing, pneumatics and pneumatic components, positioning stages,
slides and guides, power transmission (mechanical), seals, slip rings, solenoids springs.
Motors are the devices that provide the actual speed and torque in a drive system.
This family includes AC motor types (single and multiphase motors, universal, servo
motors, induction, synchronous, and gear motor) and DC motors (brush less, servo motor,
and gear motor) as well as linear, stepper and air motors, and motor contactors and
starters.
In any electric motor, operation is based on simple electromagnetism. A currentcarrying conductor generates a magnetic field; when this is then placed in an external
magnetic field, it will experience a force proportional to the current in the conductor, and
to the strength of the external magnetic field. As you are well aware of from playing with
41
42
43
47
49
CHAPTER 6
SOFTWARE REQUIREMENT
6.1 Software Components:
a) ABOUT SOFTWARE
Softwares used are:
*Keil software for c programming
*Express PCB for lay out design
*Express SCH for schematic design
What's New in Vision3?
Vision3 adds many new features to the Editor like Text Templates, Quick
Function Navigation, and Syntax Coloring with brace high lighting Configuration Wizard
for dialog based startup and debugger setup. Vision3 is fully compatible to Vision2 and
can be used in parallel with Vision2.
What is Vision3?
Vision3 is an IDE (Integrated Development Environment) that helps you write,
compile, and debug embedded programs. It encapsulates the following components:
A project manager.
A make facility.
Tool configuration.
Editor.
To help you get started, several example programs (located in the \C51\Examples,
51
CPU Simulation
Vision2 simulates up to 16 Mbytes of memory from which areas can be mapped
for read, write, or code execution access. The Vision2 simulator traps and reports illegal
memory accesses.
In addition to memory mapping, the simulator also provides support for the
integrated peripherals of the various 8051 derivatives. The on-chip peripherals of the CPU
you have selected are configured from the Device
Database selection
you have made when you create your project target. Refer to page 58 for more
Information about selecting a device. You may select and display the on-chip peripheral
components using the Debug menu. You can also change the aspects of each peripheral
using the controls in the dialog boxes.
Start Debugging
You start the debug mode of Vision2 with the Debug Start/Stop Debug Session
command. Depending on the Options for Target Debug Configuration, Vision2 will
load the application program and run the startup code Vision2 saves the editor screen
layout and restores the screen layout of the last debug session. If the program execution
stops, Vision2 opens an editor window with the source text or shows CPU instructions
in the disassembly window. The next executable statement is marked with a yellow arrow.
During debugging, most editor features are still available.
For example, you can use the find command or correct program errors. Program
source text of your application is shown in the same windows. The Vision2 debug mode
differs from the edit mode in the following aspects:
_ The Debug Menu and Debug Commands described on page 28 are
Available. The additional debug windows are discussed in the following.
_ The project structure or tool parameters cannot be modified. All build
Commands are disabled.
52
Disassembly Window
The Disassembly window shows your target program as mixed source and
assembly program or just assembly code. A trace history of previously executed
instructions may be displayed with Debug View Trace Records. To enable the trace
history, set Debug Enable/Disable Trace Recording.
If you select the Disassembly Window as the active window all program step
commands work on CPU instruction level rather than program source lines. You can
select a text line and set or modify code breakpoints using toolbar buttons or the context
menu commands.
You may use the dialog Debug Inline Assembly to modify the CPU
instructions. That allows you to correct mistakes or to make temporary changes to the
target program you are debugging.
B) Keil Software
Installing the Keil software on a Windows PC
Insert the CD-ROM in your computers CD drive
On most computers, the CD will auto run, and you will see the Keil installation
menu. If the menu does not appear, manually double click on the Setup icon, in
the root directory: you will then see the Keil menu.
On the Keil menu, please select Install Evaluation Software. (You will not
require a license number to install this software).
Follow the installation instructions as they appear.
53
Note: you will need to change the file properties after copying: file transferred from the
CD will be read only.
Configuring the Simulator
Open the Keil Vision2
go to Project Open Project and browse for Hello in Ch03_00 in Pont and open it.
54
4. Save the Project by typing suitable project name with no extension in u r own
folder sited in either C:\ or D:\
55
9. Then Click on OK
10. The Following fig will appear
56
14. Click on the file option from menu bar and select new
57
15. The next screen will be as shown in next page, and just maximize it by double
clicking on its blue boarder.
16.
17. Now start writing program in either in C or ASM
18. For a program written in Assembly, then save it with extension . asm and for
C based program save it with extension .C
58
19. Now right click on Source group 1 and click on Add files to Group Source
20. Now you will get another window, on which by default C files will appear.
59
21. Now select as per your file extension given while saving the file
22. Click only one time on option ADD
23. Now Press function key F7 to compile. Any error will appear if so happen.
60
28. Drag the port a side and click in the program file.
61
29. Now keep Pressing function key F11 slowly and observe.
30. You are running your program successfully
Project Workspace-Books
SIMULATION:
The Vision3 Debugger incorporates a C script language you can use to create
Signal Functions. Signal functions let us simulate analog and digital input to the
microcontroller. Signal functions run in the background while Vision3 simulates our
target program.
The Vision3 simulator simulates the timing and logical behaviour of serial
communication protocols like UART, IC, SPI, and CAN. But Vision3 does not simulate
the I/O port toggling of the physical communication pins on the I/O port.
To provide fast simulation speed and optimum access to communication
peripherals, the logic behaviour of communication peripherals is reflected in virtual
registers that are listed with the DIR VTREG command. This has the benefit that we can
easily write debug functions that stimulate complex peripherals.
DIALOGS:
The Vision3 IDE/Debugger provides several dialog pages that are grouped into the
following categories:
File-Device Database: review and modify the microcontroller device list.
File-License Management: manage software licenses.
Edit-Find in Files: text search across multiple files.
Edit Configuration: configure editor, colour & fonts, user keywords, shortcut keys,
and text templates.
View-Symbol Window: list current debug symbols and debug information.
Project Components, Environment, and Books: manage source files, tool
environment, and documentation.
Project-Select Device: select the microcontroller device for the project.
63
Features:
Free
Supports SW debugging
64
Requirements:
Hardware:
512MB memory
20MB Disk space
Operating Systems:
Windows XP / Windows Vista / Windows 7
Support Software
Keil RealView MDK v4.03 or higher
CooCox CoIDE v1.4.0 or higher
Support Series:
Atmel ATSAM3U Series
Energy Micro EFM32 Series
TI LM3S Series
Nuvoton Numicro Series
NXP LPC17xx LPC13xx LPC12xx LPC11xx Series
ST STM32F10x STM32F4x Series
Holtek HT32 Series
Connection Figure:
Preparation:
Before you use this development kit, you need to install CoLinkEx Driver first.
The CoLinkEx USB drivers are different according to the OS of your PC, please
visit http://www.coocox.org/Colinkex.html to download the right one and install it as
below: 1. Double Click the EXE file, enter the installation interface, click Next. The
CoLinkEx USB drivers are different according to the OS of your PC to download the
65
66
4. Click Finish.
Configuration:
CooCox CoIDE
68
69
4. Click Finish.
70
71
6.6 HYPERTERMINAL
USING HYPERTERMINAL
72
73
1. Refresh the HyperTerminal port settings by clicking on CALL of the menu bar then
select Disconnect.
To enable HyperTerminal click on CALL again and this time select Call or
Connect.
2. Verify that a one to one pinned DB9 serial cable is used. The cable should have a
DB9 male on end and a DB9 female on the other. Do not use a cable having gender
changers to get the correct
connector combination. These cables are typically null modem cables and are
not pinned one to one as required and will have DB9 males on both ends of the cable.
The RS-232 cable requires a minimum 3 wires; RXD (pin 2), TXD (pin 3) and
Ground (pin 5).
3. Verify the serial port is operational. Simply shorting the RXD and TXD lines
together on the cable end that plugs into the receiver can do this. Using a small flat
bladed screwdriver short pin 2 to pin 3 while typing characters on the keyboard. If the
port is working you will see whatever you type.
74
CHAPTER 7
RESULT
RESULT ANALYSIS:
The main principal behind the working of this prototype is LDR.LDR gives
the output of variable resistance in Voltage which is then converted to digital values
by ADC in ARM board. Each colour has a unique voltage value in various light
condtions.This prototype is calibrated under different conditions.
75
7.1 ADDVANTAGES
Defense applications
Cost effective
7.2 APPLICATIONS
Guidance system for industrial robots moving on shop floor etc.
Automobile industries
Used in home & industrial automation systems
Defense applications
76
CONCLUSION
The project is aimed at providing complete automated robot which can operate
by itself and can move automatically.This is a prototype which can be implemented in
real time by using components such as logistics,industries,etc.Development can also
be made in the number of sensors incorporated in the robot
77
FUTURE SCOPE
The CPU must merely poll the speech circuits recognition lines occasionally
to check if a command has been issued to the robot.We can even improve upon this
by connecting the recognition line to one of the robots CPU interrupt lines.In future
this can be developed by the use of camera with digital image processing techique so
that it can travel for a greater distance and can be fully automated.Various other
sensors like LDR sensor can be added or IR sensor for avoiding obstacles can also be
added.
78
APPENDIX
CODING:
#include <lpc17xx.h>
void Delay_m(unsigned int x)
{
int k,l;
for(k=0;k<=x;k++)
for(l=0;l<=1500;l++);
}
void Delay(unsigned int x)
{
int y;
for(y=0;y<=x;y++);
}
void init_adc()
{
LPC_PINCON->PINSEL1=0x00550000; // in PINSEL1 we are usinng 17:16 AD0.1
with Function 01
LPC_SC->PCONP|=(1<<12); // in PCONP register we are using 12th bit PCADC
LPC_ADC->ADCR=0x00200B02; // in this AD 0.1 is SEL B==>5.5 Mhz PDN mode
}
unsigned char read_adc(unsigned char ch)
{
long val;
LPC_ADC->ADCR=0x00200B00|(1<<ch);
LPC_ADC->ADCR|=0x01000000;
Delay(150000);
while(!(LPC_ADC->ADGDR&0x80000000)); // ADCGDR 31-bit is DONE bit,this
loop executes untill conversion is completed
val=LPC_ADC->ADGDR;
val=(val>>4)&(0xfff);
return val;
}
79
int main(void)
{
float a,b,c;
LPC_GPIO0->FIODIR=0x000000f0;
init_adc();
a = read_adc(1);
b = read_adc(2);
c = read_adc(3);
a = a*5;
b = b*5;
c = c*5;
while(1)
{
if(a<135 || (b>190 && b<210)|| c<135 ) //black detected at sensor 2
{
LPC_GPIO0->FIOSET = 0x000000A0; // straight
Delay_m(5000);
LPC_GPIO0->FIOCLR = 0x000000A0;
}
if((a>140 && a<160) || ((b>190 && b<210) || (b>140 && b<160))
&& c<130) //yellow detected
{
LPC_GPIO0->FIOSET = 0x00000020; // left
Delay_m(7000);
LPC_GPIO0->FIOCLR = 0x00000020;
}
if(a<135 && ((b>190 && b<210) || (b>140 && b<160)) || (a>140 &&
a<160)) //yellow detected
{
LPC_GPIO0->FIOSET = 0x00000080; // right
Delay_m(7000);
LPC_GPIO0->FIOCLR = 0x00000080;
}
}
}
80
ADC PROGRAMMING
#include "lpc17xx.h"
#define en_high() LPC_GPIO0->FIOSET|=(1<<5)
#define en_low() LPC_GPIO0->FIOCLR|=(1<<5)
#define rs_dat() LPC_GPIO0->FIOSET|=(1<<6)
#define rs_cmd() LPC_GPIO0->FIOCLR|=(1<<6)
#define rw() LPC_GPIO0->FIOCLR|=(1<<7)
void lcd_cmd(unsigned char cmd);
void Delay(unsigned int x)
{
int y;
for(y=0;y<=x;y++);
}
void lcd_init()
{
lcd_cmd(0x28);
lcd_cmd(0x06);
lcd_cmd(0x0c);
lcd_cmd(0x02);
lcd_cmd(0x80);
lcd_cmd(0x01);
}
void lcd_dat(unsigned char dat)
{
rs_dat();
rw();
en_high();
LPC_GPIO1->FIOSET|=(((dat >>4)<<20));
LPC_GPIO1->FIOCLR=~(((dat >>4)<<20));
Delay(90);
en_low() ;
en_high();
LPC_GPIO1->FIOSET|=(((dat )<<20));
LPC_GPIO1->FIOCLR=~(((dat )<<20));
Delay(90);
en_low() ;
LPC_GPIO1->FIOCLR=0x0fffffff;
LPC_GPIO0->FIOCLR=0x0fffffff;
}
void lcd_cmd(unsigned char cmd)
81
}
}
83
LCD Programming:
#include"LPC17xx.h"
#define en_high() LPC_GPIO0->FIOSET=0X00000004
#define en_low() LPC_GPIO0->FIOCLR=0X00000004
#define rs_dat() LPC_GPIO0->FIOSET=0X00000001
#define rs_cmd() LPC_GPIO0->FIOCLR=0X00000001
#define rw() LPC_GPIO0->FIOCLR=0X00000002
void lcd_cmd(unsigned char cmd);
void delay(unsigned int x)
{
int y;
for(y=0;y<=x;y++);
}
void lcd_init()
{
lcd_cmd(0X28);
lcd_cmd(0X06);
lcd_cmd(0X0C);
lcd_cmd(0X02);
lcd_cmd(0X80);
lcd_cmd(0X01);
}
void lcd_dat(unsigned char dat)
{
rs_dat();
rw();
en_high();
LPC_GPIO1->FIOSET=((dat>>4)<<20);
delay(100000);
en_low();
LPC_GPIO1->FIOCLR=0X0FFFFFFF;
}
void lcd_cmd(unsigned char cmd)
{
rs_cmd();
rw();
en_high();
LPC_GPIO1->FIOSET=(cmd<<20);
delay(100000);
en_low();
LPC_GPIO1->FIOCLR=0X0FFFFFFF;
}
void lcd_str(unsigned char *r)
84
lcd_dat(*r);
r++;
}
}
int main (void)
{
LPC_GPIO0->FIODIR=0XFFFFFFFF;
LPC_GPIO1->FIODIR=0XFFFFFFFF;
lcd_init();
while(1)
{
lcd_cmd(0x80);
lcd_str("sammy");
}
}
85
Wheels Programming:
#include<lpc17xx.h>
int main (void)
{
LPC_GPIO0->FIODIR=0XFFFFFF0F;
LPC_PINCON->PINMODE0=0x00000c00;
while (1)
{
if((LPC_GPIO0->FIOPIN0&0X00000020)==(0X00000020))
{
LPC_GPIO0->FIOSET=0X00000001;
}
else
{
LPC_GPIO0->FIOCLR=0X00000001;
}
}
}
86
87
Switch:
#include<LPC17xx.h>
void main()
{
LPC_GPIO0->FIODIR=0XFFFFFF0F;
if((LPC_FIOPIN0 & 0X00000020)==00000000)
{
LPC_GPIO0->FIOSET=0X00000001;
else
LPC_GPIO0->FIOCLR=0X00000001;
}
}
88
Keyboard config:
#include<LPC17xx.h>
void main()
{
LPC_GPIO0->FIODIR=0XFFFFFF0F;
if((LPC_FIOPIN0 & 0X00000020)==00000000)
{
LPC_GPIO->FIOSET=0X00000001;
else
LPC_GPIO0->FIOCLR=0X00000001;
}
}
89
REFERRENCES
1.The 8051 microcontroller-Kenneth Ayala,3rd reprint,2005;Thomson
2.Asia Ltd.,Singapore; Chapter 3,6,7&8. For programming 89S51
3.ARM7TDMI datasheet
4.L293D motor driver IC datasheet.
5.The ARM Cortex-M3 processor datasheet.
6.LPC1769/68/67/66/65/64/63
http://www.arm.com
http://www.lpc2000.com
www.nxp.com
90