Sie sind auf Seite 1von 23

Advance Real Time Embedded Systems

A Training Project Report

Table of Content

1.0 Introduction of Organization......................................................................................1-6

1.1 History................................................................................................................1
1.2 NIIT Bombay......................................................................................................2
1.3 Acknowledgement..............................................................................................4
1.4 Franchise Support...............................................................................................5
1.5 Franchise Process................................................................................................6

2.0 Introduction of Embedded C......................................................................................7-14

2.1 Variety of Embedded C.......................................................................................9


2.2 Characteristics......................................................................................................10
2.3 User Interface.......................................................................................................10
2.4 Process in Embedded C........................................................................................11
2.5 Reliability..............................................................................................................11
2.6 Peripherals.............................................................................................................12
2.7 Tools......................................................................................................................13

3.0 PROJECT....................................................................................................................14-15

4.0 Important Terms used in Project..............................................................................16-20

4.1 ATMEL (AVR)...................................................................................................16


4.1.1 Brief History...........................................................................................16
4.1.2 Basic Families.........................................................................................16

4.2 UART..................................................................................................................18
4.2.1 Transmitting/Receiving Serial Data......................................................18

5.0 Conclusion...................................................................................................................20

6.0 Bibilography...................................................................................................................

M.M.E.C. Mullana Page 1


Advance Real Time Embedded Systems

2.0 Introduction to Embedded C:

Embedded C is a set of language extensions for the C Programming language by the


Standards committee to address commonality issues that exist between C extensions for
different embedded systems. Historically, embedded C programming requires nonstandard
extensions to the C language in order to support exotic features such as fixed-point
arithmetic, multiple distinct memory banks, and basic I/O operations.

An embedded system is a computer system designed for specific control functions within a
larger system, 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-

M.M.E.C. Mullana Page 2


Advance Real Time Embedded Systems

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 contain processing cores that are either microcontrollers or digital signal
processors (DSP). The key characteristic, however, is being dedicated to handle a particular
task. Since the embedded system is dedicated to specific tasks, design engineers can optimize
it to reduce the size and cost of the product and increase the reliability and performance.
Some embedded systems are mass-produced, benefiting from economies of scale.

Physically, embedded systems range from portable devices such as digital watches and MP3
players, to large stationary installations like traffic lights,factory controllers. Complexity
varies from low, with a single microcontroller chip, to very high with multiple
units, peripherals and networks mounted inside a large chassis or enclosure.

In 2008, the C Standards Committee extended the C language to address these issues by
providing a common standard for all implementations to adhere to. It includes a number of
features not available in normal C, such as, fixed-point arithmetic, named address spaces, and
basic I/O hardware addressing.

Embedded C use most of the syntax and semantics of standard C, e.g., main() function,
variable definition, datatype declaration, conditional statements (if, switch. case), loops
(while, for), functions, arrays and strings, structures and union, bit operations, macros,
unions,etc

Looking around, we find ourselves to be surrounded by various types of embedded systems.


Be it a digital camera or a mobile phone or a washing machine, all of them has some kind of
processor functioning inside it. Associated with each processor is the embedded software. If
hardware forms the body of an embedded system, embedded processor acts as the brain, and
embedded software forms its soul. It is the embedded software which primarily governs the
functioning of embedded systems.

During infancy years of microprocessor based systems, programs were developed using
assemblers and fused into the EPROMs. There used to be no mechanism to find what the
program was doing. LEDs, switches, etc. were used to check correct execution of the
program. Some ‘very fortunate’ developers had In-circuit Simulators (ICEs), but they were
too costly and were not quite reliable as well.

M.M.E.C. Mullana Page 3


Advance Real Time Embedded Systems

As time progressed, use of microprocessor-specific assembly-only as the programming


language reduced and embedded systems moved onto C as the embedded programming
language of choice. C is the most widely used programming language for embedded
processors/controllers. Assembly is also used but mainly to implement those portions of the
code where very high timing accuracy, code size efficiency, etc. are prime requirements.

