27-10-2016, 11:06 AM
1461590210-NEWCHAPTERS.docx (Size: 5.24 MB / Downloads: 5)
1 Introduction:
In coming days is to face new challenges. Hence every field prefers automated control systems. Especially in the field of electronics automated systems are doing better performance. As Zigbee is the upcoming technology in wireless field, we had tried to demonstrate its way of functionality and various aspects like kinds, advantages and disadvantages using a small application of controlling the any kind of electronic devices and machines. The zig-bee technology is broadly adopted for bulk and fast data transmission over a dedicated channel.
In our project we have two sections, one is transmitter another one Receiver, and in transmitting section we have CONTROLLER, touch screen, zigbee. In receiver section we have CONTROLLER, touch screen, zigbee. In transmitted section whichever the data that we pressed on the touch screen pad will be taken by the CONTROLLER. Then processor gives the receive data to the Zigbee module .then Zigbee converts the receive data into the form of RF digitals waves and transmits that waves in certain range. In receiving section whenever Zigbee comes in the RF range of data waves of the transmitter, it receives the data and gives to the PC through MAX232 and displays the data transmitted by the transmitting section.
1.2 Project Overview:
An embedded system is a combination of software and hardware to perform a dedicated task. Some of the main devices used in embedded products are Microprocessors and Microcontrollers.
Microprocessors are commonly referred to as general purpose processors as they simply accept the inputs, process it and give the output. In contrast, a microcontroller not only accepts the data as inputs but also manipulates it, interfaces the data with various devices, controls the data and thus finally gives the result.
The project “Next Generation AD-HOC wireless chatting system using touch screen” using ARM LPC 2148/AT89S52 is broadly adopted for bulk and fast data transmission over a dedicated channel.controller is an exclusive project that a zig-bee technology.
1.3 Thesis Overview:
The thesis explains the implementation of “Next Generation AD-HOC wireless chating system using touch screen” using arm LPC2148/A789S52 controller. The organization of the thesis is explained here with:
Chapter 1: Presents introduction to the overall thesis and the overview of the project. In the project overview a brief introduction of Next Generation AD-HOC wireless chating system using touch screen and its applications are discussed.
Chapter 2: Presents the topic embedded systems. It explains the about what is embedded systems, need for embedded systems, explanation of it along with its applications.
Chapter 3: Presents the hardware description. It deals with the block diagram of the project and explains the purpose of each block. In the same chapter the explanation of controllers (ARM LPC2148/AT89S52),LCD, touch screen keypad, ,Zigbee power supply unit, Max 232IC and miscellinious components are considered.
Chapter 4: Presents the software description. It explains the implementation of the project using PIC C Compiler software.
Chapter 5: Presents the project description along with touchscreen keypad, power supply interfacing to microcontroller.
Chapter 6: Presents the advantages, disadvantages and applications of the project.
Chapter7: Presents the results, conclusion and future scope of the project.
2.1 Embedded Systems:
An embedded system is a computer system designed to perform one or a few dedicated functions often with real-time computing constraints. It is embedded as part of a complete device often including hardware and mechanical parts. By contrast, a general-purpose computer, such as a personal computer (PC), is designed to be flexible and to meet a wide range of end-user needs. Embedded systems control many devices in common use today.
Embedded systems are controlled by one or more main processing cores that are typically either microcontrollers or digital signal processors (DSP). The key characteristic, however, is being dedicated to handle a particular task, which may require very powerful processors. For example, air traffic control systems may usefully be viewed as embedded, "embedded system" is not a strictly definable term, as most systems have some element of extensibility or programmability. Handheld computers share some elements with embedded systems such as the operating systems and microprocessors which power them, but they allow different applications to be loaded and peripherals to be connected. On a continuum from "general purpose" to "embedded", large application systems will have subcomponents at most points even if the system as a whole is "designed to perform one or a few dedicated functions", and is thus appropriate to call "embedded".
Labeled parts include microprocessor (4), RAM (6), flash memory (7).Embedded systems programming is not like normal PC programming. In many ways, programming for an embedded system is like programming PC 15 years ago. The hardware for the system is usually chosen to make the device as cheap as possible. Spending an extra dollar a unit in order to make things easier to program can cost millions. Hiring a programmer for an extra month is cheap in comparison. This means the programmer must make do with slow processors and low memory, while at the same time battling a need for efficiency not seen in most PC applications. Below is a list of issues specific to the embedded field.
2.1.1 History:
In the earliest years of computers in the 1930–40s, computers were sometimes dedicated to a single task, but were far too large and expensive for most kinds of tasks performed by embedded computers of today. Over time however, the concept of programmable controllers evolved from traditional electromechanical sequencers, via solid state devices, to the use of computer technology. One of the first recognizably modern embedded systems was the Apollo Guidance Computer, developed by Charles Stark Draper at the MIT Instrumentation Laboratory. At the project's inception, the Apollo guidance computer was considered the riskiest item in the Apollo project as it employed the then newly developed monolithic integrated circuits to reduce the size and weight. An early mass-produced embedded system was the Automatics D-17 guidance computer for the Minuteman missile, released in 1961. It was built from transistor logic and had a hard disk for main memory. When the Minuteman II went into production in 1966, the D-17 was replaced with a new computer that was the first high-volume use of integrated circuits.
2.1.2 Tools:
Embedded development makes up a small fraction of total programming. There's also a large number of embedded architectures, unlike the PC world where 1 instruction set rules, and the Unix world where there's only 3 or 4 major ones. This means that the tools are more expensive. It also means that they're lower featured, and less developed. On a major embedded project, at some point you will almost always find a compiler bug of some sort.Debugging tools are another issue. As a result, people doing embedded programming quickly become masters at using serial IO channels and error message style debugging.
2.1.3 Resources:
To save costs, embedded systems frequently have the cheapest processors that can do the job. This means your programs need to be written as efficiently as possible. When dealing with large data sets, issues like memory cache misses that never matter in PC programming can hurt you. Luckily, this won't happen too often- use reasonably efficient algorithms to start, and optimize only when necessary. Of course, normal profilers won't work well, due to the same reason debuggers don't work well.
Memory is also an issue. For the same cost savings reasons, embedded systems usually have the least memory they can get away with. That means their algorithms must be memory efficient (unlike in PC programs, you will frequently sacrifice processor time for memory, rather than the reverse). It also means you can't afford to leak memory. Embedded applications generally use deterministic memory techniques and avoid the default "new" and "malloc" functions, so that leaks can be found and eliminated more easily. Other resources programmers expect may not even exist. For example, most embedded processors do not have hardware FPUs (Floating-Point Processing Unit). These resources either need to be emulated in software, or avoided altogether.
2.1.4 Real Time Issues:
Embedded systems frequently control hardware, and must be able to respond to them in real time. Failure to do so could cause inaccuracy in measurements, or even damage hardware such as motors. This is made even more difficult by the lack of resources available. Almost all embedded systems need to be able to prioritize some tasks over others, and to be able to put off/skip low priority tasks such as UI in favor of high priority tasks like hardware control.
2.2 Need For Embedded Systems:
The uses of Embedded systems are virtually limitless, because every day new products are introduced to the market that utilizes embedded computers in novel ways. In recent years, hardware such as microprocessors, microcontrollers, and FPGA chips have become much cheaper. So when implementing a new form of control, it's wiser to just buy the generic chip and write your own custom software for it. Producing a custom-made chip to handle a particular task or set of tasks costs far more time and money. Many embedded computers even come with extensive libraries, so that "writing your own software" becomes a very trivial task indeed. From an implementation viewpoint, there is a major difference between a computer and an embedded system. Embedded systems are often required to provide Real-Time response. The main elements that make embedded systems unique are its reliability and ease in debugging.
3.2 Micro processor:
3.2.1 Introduction to Microprocessor:
Microprocessors and microcontrollers are widely used in embedded systems products. Microprocessors are used in products like general purpose computers.The c.p.u, memories, timers, Input/output ports, serial communication, interrupts etc. The memory size, number of ports etc.., The clock rates are faster when compared to micro controller.They are in gega hertz for microprocessor. The microprocessor used in this project is ARM.
The features, pin description of the microcontroller used are discussed in the following sections.
3.2.2 Description:
Introduction to ARM processor:
ARM Processor was developed at Acorn computer limited of Cambridge, England between 1983 and 1985.This was after RISC concept came out at Stanford and Berkeley universities in 1980. ARM uses Enhanced RISC Architecture.ARM (Acorn RISC machine) limited was found in 1990. ARM designed basic core structure and licensed it to many partners who develop and fabricate new Micro Controllers and different chips. ARM processor is mainly intended in the development of embedded applications which involve complex computations.
ARM ARCHITECTURE:
ARM architecture is based on Enhanced RISC architecture (deviates from classic RISC architecture).
Embedded applications need to have :
• High code density
• Low power consumption rate
• Small silicon foot print
A large uniform register file (bank).
Load-Store architecture, where data processing operations involve only registers but not memory locations.
Uniform and Fixed length instructions.
Good speed/power consumption ratio.
High code density.
Enhancements to Classic RISC architecture:
Control over ALU and Shifter (Barrel Shifter) which helps maximum usage of hardware on the chip.
Auto increment and Auto decrement of addressing modes to optimize program loops.
Load and Store multiple data elements through a single instruction, which increases data throughput.
A lot of branch instructions which can be used in conjunction with a number of instructions, which maximizes execution throughput.
VERSIONS:
V1 (1983-85) 26 bit addressing mode, no multiply or co-processor.
V2 32 bit addressing mode, multiply, co-processor.
V3 32 bit addressing.
V4 Add signed and unsigned words.
V4T Thumb instruction set (16-bit instruction set)
V5T Superset of 4T with new instructions
V5TE Add Signal processing
Examples:
ARM 6 V3
ARM 7 V3
ARM7TDMI V4T
Strong ARM V4
ARM 9E-S V5TE
ARM LPC2148 Micro Controller:
ARM LPC2148 is a 64 pin Micro Controller which comes under ARM 7 version of ARM processors. It comes under the processor core architecture ARM7TDMI-S.It is a 32 bit Micro Controller .This is intended for high end applications involving complex computations. It follows the enhanced RISC architecture. It has high performance and very low power consumption. It has serial communications interfaces ranging from a USB 2.0 Full Speed device, multiple UARTS, SPI, and I2Cs. Various 32-bit timers, dual 10-bit ADC(s), single 10-bit DAC, PWM channels and 45 fast GPIO lines with 9 interrupt pins.
Features:
16/32-bit ARM7TDMI-S microcontroller in a tiny LQFP64 package.
32 + 8 kB of on-chip static RAM and 512 kB of on-chip flash program memory .
In-System/In-Application Programming (ISP/IAP) via on-chip boot-loader software.
Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip Real Monitor software and high speed tracing of instruction execution.
USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the LPC2148 provide 8 kB of on-chip RAM accessible to USB by DMA.
Two 10-bit A/D converters provide a total of 14 analog inputs, with conversion times as low as 2.44 µs per channel.
Single 10-bit D/A converter provide variable analog output.
Two 32-bit timers/external event counters (with four capture and four compare channels each), PWM unit (six outputs) and watchdog.
Low power real-time clock with independent power and dedicated 32 kHz clock input
Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s), SPI and SSP with buffering and variable data length capabilities.
Vectored interrupt controller with configurable priorities and vector addresses.
Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.
Up to nine edge or level sensitive external interrupt pins available.
60 MHz maximum CPU clock available from programmable on-chip PLL with settling time of 100 µs.
On-chip integrated oscillator operates with an external crystal in range from 1 MHz to 30 MHz and with an external oscillator up to 50 MHz.
Power saving modes include idle and Power-down.
Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power optimization.
Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect (BOD) or Real-Time Clock (RTC).
Single power supply chip with Power-On Reset (POR) and BOD circuits: – CPU operating voltage range of 3.0 V to 3.6 V (3.3 V ± 10 %) with 5 V tolerant I/O pads.
Architectural Overview:
1. ON CHIP MEMORIES:
It has a flash memory of 512KB which can be used for both code and data storage.
12KB is intended for boot loader i.e., user code flash memory is 500KB.
Programming flash memory can be done via system serial port.
This memory can be erased or programmed while running the application.
It provides minimum of 1, 00,000 erase/write cycles with 20 years data retention capability.
It has on chip static RAM of 32 KB and 8KB is intended for USB usage.
2. VECTORED INTERRUPT CONTROLLER:
This controller accepts all interrupts as input and categorize them under different interrupt modules. There are 3 types of interrupt modules
FAST INTERRUPT REQUEST: This got the highest priority. If only one interrupt is available it will directly run from interrupt vector location. If more than one interrupt is available VIC combines these signals and places them in a service routine.
VECTORED INTERRUPT REQUEST: This got the middle priority. It can handle 16 interrupts from peripherals .It has a service routine size 0 to 15 of which 0 has highest priority and 15 with lowest priority. We can directly assign any of the slots.
NON VECTORED INTERRUPT REQUEST: This got the lowest priority. If no vectored interrupts are available, then these requests are attended.
Each peripheral one line connected to VECTOR INTERRUPT CONTROLLER.
3.PIN CONNECT BLOCK: This blocks allows the pins of the Micro Controller to perform multiple functions. Configuration registers allows the multiplexers to allow connection between the pin and peripheral. After reset all pins of port0 and port1 are configured as input with following exceptions:If JTAG debugger mode is active, then the JTAG pins will have JTAG functionality.
4.10-bit ADC: This Micro Controller has 2 ADC ports.Port 0 has 6 channels and port 1 has 8 channels.
10 bit successive approximation analog to digital converter.
Measurement range of 0 V to VREF (2.0 V <= VREF <= VDDA).
Each converter capable of performing more than 400,000 10-bit samples per second.
Every analog input has a dedicated result register to reduce interrupt overhead.
5. Real-time clock: The RTC is designed to provide a set of counters to measure time when normal or idle Operating mode is selected. The RTC has been designed to use little power, making it suitable for battery powered systems where the CPU is not running continuously (Idlemode).
Features:
Measures the passage of time to maintain a calendar and clock.
Ultra-low power design to support battery powered systems.
Provides Seconds, Minutes, Hours, Day of Month, Month, Year, Day of Week, and Day of Year.
Can use either the RTC dedicated 32 kHz oscillator input or clock derived from the external crystal/oscillator input at XTAL1.
Dedicated power supply pin can be connected to a battery or the main 3.3 V.
Microcontroller:
1. The central processing unit, serial communication, timers,
Memories, interrupts, input/output ports etc.., are equipped on the same single chip.
2. It occupies less space, so it consumes less power, and also the cost also very low when compared to microprocessor.
3. Used for products that performs only a specified task.
eg: air conditioner, microwave oven, remote controls etc..,
4. Only a single software application is generally used.
5. Using microcontroller only a specified task can be done basing on specified time periods.
6. The memory size, number of ports etc.., are very limited.
7. A compact instruction or a reduced instruction set is generally used for the applications when we use microcontroller.
8. The clock rates are slower when compared to microprocessor. They are in mega hertz.
The supply voltage for micro controllers ranges from 2v to 6v direct current. As our mains supply is of 230volts A.C, we need a process of conversion of the power supply.
Microcontroller features:
Microcontrollers from different manufacturers have different architectures and different capabilities. Some may suit to a particular application while some others may be totally unsuitable. The hardware features of microcontrollers in general are described in this section.
1.Supply voltage: Most microcontrollers operate with the standard +5 V supply. Some microcontrollers can operate at as low as +2.7 V and some will tolerate +6 V without any problems. You should check the manufacturers' data sheets about the allowed limits of the supply voltage.
2. The clock: All microcontrollers require an oscillator (known as a clock) to operate. Microcontrollers will operate with a crystal and two capacitors.
3. Timers: Timers are an important part of any microcontroller. A timer is basically a counter which is driven from an accurate clock (or a division of this clock). Timers can be 8-bits or 16-bits long. Data can be loaded into the timers and they can be started and stopped under software control. Most timers can be configured to generate an interrupt when they reach a certain count (usually when they overflow).
Some microcontrollers offer capture and compare facilities where a timer value can be read when an external event occurs, or the timer value can be compared to a preset value and interrupts can be generated when this value is reached. Timers can also be used to generate time delays in programs. It is typical to have at least one timer on every microcontroller. Some microcontrollers may have three or more while some others may have only two timers. The timer accuracy depends upon the type of clock device used and a crystal device should be chosen for very accurate timing applications.
4. Watchdog Timer: Many microcontrollers have at least one watchdog facility, also known as the Watchdog Timer (or WDT). A WDT is usually an 8-bit timer with a percale option and is clocked from a free running on-chip oscillator. The watchdog is usually refreshed by the user program at regular intervals and a reset occurs if the program fails to refresh the watchdog. Watchdog facilities are commonly used in real-time systems where it is required to check the proper termination of one or more activities. All PIC microcontrollers are equipped with a WDT.
5. Reset input: This input resets the microcomputer. The reset logic is used to place the microcontroller into a known state. The source of the reset can usually be selected by the user and Power-on Reset (POR) is the most common form of reset in microcontrollers. Most microcontrollers have resistors connected to the supply voltage and this ensures that the microcontroller starts properly after the application of power (POR). Microcontroller manufacturers specify the state of the various registers after a reset signal is applied to a microcontroller. Some microcontrollers have internal reset circuitry which does not require any external components.
6. Interrupts: Interrupts are a very important concept in microcontrollers. An interrupt causes a microcontroller to respond to external and internal (e.g. timer) events very quickly. When an interrupt occurs the microcontroller leaves its normal flow of execution and jumps directly to the Interrupt Service Routine (ISR). The source of an interrupt can either be internal or external. Internal interrupts are usually generated by the built-in timer circuits when the timer count reaches a certain value.
External interrupts are generated by the devices connected external to the microcontroller and these interrupts are asynchronous, i.e. it is not known when an external interrupt will be generated. An example is the analogue-to-digital (A/D) conversion complete interrupt, which is generated when a conversion is completed. Interrupts can in general be nested such that a new interrupt can suspend the execution of another interrupt.
7. Brown-out detector: Brown-out detectors are also common in many microcontrollers and they reset a microcontroller if the supply voltage falls below a nominal value. Brownout detectors are usually employed to prevent unpredictable operation at low voltages, especially to protect the contents of EEPROM type memories. ARM microcontrollers are equipped with Brown-out detector circuits.
8. Analogue-to-digital converter: Some microcontrollers are equipped with A/D converter circuits. Usually these converters are 8-bits, but some microcontrollers have 10- or even 12-bit converters. Some microcontrollers have multiple A/D channels (e.g. PIC16F877 is equipped with eight A/D channels). A/D converters usually generate interrupts when a conversion is complete so that the user program can read the converted data very quickly. A/D converters are very useful in control and monitoring applications since most sensors produce analogue output voltages.
9. Serial input/output: Some microcontrollers contain hardware to implement serial asynchronous communications interface. The baud rate and the data format can usually be selected in software by the programmer. The built-in timer circuits are usually used to generate an accurate baud rate. If serial I/O hardware is not provided, it is easy to develop software to implement serial data transfer using any I/O pin of a microcontroller. Some microcontrollers incorporate SPI (Serial Peripheral Interface), I2C (Integrated Interconnect), or CAN (Controller Area Network) bus interfaces. These enable a microcontroller to interface to other compatible devices easily.
10. In-circuit programming: In microcontroller development cycle, a microcontroller is normally removed from its socket and then programmed using a programmer device. The programmed chip is then re-inserted into its socket, ready for testing. This is usually very tedious work, especially during the development of complex software projects. In-circuit programming enables a microcontroller to be programmed while the chip is in the applications circuit, i.e. there is no need to remove the chip for programming. This feature speeds up the program development cycle considerably.
11. PWM output: Some microcontrollers provide Pulse-width Modulated (PWM) outputs which can be used in some electronic applications. One such application is to provide an effective analog output from a microcontroller by varying the duty cycle of the PWM output. It is possible to modify the period or the duty cycle of a PWM output by loading the appropriate registers.
12. Capture-compare capability: In some microcontrollers, the value of a timer register can be captured dynamically and then compared against a preset value. When the timer value is equivalent to the compared value, an output can be forced high or low.
13. Real-time clock: Real-time clock is another feature which is implemented in some microcontrollers. These microcontrollers usually keep the date and time of day and they are intended for the consumer market and for some real-time tasks.
Microcontroller architectures:
1. Von Neumann Architecture (Princeton Architecture)
2. Harvard Architecture
Von Neumann architecture is used by a very large percentage of microcontrollers and here all memory space is on the same bus and instruction and data are treated identically. In the Harvard architecture, code and data storage have separate blocks and separate set of buses to carry code and data, this allows code and data to be fetched simultaneously, resulting in a more efficient implementation.
3.3 REGULATED POWER SUPPLY:
3.3.1 Introduction:
Power supply is a supply of electrical power. A device or system that supplies electrical or other types of energy to an output load or group of loads is called a power supply unit or PSU. The term is most commonly applied to electrical energy supplies, less often to mechanical ones, and rarely to others.A power include primary and secondary sources.
• Conversion of one form of electrical power to another desired form and voltage, typically involving converting AC line voltage to a well-regulated lower-voltage DC for electronic devices. Low voltage, low power DC power supply units are commonly integrated with the devices they supply, such as computers and household electronics.
• Batteries.
• Chemical fuel cells and other forms of energy storage systems.
• Solar power.
• Generators or alternators.