Embedded System & Robotics With "C ": Project Training in
Embedded System & Robotics With "C ": Project Training in
BACHELOR OF TECHNOLOGY degree
In
ELECTRONICS AND COMMUNICATION
ENGINEERING
Submitted By
ACKNOWLEDGEMENT
This project is the outcome of the efforts of several people, apart from the team members, and it
is important that their help be acknowledgement here.
First of all I want to present my sincere gratitude and deep appreciations to MR.PRADEEP
SHARMA, GENERAL MANAGER to allow me to undertake the industrial training in
RBOSAPIENSINDIA ,NOIDA one of the leading organization amongst the Electronics industries in
India.
Without motivation, a person is literally unable to make his best effort. I am highly grateful to
him for his guidance as he played an important role in preparing me for industrial culture and making
me aware of actual scenario and work culture in organization.
I would like to thanks Ms. MAHIMA RAINA (PROGRAM CO-ORDINATOR) and rest all
faculty member of centre and all the employee of ROBOSAPIENSINDIA IN NOIDA, who devoted
their valuable time to render me information about the complexities of industries and technical know-
how.
The Organization has a beautiful and well organized work environment which made a great
pleasure and an easy task to learn and understand the principles and theories.
ANUJ CHOUDHARY
ELECTRONICS AND COMMUNICATION
7th Sem ,E- Sec
0708210017
ABSTRACT
Although embedded systems are generally defined as special-purpose computer-
systems designed to perform one or more dedicated functions, usually with real-time
constraints, and have computer hardware and software embedded as parts of a complete
device or system, they range from simple portable devices to sophisticated multi-board
stationary systems.
We are living in the Embedded World. You are surrounded with many embedded
products and your daily life largely depends on the proper functioning of these gadgets.
Television, Radio, CD player of your living room, Washing Machine or Microwave Oven
in your kitchen, Card readers, Access Controllers, Palm devices of your work space
enable you to do many of your tasks very effectively. Apart from all these, many
controllers embedded in your car take care of car operations between the bumpers and
most of the times you tend to ignore all these controllers.
In recent days, you are showered with variety of information about these embedded
controllers in many places. All kinds of magazines and journals regularly dish out details
about latest technologies, new devices, fast applications which make you believe that
your basic survival is controlled by these embedded products. Now you can agree to the
fact that these embedded products have successfully invaded into our world. You must be
wondering about these embedded controllers or systems. What is this Embedded System?
The computer you use to compose your mails, or create a document or analyze the
database is known as the standard desktop computer. These desktop computers are
manufactured to serve many purposes and applications.
TABLE OF CONTENTS
INTRODUCTION ABOUT ROBOSAPIENSINDIA
A. OVERVIEW
E. PERIPHERALS
F. TOOLS
G. DEBUGGING
H. RELIABILITY
I. EMBEDDED SOFTWARE ARCHITECTURES
B. COMPONENT OF ROBOT
D. WALKING ROBOTS
C. DEVICE ARCHITECHTURE
D. PROGRAM MEMORY
D.I EEPROM
E. PROGRAM EXECUTION
F. MCU SPEED
G. DEVELOPMENT
H. FEATURES
Mission:
The basic objective of the organization is to generate a need for robotics education among
engineering Students and schools in India and become a name synonymous with robotics
education and related events in the country by providing the most comprehensive and
fulfilling services and by creating an ambience of creativity and an approach towards
seeking logical solutions to everyday problems. The vision of the founders’ mantra is
Achievements:
Robosapiens-India team has been granted the Patent on 'SSBMC' by Government of
India. This achievement entails a long story involving dedicated efforts and hard work.
The team Robosapiens-India has faced many obstacles and roadblocks on its journey to
success but it’s never ending zeal for success and excellence has made them the best
team. What lessons can be learnt from this extraordinary feat? What special did the team
Robosapiens-India do? How did we cope up with the challenging business environment?
What has been their mantra of success?
This cover story aims at answering the above and many more questions. The idea is to
learn as much as possible from the team and to reapply the proven expertise to repeat the
success. Let’s begin with the tale of extraordinary events.
ROBOSAPIENS AND ROBOTRYSTS’2010
Microprocessor (4),
RAM (6), and flash
memory (7).
A. OVERVIEW
Since the embedded system is dedicated to specific tasks, design engineers can optimize
it, reducing the size and cost of the product, or increasing 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
MP4 players, to large stationary installations like traffic lights, factory controllers, or the
systems controlling nuclear power plants. 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.
Medical equipment is continuing to advance with more embedded systems for vital
signs monitoring, electronic stethoscopes for amplifying sounds, and various
medical imaging (PET, SPECT, CT, MRI) for non-invasive internal inspections.
In addition to commonly described embedded systems based on small computers, a
new class of miniature wireless devices called motes are quickly gaining popularity
as the field of wireless sensor networking rises. Wireless sensor networking, WSN,
makes use of miniaturization made possible by advanced IC design to couple full
wireless subsystems to sophisticated sensor, enabling people and companies to
measure a myriad of things in the physical world and act on this information
through IT monitoring and control systems. These motes are completely self
contained, and will typically run off a battery source for many years before the
batteries need to be changed or charged.
B. 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
Autonetics 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. This program alone reduced prices on quad
nand gate ICs from $1000/each to $3/each, permitting their use in commercial products.
Since these early applications in the 1960s, embedded systems have come down in price
and there has been a dramatic rise in processing power and functionality. The first
microprocessor for example, the Intel 4004, was designed for calculators and other small
systems but still required many external memory and support chips. In 1978 National
Engineering Manufacturers Association released a "standard" for programmable
microcontrollers, including almost any computer-based controllers, such as single board
computers, numerical, and event-based controllers.
The integration of microcontrollers has further increased the applications for which
embedded systems are used into areas where traditionally a computer would not have
been considered. A general purpose and comparatively low-cost microcontroller may
often be programmed to fulfill the same role as a large number of separate components.
Although in this context an embedded system is usually more complex than a traditional
solution, most of the complexity is contained within the microcontroller itself. Very few
additional components may be needed and most of the design effort is in the software.
The intangible nature of software makes it much easier to prototype and test new
revisions compared with the design and construction of a new circuit not using an
embedded processor.
C. CHARACTERISTICS:
D. USER INTERFACES:
Handheld systems often have a screen with a "joystick button" for a pointing device.
Many systems have "maintenance" or "test" interfaces that provide a menu or command
system via an RS-232 interface. This avoids the cost of a display, but gives a lot of
control. Most consumers cannot assemble the required cables, however.
The rise of the World Wide Web has given embedded designers another quite different
option: providing a web page interface over a network connection. This avoids the cost of
a sophisticated display, yet provides complex input and display capabilities when needed,
on another computer. This is successful for remote, permanently installed equipment such
as Pan-Tilt-Zoom cameras and network routers.
In certain applications, where small size is not a primary concern, the components used
may be compatible with those used in general purpose computers. Boards such as the
VIA EPIA range help to bridge the gap by being PC-compatible but highly integrated,
physically smaller or have other attributes making them attractive to embedded engineers.
The advantage of this approach is that low-cost commodity components may be used
along with the same software development tools used for general software development.
Systems built in this way are still regarded as embedded since they are integrated into
larger devices and fulfill a single role. Examples of devices that may adopt this approach
are ATMs and machines. And which contain code specific to the application.
E. Peripherals
Embedded Systems talk with the outside world via peripherals, such as:
F. Tools
As for other software, embedded system designers use compilers, assemblers, and
debuggers to develop embedded system software. However, they may also use some
more specific tools:
As the complexity of embedded systems grows, higher level tools and operating systems
are migrating into machinery where it makes sense. For example, cellphones, personal
digital assistants and other consumer computers often need significant software that is
purchased or provided by a person other than the manufacturer of the electronics. In these
systems, an open programming environment such as Linux, NetBSD, OSGi or Embedded
Java is required so that the third-party software provider can sell to a large market.
G. Debugging
Embedded Debugging may be performed at different levels, depending on the facilities
available. From simplest to most sophisticate they can be roughly grouped into the
following areas:
Interactive resident debugging, using the simple shell provided by the embedded
operating system (e.g. Forth and Basic)
External debugging using logging or serial port output to trace operation using
either a monitor in flash or using a debug server like the Remedy Debugger which
even works for heterogeneous multicore systems.
An in-circuit debugger (ICD), a hardware device that connects to the
microprocessor via a JTAG or NEXUS interface. This allows the operation of the
microprocessor to be controlled externally, but is typically restricted to specific
debugging capabilities in the processor.
An in-circuit emulator replaces the microprocessor with a simulated equivalent,
providing full control over all aspects of the microprocessor.
A complete emulator provides a simulation of all aspects of the hardware, allowing
all of it to be controlled and modified and allowing debugging on a normal PC.
Unless restricted to external debugging, the programmer can typically load and run
software through the tools, view the code running in the processor, and start or stop its
operation. The view of the code may be as assembly code or source-code.
H. 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.
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[3] 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
These kinds of systems are used if event handlers need low latency and the event
handlers are short and simple.
Usually these kinds of systems run a simple task in a main loop also, but this task is not
very sensitive to unexpected delays.
Sometimes the interrupt handler will add longer tasks to a queue structure. Later, after the
interrupt handler has finished, these tasks are executed by the main loop. This method
brings the system close to a multitasking kernel with discrete processes.
The advantages and disadvantages are very similar to the control loop, except that adding
new software is easier, by simply writing a new task, or adding to the queue-interpreter.
As any code can potentially damage the data of another task (except in larger systems
using an MMU) programs must be carefully designed and tested, and access to shared
data must be controlled by some synchronization strategy, such as message queues,
semaphores or a non-blocking synchronization scheme.
Because of these complexities, it is common for organizations to buy a real-time
operating system, allowing the application programmers to concentrate on device
functionality rather than operating system services, at least for large systems; smaller
systems often cannot afford the overhead associated with a generic real time system, due
to limitations regarding memory size, performance, and/or battery life.
In general, microkernels succeed when the task switching and intertask communication is
fast, and fail when they are slow.
Exokernels communicate efficiently by normal subroutine calls. The hardware, and all
the software in the system are available to, and extensible by application programmers.
Despite the increased cost in hardware, this type of embedded system is increasing in
popularity, especially on the more powerful embedded devices such as Wireless Routers
and GPS Navigation Systems. Here are some of the reasons:
They permit re-use of publicly available code for Device Drivers, Web Servers,
Firewalls, and other code.
Development systems can start out with broad feature-sets, and then the
distribution can be configured to exclude unneeded functionality, and save the
expense of the memory that it would consume.
Many engineers believe that running application code in user mode is more
reliable, easier to debug and that therefore the development process is easier and
the code more portable.
Many embedded systems lack the tight real time requirements of a control system.
A system such as Embedded Linux has fast enough response for many
applications.
Features requiring faster response than can be guaranteed can often be placed in
hardware.
Many RTOS systems have a per-unit cost. When used on a product that is or will
become a commodity, that cost is significant.
History:
Stories of artificial helpers and companions and attempts to create them have a long
. history
In 1837- the story of the Golem of Prague an humanoid artificial intelligence activated
by inscribing Hebrew letters on its forehead which was based on Jewish folklore that
was created by Jewish German writer Berthold Auerbach for his novel Spinoza.
In 1921- Czech writer Karel Capek introduced the word "robot" in his play R.U.R.
(Rossum's Universal Robots). The word "robot" comes from the word "robota" which
meaning in Czech Is "forced labour drudgery".
In 1942- Isaac Asimov formulated the Three Laws of Robotics, and in the process of
doing so, coined the word "robotics" (see details in "Etymology" section below).
In 1948- Norbert Weiner formulated the principles of cybernetics, the basis of practical
robotics.
Fully autonomous robots only appeared in the second half of the 20th century. The first
digitally operated and programmable robot, the Unimate, was installed in 1961 to lift hot
pieces of metal from a die casting machine and stack them. Today, commercial and
industrial robots are in widespread use performing jobs more cheaply or more
accurately and reliably than humans. They are also employed in jobs which are too dirty,
dangerous, or dull to be suitable for humans. Robots are widely used in manufacturing,
assembly, and packing; transport; earth and space exploration; surgery; weaponry;
laboratory research; safety; and mass production of consumer and industrial goods.
Components of robot
Sructure
Actuation
Manipulation
Locomotion
Robot-Human Interaction
If robots are to work effectively in homes and other non-industrial environments, the
way they are instructed to perform their jobs, and especially how they will be told to stop
will be of critical importance. The people who interact with them may have little or no
training in robotics, and so any interface will need to be extremely intuitive. Science
fiction authors also typically assume that robots will eventually be capable of
communicating with humans through speech, gestures, and facial expression, rather than
a command-line interface. Although speech would be the most natural way for the human
to communicate, it is quite unnatural for the robot. It will be quite a while before robots
interact as naturally as the fictional C-3PO.
Speech recognition: Interpreting the continuous flow of sounds coming from a
human (speech recognition), in real time, is a difficult task for a computer, mostly
because of the great variability of speech. The same word, spoken by the same
person may sound different depending on local acoustics, volume, the previous
word, whether or not the speaker has a cold, etc.. It becomes even harder when the
speaker has a different accent. Nevertheless, great strides have been made in the
field since Davis, Biddulph, and Balashek designed the first "voice input system"
which recognized "ten digits spoken by a single user with 100% accuracy" in
1952Currently, the best systems can recognize continuous, natural speech, up to
160 words per minute, with an accuracy of 95%
Gestures: One can imagine, in the future, explaining to a robot chef how to make a
pastry, or asking directions from a robot police officer. On both of these occasions,
making hand gestures would aid the verbal descriptions. In the first case, the robot
would be recognizing gestures made by the human, and perhaps repeating them for
confirmation. In the second case, the robot police officer would gesture to indicate
"down the road, then turn right". It is quite likely that gestures will make up a part
of the interaction between humans and robots A great many systems have been
developed to recognize human hand gestures
Facial expression: Facial expressions can provide rapid feedback on the progress
of a dialog between two humans, and soon it may be able to do the same for
humans and robots. Robotic faces have been constructed by Hanson Robotics
using their elastic polymer called Frubber, allowing a great amount of facial
expressions due to the elasticity of the rubber facial coating and imbedded
subsurface motors (servos) to produce the facial expressions. The coating and
servos are built on a metal skull. A robot should know how to approach a human,
judging by their facial expression and body language. Whether the person is happy,
frightened, or crazy-looking affects the type of interaction expected of the robot.
Likewise, robots like Kismet and the more recent addition, Nexi can produce a
range of facial expressions, allowing it to have meaningful social exchanges with
humans.
KISMET can produce a range of
facial expression.
Artificial emotions Artificial emotions can also be imbedded and are composed of
a sequence of facial expressions and/or gestures. As can be seen from the movie
Final Fantasy: The Spirits Within, the programming of these artificial emotions is
quite complex and requires a great amount of human observation. To simplify this
programming in the movie, presets were created together with a special software
program. This decreased the amount of time needed to make the film. These
presets could possibly be transferred for use in real-life robots.
Walking robots
ASIMO: The World most advanced
humanoid robot (By HONDA’s)
Walking is a difficult and dynamic problem to solve. Several robots have been
made which can walk reliably on two legs, however none have yet been made
which are as robust as a human. Many other robots have been built that walk on
more than two legs, due to these robots being significantly easier to construct.
Hybrids too have been proposed in movies such as I, Robot, where they walk on 2
legs and switch to 4 (arms+legs) when going to a sprint. Typically, robots on 2 legs
can walk well on flat floors, and can occasionally walk up stairs. None can walk
over rocky, uneven terrain. Some of the methods which have been tried are.
ZMP Technique: The Zero Moment Point (ZMP) is the algorithm used by robots
such as Honda's ASIMO. The robot's onboard computer tries to keep the total
inertial forces (the combination of earth's gravity and the acceleration and
deceleration of walking), exactly opposed by the floor reaction force (the force of
the floor pushing back on the robot's foot). In this way, the two forces cancel out,
leaving no moment (force causing the robot to rotate and fall over). However, this
is not exactly how a human walks, and the difference is quite apparent to human
observers, some of whom have pointed out that ASIMO walks as if it needs the
lavatory. ASIMO's walking algorithm is not static, and some dynamic balancing is
used (See below). However, it still requires a smooth surface to walk on.
Hopping: Several robots, built in the 1980s by Marc Raibert at the MIT Leg
Laboratory, successfully demonstrated very dynamic walking. Initially, a robot
with only one leg, and a very small foot, could stay upright simply by hopping.
The movement is the same as that of a person on a pogo stick. As the robot falls to
one side, it would jump slightly in that direction, in order to catch itself. Soon, the
algorithm was generalised to two and four legs. A bipedal robot was demonstrated
running and even performing somersaults. A quadruped was also demonstrated
which could trot, run, pace, and bound. For a full list of these robots.
PART III
AVR Microcontroller
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.
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,
where the two founders of Atmel Norway were working as students. It was known as a
μRISC (Micro RISC) When the technology was sold to Atmel, the internal architecture
was further developed by Alf and Vegard at Atmel Norway, a subsidiary of Atmel
founded by the two architects. 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. .
Among the first of the AVR line was the AT90S8515, which in a 40-pin DIP package has
the same pinout as an 8051 microcontroller, including the external multiplexed address
and data bus. The polarity of the RESET line was opposite (8051's having an active-high
RESET, while the AVR has an active-low RESET), but other than that, the pinout was
identical.
Device overview
The AVR is a Modified Harvard architecture machine with program and data stored in
separate physical memory systems that appear in different address spaces, but having the
ability to read data items from program memory using special instructions.
Basic families
AVRs are generally classified into five broad groups:
Program memory
Program instructions are stored in non-volatile flash memory. Although they are 8-bit
MCUs, each instruction takes one or two 16-bit words.
The size of the program memory is usually indicated in the naming of the device itself
(e.g., the ATmega64x line has 64 kB of flash, however the ATmega32x has only 32 kB).
There is no provision for off-chip program memory; all code executed by the AVR core
must reside in the on-chip flash. However, this limitation does not apply to the AT94
FPSLIC AVR/FPGA chips.
The data address space consists of the register file, I/O registers, and SRAM.
Internal registers
The AVRs have 32 single-byte registers and are classified as 8-bit RISC devices.
In most variants of the AVR architecture, the working registers are mapped in as the first
32 memory addresses (000016-001F16) followed by the 64 I/O registers (002016-005F16).
Actual SRAM starts after these register sections (address 006016). (Note that the I/O
register space may be larger on some more extensive devices, in which case the memory
mapped I/O registers will occupy a portion of the SRAM address space.)
Even though there are separate addressing schemes and optimized opcodes for register
file and I/O register access, all can still be addressed and manipulated as if they were in
SRAM.
In the XMEGA variant, the working register file is not mapped into the data address
space; as such, it is not possible to treat any of the XMEGA's working registers as though
they were SRAM. Instead, the I/O registers are mapped into the data address space
starting at the very beginning of the address space. Additionally, the amount of data
address space dedicated to I/O registers has grown substantially to 4096 bytes (0000 16-
0FFF16). As with previous generations, however, the fast I/O manipulation instructions
can only reach the first 64 I/O register locations (the first 32 locations for bitwise
instructions). Following the I/O registers, the XMEGA series sets aside a 4096 byte range
of the data address space which can be used optionally for mapping the internal
EEPROM to the data address space (1000 16-1FFF16). The actual SRAM is located after
these ranges, starting at 200016.
EEPROM
Almost all AVR microcontrollers have internal EEPROM for semi-permanent data
storage. Like flash memory, EEPROM can maintain its contents when electrical power is
removed.
In most variants of the AVR architecture, this internal EEPROM memory is not mapped
into the MCU's addressable memory space. It can only be accessed the same way an
external peripheral device is, using special pointer registers and read/write instructions
which makes EEPROM access much slower than other internal RAM.
However, some devices in the SecureAVR (AT90SC) family use a special EEPROM
mapping to the data or program memory depending on the configuration. The XMEGA
family also allows the EEPROM to be mapped into the data address space.
Since the number of writes to EEPROM is not unlimited — Atmel specifies 100,000
write cycles in their datasheets — a well designed EEPROM write routine should
compare the contents of an EEPROM address with desired contents and only perform an
actual write if contents need to be changed.
Program execution
Atmel's AVRs have a two stage, single level pipeline design. This means the next
machine instruction is fetched as the current one is executing. Most instructions take just
one or two clock cycles, making AVRs relatively fast among the eight-bit
microcontrollers.
The AVR family of processors were designed with the efficient execution of compiled C
code in mind and has several built-in pointers for the task.
Instruction set
Atmel AVR instruction set
The AVR Instruction Set is more orthogonal than those of most eight-bit
microcontrollers, in particular the 8051 clones and PIC microcontrollers with which AVR
competes today. However, it is not completely regular:
Pointer registers X, Y, and Z have addressing capabilities that are different from each
other.
Register locations R0 to R15 have different addressing capabilities than register locations
R16 to R31.
I/O ports 0 to 31 have different addressing capabilities than I/O ports 32 to 63.
CLR affects flags, while SER does not, even though they are complementary instructions.
CLR set all bits to zero and SER sets them to one. (Note that CLR is pseudo-op for EOR
R, R; and SER is short for LDI R,$FF. Math operations such as EOR modify flags while
moves/loads/stores/branches such as LDI do not.)
Accessing read-only data stored in the program memory (flash) requires special LPM
instructions; the flash bus is otherwise reserved for instruction memory.
The mostly-regular instruction set makes programming it using C (or even Ada)
compilers fairly straightforward. GCC has included AVR support for quite some time,
and that support is widely used. In fact, Atmel solicited input from major developers of
compilers for small microcontrollers, to determine the instruction set features that were
most useful in a compiler for high-level languages.
MCU speed
The AVR line can normally support clock speeds from 0-20 MHz, with some devices
reaching 32 MHz. Lower powered operation usually requires a reduced clock speed. All
recent (Tiny and Mega, but not 90S) AVRs feature an on-chip oscillator, removing the
need for external clocks or resonator circuitry. Some AVRs also have a system clock
prescaler that can divide down the system clock by up to 1024. This prescaler can be
reconfigured by software during run-time, allowing the clock speed to be optimized.
Since all operations (excluding literals) on registers R0 - R31 are single cycle, the AVR
can achieve up to 1 MIPS per MHz, i.e. an 8 MHz processor can achieve up to 8 MIPS.
Loads and stores to/from memory take 2 cycles, branching takes 3 cycles. Branches in the
latest "3-byte PC" parts such as ATmega2560 are one cycle slower than on previous
devices.
Development
AVRs have a large following due to the free and inexpensive development tools
available, including reasonably priced development boards and free development
software. The AVRs are sold under various names that share the same basic core but with
different peripheral and memory combinations. Compatibility between chips in each
family is fairly good, although I/O controller features may vary.
Features
Current AVRs offer a wide range of features:
Multifunction, bi-directional general purpose I/O ports with configurable, built-in
pull-up resistors
Multiple internal oscillators, including RC oscillator without external parts
Internal, self-programmable instruction flash memory up to 256 kB (384 kB on
XMega)
In-system programmable using serial/parallel low-voltage proprietary interfaces or
JTAG
Optional boot code section with independent lock bits for protection
On chip debugging (OCD) support through JTAG or debugWIRE on most devices
The JTAG signals (TMS, TDI, TDO, and TCK) are multiplexed on GPIOs. These
pins can be configured to function as JTAG or GPIO depending on the setting of a
fuse bit, which can be programmed via ISP or HVSP. By default, AVRs with
JTAG come with the JTAG interface enabled.
debugWIRE uses the /RESET pin as a bi-directional communication channel to
access on-chip debug circuitry. It is present on devices with lower pin counts, as it
only requires one pin.
Internal data EEPROM up to 4 kB
Internal SRAM up to 8 kB (32 kB on XMega)
External 64 kB little endian data space on certain models, including the Mega8515
and Mega162.
The external data space is overlaid with the internal data space, such that the full
64 kB address space does not appear on the external bus. An accesses to e.g.
address 010016 will access internal RAM, not the external bus.
In certain members of the XMEGA series, the external data space has been
enhanced to support both SRAM and SDRAM. As well, the data addressing modes
have been expanded to allow up to 16 MB of data memory to be directly
addressed.
AVR's generally do not support executing code from external memory. Some
ASSP's using the AVR code do support external program memory.
8-Bit and 16-Bit timers
PWM output (Dead time generator on some devices)
Input capture
Analog comparator
10 or 12-Bit A/D converters, with multiplex of up to 16 channels
12-bit D/A converters
A variety of serial interfaces, including
I²C compatible Two-Wire Interface (TWI)
Synchronous/asynchronous serial peripherals (UART/USART) (used with RS-232,
RS-485, and more)
Serial Peripheral Interface Bus (SPI)
Universal Serial Interface (USI) for two or three-wire synchronous data transfer
Brownout detection
Watchdog timer (WDT)
Multiple Power-Saving Sleep Modes
Lighting and motor control (PWM specific) controller models
CAN controller support
USB controller support
Proper full-speed (12 Mbit/s) hardware & Hub controller with embedded AVR.
Also freely available low-speed (1.5 Mbit/s) (HID) bitbanging software emulations
Ethernet controller support
LCD controller support
Low-voltage devices operating down to 1.8 V (to 0.7 V for parts with built-in DC-
DC upconverter)
picoPower devices
DMA controllers and "event system" peripheral communication.
Fast cryptography support for AES and DES
PART IV
PROJECTS
CIRCUIT DISCRIPTION
.
WORKING:
The keys A,B,C,D are not available in the mobile phones as these keys are used to transmit
some secret or confidential data. These keys are basically used in govt. and defense sector.
All type of HT9170 series use digital counting techniques to detect and decode all the 16
DTMF tone pair into 4-bit code output.
VP and VN are the dual i/p of the op-amp, GS is the output of op-amp. When input signals
given at pin1 and pin2 found to be effective then DV(pin15) becomes high, the correct 4- bit
code of tone is transferred to the output pins D0-D3. The decoded digital data is then negated
using 4 NOR gates of 7404 HEX INVERTER. This inverted input will be given to Port A of
microcontroller. The microcontroller is programmed to give output at Port D,to control the
motor driver. As the microcontroller is not able to drive the motor so a motor driver IC
L293D is used for this purpose.
PROGRAMING
#define F_CPU 1000000UL // define cpu frequency for delay
function
#include <avr/io.h> // includes input/output header file
#include <util/delay.h> // includes delay header file
int main(void)
{
int DTMF=0; //DTMF variable for mean while checking
DDRC=0xFF; //PORTC as output Port connected to motors
DDRA=0b00000000;//PORTA Input port connected to DTMF decoder
IC
PORTD=0xF0;
}//while closed
}//main closed
LINE FOLLOWER USING L293D
H-BRIDGE IC
INTRODUCTION:
The name line follower itself clear it’s meaning that it is a robot
which traces or follows a specific path .The principle of the line follower is based on
sensing the background surface making use of IR sensor. Basically IR sensor takes
input by detecting the reflection of the IR rays from the surface and accordingly gives
its output to the motors. The output of the sensors are not directly fed to the motors
instead a L293D IC is used in between the sensors output and motors input. The
sensors output is given to the input pin of L293D and the output pin of IC is
connected to the motors. The L293D IC is having two H-bridges which is capable to
rotate motor in bidirectional.
DC GEAR MOTOR:
WHY DC MOTOR?
Easy to control
Require only two signals
For change the direction of rotation just reverse the polarity
Speed can be controlled by the voltage
USE OF GEARS
IR LED (emitter)
Photodiode (detector)
Op-Amp
IR LED:
Fig. 1
IR LED is a light emitting diode which emits the IR radiations. The basic function of
the emitter is to convert electricity into light. It works on the principle of recombination
of the electron-hole pair. As in the conduction band of a diode, electrons are the
majority carrier and in the valence band, holes are majority carrier. So when an
electron from a conduction band recombines with a hole of valance band, some
amount of energy is released and this energy is in the form of light. The amount of
energy released is depends upon the forbidden energy gap. The IR Led has two
legs, the leg which is longer is positive and other leg is negative.
PHOTODIODE:
Photodiode
PIN Photodiode
Fig. 2
The photodiode is a p-n junction diode which is connected in reverse bias direction.
The basic function of the detector is to convert light into electricity. As its name
implies that it works effectively only when the certain number of photon or certain
amount of light falls on it. When there is no fall of light on the photodiode it has an
infinite resistance and act as a open switch but as the light starts falling on the
photodiode, the resistance become low and when the full intensity of light fall in the
photodiode then its resistance becomes zero and it starts act like a closed switch.
OPAMP:
Op-Amp stands for operational amplifier. It is a DC-coupled high gain amplifier with
differential inputs and single output. Typically the output of the op-amp is controlled by
either negative feedback or positive feedback. Due to the fact that it performs several
operations like addition, subtraction, multiplication, integration etc, it is named as operational
amplifier. It has two inputs, inverted (Pin 2) and non-inverted input (Pin3). The signal which
is applied to the inverted input gives output 180 degree out of phase with input whereas in the
non-inverted input gives output in phase with that of input. Op-amp has a variety of uses in
different electronics devices. In the line follower it is used in the comparator mode. The op-
amp IC which is used here is LM358, which is an 8-pin IC having two inbuilt op-amps. In the
comparator mode, the reference voltage is set at the inverted input pin and then it is compared
with the input at non inverted pin. As the voltages at two input pins of op-amp is compared,
as the voltage at Pin 3 exceeds the reference voltage at Pin 2 the output of the comparator
becomes high (5 V) otherwise it becomes low (0 V). The reference voltage at Pin 2 is set with
the help of variable resistor.
Types of Op-amp:
We know that the white surface reflects all the radiations falls on it whereas the black color
absorbs them. When the supply is given to IR sensor, LED starts emitting light radiations. If
the surface is of white color then it reflects all the radiations. As these radiations starts falling
on the photodiode which is connected in reverse bias, the resistance of the photodiode starts
decreasing rapidly and the voltage drop across the diode also decreases. The voltage at Pin 3
starts increases, as it reaches just beyond the voltage of Pin 2 the comparator gives high
output. In case of the black surface, LED emits light but it is not reflected by the surface, so
the photodiode detects nothing and its resistance remains infinite. Hence the comparator
gives low output.
Sensitivity of IR sensor:
The sensitivity of sensor means that how much effectively the sensor senses the change that
is occurring in its surrounding. The sensitivity of the IR sensor is controlled by reference
voltage at pin 2 using variable resistor.
NOT gates are usually used as buffers in the H-bridge to strengthen the signal and also used
as repeaters.
Fig 5. Pin diagram of L293D
WORKING MODEL:
PROGRAMING
#define F_CPU 12000000UL // define cpu frequency for delay function
int main(void)
PORTD=0b11110000;
PORTC=0b00000000; // stop
{
PORTC=0b00001001; // move straight
if((left_sensor==0b00000000)&(right_sensor==0b00100000))
if((left_sensor==0b00010000)&(right_sensor==0b00000000))
}}//while closed
} //main close