Initially C was developed by Kernighan and Ritchie to fit into the space of 8K and to write
(portable) operating systems. Originally it was implemented on UNIX operating systems. As
it was intended for operating systems development, it can manipulate memory addresses.
Also, it allowed programmers to write very compact codes. This has given it the reputation as
the language of choice for hackers too.

As assembly language programs are specific to a processor, assembly language didn’t offer
portability across systems. To overcome this disadvantage, several high level languages,
including C, came up. Some other languages like PLM, Modula-2, Pascal, etc. also came but
couldn’t find wide acceptance. Amongst those, C got wide acceptance for not only embedded
systems, but also for desktop applications. Even though C might have lost its sheen as
mainstream language for general purpose applications, it still is having a strong-hold in
embedded programming. Due to the wide acceptance of C in the embedded systems,
various kinds of support tools like compilers & cross-compilers, ICE, etc. came up and all
this facilitated development of embedded systems using C.

2.1 Variety of embedded systems :


Embedded systems are widespread in consumer, industrial, commercial and military
applications.

Telecommunications systems employ numerous embedded systems from telephone


switches for the network to mobile phones at the end-user. Computer networking uses
dedicated routers and network bridges to route data.

Consumer electronics include personal digital assistants (PDAs), mp3 players, mobile
phones, videogame consoles, digital cameras, DVD players, GPS receivers, and printers.
Many household appliances, such as microwave ovens, washing machines and dishwashers,
include embedded systems to provide flexibility, efficiency and features.
Advanced HVAC systems use networked thermostats to more accurately and efficiently
control temperature that can change by time of day and season. Home automation uses wired-

M.M.E.C. Mullana Page 4


Advance Real Time Embedded Systems

and wireless-networking that can be used to control lights, climate, security, audio/visual,
surveillance, etc., all of which use embedded devices for sensing and controlling.

Transportation systems from flight to automobiles increasingly use embedded systems. New
airplanes contain advanced avionics such as inertial guidance systems and GPS receivers that
also have considerable safety requirements. Various electric motors — brushless DC
motors, induction motors and DC motors — use electric/electronic motor
controllers. Automobiles, electric vehicles, and hybrid vehicles increasingly use embedded
systems to maximize efficiency and reduce pollution. Other automotive safety systems
include anti-lock braking system (ABS), Electronic Stability Control (ESC/ESP), traction
control (TCS) and automatic four-wheel drive.

2.2 CHARACTERISTICS:
1. Embedded systems are designed to do some specific task, rather than be a general-purpose
computer for multiple tasks. Some also have real-time performance constraints that must be
met, for reasons such as safety and usability; others may have low or no performance
requirements, allowing the system hardware to be simplified to reduce costs.

2. Embedded systems are not always standalone devices. Many embedded systems consist of
small, scomputerized parts within a larger device that serves a more general purpose. For
example, the Gibson Robot Guitar features an embedded system for tuning the strings, but the
overall purpose of the Robot Guitar is, of course, to play music.[5] Similarly, an embedded
system in an automobile provides a specific function as a subsystem of the car itself.

3. The program instructions written for embedded systems are referred to as firmware, and
are stored in read-only memory or Flash memory chips. They run with limited computer
hardware resources: little memory, small or non-existent keyboard or screen.

2.3 User interface


Embedded systems range from no user interface at all — dedicated only to one task — to
complex graphical user interfaces that resemble modern computer desktop operating systems.
Simple embedded devices use buttons, LEDs, graphic or character LCDs (for example
popular HD44780 LCD) with a simple menu system.

More sophisticated devices which use a graphical screen with touch sensing or screen-edge
buttons provide flexibility while minimizing space used: the meaning of the buttons can

M.M.E.C. Mullana Page 5


Advance Real Time Embedded Systems

change with the screen, and selection involves the natural behavior of pointing at what's
desired. Handheld systems often have a screen with a "joystick button" for a pointing device.

2.4 Processors in embedded systems


Embedded processors can be broken into two broad categories. Ordinary microprocessors
(μP) use separate integrated circuits for memory and peripherals. Microcontrollers (μC) have
many more peripherals on chip, reducing power consumption, size and cost. In contrast to the
personal computer market, many different basic CPU architectures are used, since software is
custom-developed for an application and is not a commodity product installed by the end
user. Both Von Neumannas well as various degrees of Harvard architectures are
used. RISC as well as non-RISC processors are found. Word lengths vary from 4-bit to 64-
bits and beyond, although the most typical remain 8/16-bit. Most architectures come in a
large number of different variants and shapes, many of which are also manufactured by
several different companies.

2.5 Reliability

Embedded systems often reside in machines that are expected to run continuously for years
without errors, and in some cases recover by themselves if an error occurs. Therefore the
software is usually developed and tested more carefully than that for personal computers, and
unreliable mechanical moving parts such as disk drives, switches or buttons are avoided.

Specific reliability issues may include:

 The system cannot safely be shut down for repair, or it is too inaccessible to repair.
Examples include space systems, undersea cables, navigational beacons, bore-hole
systems, and automobiles.
 The system must be kept running for safety reasons. "Limp modes" are less tolerable.
Often backups are selected by an operator. Examples include aircraft navigation, reactor
control systems, safety-critical chemical factory controls, train signals.
 The system will lose large amounts of money when shut down: Telephone switches,
factory controls, bridge and elevator controls, funds transfer and market making,
automated sales and service.

A variety of techniques are used, sometimes in combination, to recover from errors—both


software bugs such as memory leaks, and also soft errors in the hardware:

M.M.E.C. Mullana Page 6


Advance Real Time Embedded Systems

 watchdog timer that resets the computer unless the software periodically notifies the
watchdog
 subsystems with redundant spares that can be switched over to
 software "limp modes" that provide partial function
 Designing with a Trusted Computing Base (TCB) architecture[7] ensures a highly secure
& reliable system environment
 An Embedded Hypervisor is able to provide secure encapsulation for any subsystem
component, so that a compromised software component cannot interfere with other
subsystems, or privileged-level system software. This encapsulation keeps faults from
propagating from one subsystem to another, improving reliability. This may also allow a
subsystem to be automatically shut down and restarted on fault detection.
 Immunity Aware Programming

2.6 Peripherals

Embedded Systems talk with the outside world via peripherals, such as:

 Serial Communication Interfaces (SCI): RS-232, RS-422, RS-485 etc.


 Synchronous Serial Communication Interface: I2C, SPI, SSC and ESSI (Enhanced
Synchronous Serial Interface)
 Universal Serial Bus (USB)
 Multi Media Cards (SD Cards, Compact Flash etc.)
 Networks: Ethernet, LonWorks, etc.
 Fieldbuses: CAN-Bus, LIN-Bus, PROFIBUS, etc.
 Timers: PLL(s), Capture/Compare and Time Processing Units
 Discrete IO: aka General Purpose Input/Output (GPIO)

M.M.E.C. Mullana Page 7


Advance Real Time Embedded Systems

 Analog to Digital/Digital to Analog (ADC/DAC)


 Debugging: JTAG, ISP, ICSP, BDM Port, BITP, and DP9 ports.

2.7 Tools
As with other software, embedded system designers use compilers, assemblers,
and debuggers to develop embedded system software. However, they may also use some
more specific tools:

 In circuit debuggers or emulators (see next section).


 Utilities to add a checksum or CRC to a program, so the embedded system can check if
the program is valid.
 For systems using digital signal processing, developers may use a math workbench such
as Scilab / Scicos, MATLAB / Simulink, EICASLAB, MathCad, Mathematica,or FlowSt
one DSP to simulate the mathematics. They might also use libraries for both the host and
target which eliminates developing DSP routines as done in DSPnano RTOS and Unison
Operating System.
 A model based development tool like VisSim lets you create and simulate graphical data
flow and UML State chart diagrams of components like digital filters, motor controllers,
communication protocol decoding and multi-rate tasks. Interrupt handlers can also be
created graphically. After simulation, you can automatically generate C-code to
the VisSim RTOS which handles the main control task andpreemption of background
tasks, as well as automatic setup and programming of on-chip peripherals.
 Custom compilers and linkers may be used to optimize specialized hardware.
 An embedded system may have its own special language or design tool, or add
enhancements to an existing language such as Forth or Basic.
 Another alternative is to add a real-time operating system or embedded operating system,
which may have DSP capabilities like DSPnano RTOS.
 Modeling and code generating tools often based on state machines

Software tools can come from several sources:

 Software companies that specialize in the embedded market


 Ported from the GNU software development tools
 Sometimes, development tools for a personal computer can be used if the embedded
processor is a close relative to a common PC processor

M.M.E.C. Mullana Page 8


Advance Real Time Embedded Systems

PROJECT ON: To display alphabets on LCD with AVR microcontroller(ATmega16)


using persistence of vision

LETTER A

#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRC=0xff;
char a[]={1,2,4,8,16,48,80,144,80,48,16,8,4,2,1},i;
while(1)
{
for( i=0;i<14 ;i++)
{
PORTC=~a[i];
_delay_ms(3);
}
}
}

LETTER B

#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRC=0xff;
char a[]={255,145,145,145,255},i;
while(1)
{
for( i=0;i<5;i++)
{
PORTC=~a[i];
_delay_ms(3);
}

}
}

LETTER C

#include<avr/io.h>

M.M.E.C. Mullana Page 9


Advance Real Time Embedded Systems

#include<util/delay.h>
void main()
{
DDRC=0xff;
char a[]={255,129,129,129,129},i;
while(1)
{
for( i=0;i<5;i++)
{
PORTC=~a[i];
_delay_ms(5);
}

}
}

LETTER D

#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRC=0xff;
char a[]={255,129,129,129,129,255},i;
while(1)
{
for( i=0;i<5;i++)
{
PORTC=~a[i];
_delay_ms(5);
}

}
}

LETTER E

#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRC=0xff;
char a[]={255,145,145,145,145},i;
while(1)
{
for( i=0;i<5;i++)
{
PORTC=~a[i];
_delay_ms(5);
}
}
}

LETTER F

#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRC=0xff;
char a[]={255,144,144,144,144,144,144,144,144,144,144,144,144},i;

M.M.E.C. Mullana Page 10


Advance Real Time Embedded Systems

while(1)
{
for( i=0;i<13 ;i++)
{
PORTC=~a[i];
_delay_ms(5);
}

}
}

LETTER G

#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRC=0xff;
char a[]={255,129,129,129,4,2,1,133,133,133,4,2,1},i;
while(1)
{
for( i=0;i<13;i++)
{
PORTC=~a[i];
_delay_ms(5);
}

}
}

LETTER H

#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRC=0xff;
char a[]={255,32,32,32,32,255},i;
while(1)
{
for( i=0;i<6;i++)
{
PORTC=~a[i];
_delay_ms(5);
}

}
}

LETTER I

#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRC=0xff;
char a[]={129,129,129,255,129,129,129},i;
while(1)
{
for( i=0;i<8;i++)
{

M.M.E.C. Mullana Page 11


Advance Real Time Embedded Systems

PORTC=~a[i];
_delay_ms(5);
}

}
}
LETTER J

#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRC=0xff;
char a[]={136,129,129,129,255,128,128,128},i;
while(1)
{
for( i=0;i<8;i++)
{
PORTC=~a[i];
_delay_ms(5);
}

}
}

LETTER K

#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRC=0xff;
char a[]={255,24,36,66,129},i;
while(1)
{
for( i=0;i<5;i++)
{
PORTC=~a[i];
_delay_ms(5);
}

}
}

LETTER L

#include<avr/io.h>
#include<util/delay.h>
void main()
{
int i;
char a[]={1,2,4,8,16,32,64,128,1,1,1,1,1,1,1};
DDRC=0XFF;
while(1)
{
for(i=0;i<15;i++)
{
PORTC=~a[i];
_delay_ms(2);
}

M.M.E.C. Mullana Page 12


Advance Real Time Embedded Systems

}
}
LETTER M

#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRC=0xff;
char
a[]={1,2,4,8,16,32,64,128,64,32,16,8,4,2,1,1,2,4,8,16,32,64,128,64,32,16,8,
4,2,1},i;
while(1)
{
for( i=0;i<30 ;i++)
{
PORTC=~a[i];
_delay_ms(5);
}

}
}

LETTER N

#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRC=0xff;
char a[]={1,2,4,8,16,32,64,128,64,32,16,8,4,2,1,1,2,4,8,16,32,64,128},i;
while(1)
{
for( i=0;i<23 ;i++)
{
PORTC=~a[i];
_delay_ms(5);
}

}
}

LETTER O

#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRC=0xff;
char a[]={255,129,129,129,129,255},i;
while(1)
{
for( i=0;i<5;i++)
{
PORTC=~a[i];
_delay_ms(5);
}

}
}

M.M.E.C. Mullana Page 13


Advance Real Time Embedded Systems

LETTER P

#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRC=0xff;
char a[]={255,144,144,144,240},i;
while(1)
{
for( i=0;i<5 ;i++)
{
PORTC=~a[i];
_delay_ms(5);
}

}
}

LETTER Q

#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRC=0xff;
char a[]={255,129,129,133,131,255},i;
while(1)
{
for( i=0;i<6;i++)
{
PORTC=~a[i];
_delay_ms(5);
}

}
}

LETTER R

#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRC=0xff;
char a[]={255,152,148,146,225},i;
while(1)
{
for( i=0;i<5;i++)
{
PORTC=~a[i];
_delay_ms(5);
}

}
}
LETTER S

#include<avr/io.h>
#include<util/delay.h>
void main()

M.M.E.C. Mullana Page 14


Advance Real Time Embedded Systems

{
DDRC=0xff;
char a[]={241,0,0,145,0,0,145,0,0,145,0,0,159},i;
while(1)
{
for( i=0;i<13;i++)
{
PORTC=~a[i];
_delay_ms(3);
}
}
}

LETTER T

#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRC=0xff;
char a[]={129,129,129,255},i;
while(1)
{
for( i=0;i<4;i++)
{
PORTC=~a[i];
_delay_ms(3);
}

}
}

LETTER U

#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRC=0xff;
char a[]={255,1,1,1,1,255},i;
while(1)
{
for( i=0;i<5;i++)
{
PORTC=~a[i];
_delay_ms(3);
}

}
}

LETTER V

#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRC=0xff;

M.M.E.C. Mullana Page 15


Advance Real Time Embedded Systems

char a[]={1,2,4,8,16,32,64,128,64,32,16,8,4,2,1},i;
while(1)
{
for( i=0;i<15 ;i++)
{
PORTC=~a[i];
_delay_ms(3);
}

}
}

LETTER W

#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRC=0xff;
char a[]={255,2,4,8,16,8,4,2,255},i;
while(1)
{
for( i=0;i<9;i++)
{
PORTC=~a[i];
_delay_ms(3);
}

}
}

LETTER X

#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRC=0xff;
char a[]={130,68,40,16,40,68,130},i;
while(1)
{
for( i=0;i<7;i++)
{
PORTC=~a[i];
_delay_ms(3);
}

}
}

LETTER Y

#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRC=0xff;

M.M.E.C. Mullana Page 16


Advance Real Time Embedded Systems

char a[]={128,64,32,16,255},i;
while(1)
{
for( i=0;i<9;i++)
{
PORTC=~a[i];
_delay_ms(3);
}

}
}

LETTER Z

#include<avr/io.h>
#include<util/delay.h>
void main()
{
DDRC=0xff;
char a[]={129,131,133,137,145,161,193,129},i;
while(1)
{
for( i=0;i<8;i++)
{
PORTC=~a[i];
_delay_ms(3);
}

}
}

4.0 Important Terms used in Project :

4.1 ATMEL (AVR):

The AVR is a modified Harvard architecture 8-bit RISC single chip microcontroller which
was developed by Atmel in 1996. The AVR was one of the first microcontroller families to
use on-chip flash memory for program storage, as opposed to one-time programmable
ROM, EPROM, or EEPROM used by other microcontrollers at the time.

4.1.1 Brief History:

The AVR architecture was conceived by two students at the Norwegian Institute of
Technology (NTH) Alf-Egil Bogen and Vegard Wollan.

The original AVR MCU was developed at a local ASIC house in Trondheim, Norway called
Nordic VLSI at the time, now Nordic Semiconductor, where Bogen and Wollan were

M.M.E.C. Mullana Page 17


Advance Real Time Embedded Systems

working as students.It was known as a μRISC (Micro RISC) and was available as silicon
IP/building block from Nordic VLSI. When the technology was sold to Atmel from Nordic
VLSI, the internal architecture was further developed by Bogen and Wollan at Atmel
Norway, a subsidiary of Atmel. The designers worked closely with compiler writers at IAR
Systems to ensure that the instruction set provided for more efficient compilation of high-
level languages Atmel says that the name AVR is not an acronym and does not stand for
anything in particular. The creators of the AVR give no definitive answer as to what the term
"AVR" stands for.However, it is commonly accepted that AVR stands for Alf (Egil Bogen)
and Vegard (Wollan)'s Risc processor.

Note that the use of "AVR" in this article generally refers to the 8-bit RISC line of Atmel
AVR Microcontrollers.

4.1.2 Basic families:


AVRs are generally classified into six broad groups:

 TinyAVR — the ATtiny series


 0.5–16 kB program memory
 6–32-pin package
 Limited peripheral set
 Current lineup

 MegaAVR — the ATmega series


 4–512 kB program memory
 28–100-pin package
 Extended instruction set (Multiply instructions and instructions for handling larger
program memories)
 Extensive peripheral set

 XMEGA — the ATxmega series


 16–384 kB program memory
 44–64–100-pin package (A4, A3, A1)
 Extended performance features, such as DMA, "Event System", and cryptography
support.
 Extensive peripheral set with DACs

M.M.E.C. Mullana Page 18


Advance Real Time Embedded Systems

 Application-specific AVR
 megaAVRs with special features not found on the other members of the AVR family,
such as LCD controller, USB controller, advanced PWM, CAN, etc.

 FPSLIC (AVR with FPGA)


 FPGA 5K to 40K gates
 SRAM for the AVR program code, unlike all other AVRs
 AVR core can run at up to 50 MHz

 32-bit AVRs
AVR32
In 2006 Atmel released microcontrollers based on the new, 32-
bit, AVR32 architecture. They include SIMD and DSP instructions, along with other
audio and video processing features. This 32-bit family of devices is intended to
compete with the ARM based processors. The instruction set is similar to other RISC
cores, but is not compatible with the original AVR or any of the various ARM cores.

4.2 UART

A Universal Asynchronous Receiver/Transmitter, abbreviated UART, is a type of


"asynchronous receiver/transmitter", a piece of computer hardware that translates data
between parallel and serial forms. UARTs are commonly used in conjunction with
communication standards such as EIA, RS-232, RS-422 or RS-485. The universal
designation indicates that the data format and transmission speeds are configurable and that
the actual electric signaling levels and methods (such as differential signaling etc.) typically
are handled by a special driver circuit external to the UART.

A UART is usually an individual (or part of an) integrated circuit used for serial
communications over a computer or peripheral device serial port. UARTs are now commonly
included in microcontrollers. A dual UART, or DUART, combines two UARTs into a single
chip. Many modern ICs now come with a UART that can also communicate synchronously;
these devices are called USARTs (universal synchronous/asynchronous receiver/transmitter).

4.2.1 Transmitting and Receiving serial data

M.M.E.C. Mullana Page 19


Advance Real Time Embedded Systems

Asynchronous serial communication

The Universal Asynchronous Receiver/Transmitter (UART) takes bytes of data and transmits
the individual bits in a sequential fashion. At the destination, a second UART re-assembles
the bits into complete bytes. Each UART contains a shift register, which is the fundamental
method of conversion between serial and parallel forms. Serial transmission of digital
information (bits) through a single wire or other medium is much more cost effective than
parallel transmission through multiple wires.

The UART usually does not directly generate or receive the external signals used between
different items of equipment. Separate interface devices are used to convert the logic level
signals of the UART to and from the external signaling levels. External signals may be of
many different forms. Examples of standards for voltage signaling are RS-232, RS-422 and
RS-485 from the EIA. Historically, current (in current loops) was used in telegraph circuits

Receiver:

All operations of the UART hardware are controlled by a clock signal which runs at a
multiple of the data rate. For example, each data bit may be as long as 16 clock pulses. The
receiver tests the state of the incoming signal on each clock pulse, looking for the beginning
of the start bit. If the apparent start bit lasts at least one-half of the bit time, it is valid and
signals the start of a new character. If not, the spurious pulse is ignored. After waiting a
further bit time, the state of the line is again sampled and the resulting level clocked into a
shift register. After the required number of bit periods for the character length (5 to 8 bits,
typically) have elapsed, the contents of the shift register is made available (in parallel
fashion) to the receiving system. The UART will set a flag indicating new data is available,
and may also generate a processor interrupt to request that the host processor transfers the
received data.

Transmitter:

Transmission operation is simpler since it is under the control of the transmitting system. As
soon as data is deposited in the shift register after completion of the previous character, the
UART hardware generates a start bit, shifts the required number of data bits out to the line,
generates and appends the parity bit (if used), and appends the stop bits. Since transmission

M.M.E.C. Mullana Page 20


Advance Real Time Embedded Systems

of a single character may take a long time relative to CPU speeds, the UART will maintain a
flag showing busy status so that the host system does not deposit a new character for
transmission until the previous one has been completed; this may also be done with an
interrupt. Since full-duplex operation requires characters to be sent and received at the same
time, practical UARTs use two different shift register

Structure:

A UART usually contains the following components:

 a clock generator, usually a multiple of the bit rate to allow sampling in the middle of
a bit period.
 input and output shift registers
 transmit/receive control
 read/write control logic
 transmit/receive buffers (optional)
 parallel data bus buffer (optional)
 First-in, first-out (FIFO) buffer memory (optional)

M.M.E.C. Mullana Page 21


Advance Real Time Embedded Systems

5.0 CONCLUSION

It was realy a great experience to work in the embedded field, one may come to know about various
applications used in almost every field of life.8051 is only 8 bit controller, but still not obsolete and used in
various applications as like these

1. This can be used in banks for securing the lockers.


2. In computers to avoid the misuse of the system by interloper.
3. In home security to avoid theft.
4. In mobile security, to avoid access by foreigners

16 bit, 32 bits controller has also developed and presently used by industries world wile, but
8051 also has its importance and still using for such applications.

M.M.E.C. Mullana Page 22


Advance Real Time Embedded Systems

6.0 BIBLIOGRAPHY

The following books are being used to fulfil the requirements of the proposed
project and are helpful in the understanding, development and the maintenance
of the project:

Embedded C by NIIT

Websites Visited:

www.google.com/products/jmf

www.wikipedia.com

M.M.E.C. Mullana Page 23

Das könnte Ihnen auch gefallen