You are on page 1of 21

SUMMER TRAINING REPORT

ON
AVR Atmega16 Architecture and
its applications through a
general purpose circuit




Submitted by :- Submitted to :-
Ayush Agarwal K. P. Singhal
VI SEM Scientist D
ECE TOC
FORMED: 1958
HEADQUARTERS: DRDO Bhawan, New Delhi
EMPLOYEES: 30,000 (7,000 Scientists)
ANNUAL BUDGET: 10,253.17 Crore (US$
2.3Billion) (2011-12)
MINISTER RESPONSIBLE: A. K. Antony,
Defence minister of India
AGENCY EXECUTIVE: Dr. V. K. Saraswat,
Director General DRDO & scientific advisor to
defence minister.
The Defence Research and Development
Organization (DRDO) is a agency of the Republic of
India, responsible for the development of technology
for use by the military, headquartered in New Delhi,
India. It was formed in 1958 by the merger of
Technical Development Establishment and the
Directorate of Technical Development and
Production with the Defence Science Organization.

DRDO has a network of 52 laboratories which are
deeply engaged in developing defence technologies
covering various fields, like aeronautics, armaments,
electronic and computer sciences, human resource
development, life sciences, materials, missiles,
combat vehicles development and naval research
and development. The organization includes more
than 5,000 scientists and about 25,000 other scientific,
technical and supporting personnel.


AVIONICS:
The DRDO's avionics program has been a success story with its
mission computers, radar warning receivers, high accuracy
direction finding pods, airborne jammers, flight
instrumentation, in use across a wide variety of Indian Air
Force aircraft.

EW systems for the ARMY:
IT is the Indias largest electronic warfare system. It is a land
based EW project, consisting of 145 vehicles. The Samyukta
consists of ESM and ECM stations for both communication and
non-com (radar etc.) systems.

EW systems for the Air Force:
Radar warning receivers for the Indian Air Force of the Tarang
(wave) series. These have been selected for most of the Indian
Air Force's aircraft such as for the MiG-21 Upgrade (Bison
Upgrade), MiG-29, Su-30 MKI, MiG- 27 Upgrade, Jaguar
Upgrade as well as self protection upgrades for the transport
fleet.

A micro controller unit (MCU) is an implementation of
a computer on a single very large scale integrated
circuit. It uses a microprocessor as its central
processing unit (CPU) with additional peripheral
components such as memory, timers, analog-to-digital
converters, parallel I/O interface, asynchronous and
synchronous serial communication interfaces. MCUs
are used in almost every application that requires
certain level of intelligence, such as controllers for
printers, keyboards and home appliances.
Microcontroller can be termed as a single on chip
computer which includes number of peripherals like
RAM, EEPROM, Timers etc., required to perform
some predefined task.




Microcontrollers are meant to perform only the
specific tasks, for e.g., switching the AC off
automatically when room temperature drops to
a certain defined limit and again turning it ON
when temperature rises above the defined
limit.


4 KB on chip program memory.
128 bytes on chip data memory (RAM).
4 Register banks.
8-bit data bus
16-bit address bus
32 general purpose registers each of 8 bits
16 bit timers (usually 2, but may have more, or less).
3 internal and 2 external interrupts.
Bit as well as byte addressable RAM area of 16 bytes.
Four 8-bit ports, (short models have two 8-bit ports).
8051 models may also have a number of special, model-
specific features, such as UARTs, ADC, OpAmps, etc.

AVR is an 8-bit microcontroller belonging to the family of
Reduced Instruction Set Computer (RISC). In RISC
architecture the instruction set of the computer are not only
fewer in number but also simpler and faster in operation.
The AVR family controllers have register based architecture
which means that both the operands for an operation are
stored in a register and the result of the operation is also
stored in a register.AVR microcontrollers are available in
three categories:
1. TinyAVR Less memory, small size, suitable only for
simpler applications
2. MegaAVR These are the most popular ones having
good amount of memory (up to 256 KB), higher
number of inbuilt peripherals and suitable for moderate to
complex applications.
3. XmegaAVR Used commercially for complex
applications, which require large program
memory and high speed.
The features of ATmega16:

16KB of Flash memory
1KB of SRAM
512 Bytes of EEPROM
Available in 40-Pin DIP
8-Channel 10-bit ADC
Two 8-bit Timers/Counters
One 16-bit Timer/Counter
4 PWM Channels
Serial USART
Digital to Analog Comparator.



I/O Ports: Atmega16 has four (PORTA, PORTB, PORTC and PORTD) 8-bit input/
output ports.
Internal Calibrated Oscillator: Atmega16-L is equipped with an internal oscillator for
driving its clock. By default Atmega16-L is set to operate at internal calibrated oscillator
of 1 MHz. The maximum frequency of internal oscillator is 8Mhz. Alternatively,
ATmega16 can be operated using an external crystal oscillator with a maximum
frequency of 16MHz.
ADC Interface: Atmega16 is equipped with an 8 channel ADC (Analog to Digital
Converter) with a resolution of 10-bits. ADC reads the analog input for e.g., a sensor
input and converts it into digital information which is understandable by the
microcontroller.
Timers/Counters: Atmega16 consists of two 8-bit and one 16-bit timer/counter. Timers
are useful for generating precision actions for e.g., creating time delays between two
operations.
Watchdog Timer: Watchdog timer is present with internal oscillator. Watchdog timer
continuously monitors and resets the controller if the code gets stuck at any execution
action for more than a defined time interval.
Interrupts: Atmega16 consists of 21 interrupt sources out of which four are external.
The remaining are internal interrupts which support the peripherals like USART, ADC,
Timers etc.
USART: Universal Synchronous and Asynchronous Receiver and
Transmitter interface is available for interfacing with external device capable of
communicating serially (data transmission bit by bit).
General Purpose Registers: Atmega16 is equipped with 32 general purpose registers
which are coupled directly with the Arithmetic Logical Unit (ALU) of CPU.
Memory: Atmega16 consist of three different memory sections:



Flash EEPROM: Flash EEPROM or simple flash memory is used to store the program dumped or
burnt by the user on to the microcontroller. It can be easily erased electrically as a single unit. Flash
memory is non-volatile i.e., it retains the program even if the power is cut-off. Atmega16 is
available with 16KB of in system programmable Flash EEPROM.

Byte Addressable EEPROM: This is also a non-volatile memory used to store data like values of
certain variables. Atmega16 has 512 bytes of EEPROM, this memory can be useful for storing the
lock code if we are designing an application like electronic door lock.

SRAM: Static Random Access Memory, this is the volatile memory of microcontroller i.e., data is
lost as soon as power is turned off. Atmega16 is equipped with 1KB of internal SRAM. A small
portion of SRAM is set aside for general purpose registers used by CPU and some for the peripheral
subsystems of the microcontroller.

10. ISP: AVR family of controllers have In System Programmable Flash Memory which
can be programmed without removing the IC from the circuit, ISP allows to reprogram the
controller while it is in the application circuit.

11. SPI: Serial Peripheral Interface, SPI port is used for serial communication between two devices
on a common clock source. The data transmission rate of SPI is more than that of USART.

12. TWI: Two Wire Interface (TWI) can be used to set up a network of devices, many devices
can be connected over TWI interface forming a network, the devices can simultaneously transmit
and receive and have their own unique address.

13.DAC: Atmega16 is also equipped with a Digital to Analog Converter (DAC) interface which
can be used for reverse action performed by ADC. DAC can be used when there is a need of
converting a digital signal to analog signal.


The circuit designed
here is a general purpose
circuit which can serve
many applications such
as a Digital clock with
and without Buzzer
alarm, message display
on LCD etc. Below , we
will be designing and
implementing a digital
clock with the aid of a
Atmel AVR ATMega16
microcontroller and an
alphanumeric liquid
crystal display (LCD).

Fig shows the circuit for AVR ATmega16-L based Digital Clock
Display on an LCD. It consists of an ATmega16-L microcontroller ,
a 16X2 LCD , a 12V Relay and a power supply section . To derive
the power supply for the circuit , 230V AC mains is stepped down
by a 12V,750mA Canter tapped transformer which is further
rectified by a full wave rectifier circuit composed of 2 Diodes . It is
then filtered by capacitor C1(100uf). The voltage is regulated by a
7805 regulator. LED glows to indicate the presence of power in the
circuit. The regulated 5V DC powers the entire circuit .

Port A pins PA0 through PA7 of ATmega16-L are connected to
data lines D0 through D7 of the LCD. The LCD control lines-
Read/write(R/W) , Register-select(RS) and enable (EN)- are
connected to PB5, PB6 and PB7 of Port B of MCU . Here, Port A is
the data port and Port B is the control port. 5 Push buttons are
connected to pins PB0 through PB4 of Port B of MCU. These
switch buttons are employed to control(step wise increase /
decrease) the minutes and hours in the Digital Clock circuit.



Our digital clock operates as follows. When the circuit is powered up the
clock starts at "00:00:00" for "HH:MM:SS". There are two push-button
switches used to set the time, S3 and S4. Switch S1 is for setting
the minutes, when this button is pressed the minutes in increase until it
reaches 59 then reset and start counting from 0. Switch S2 is for setting
the hours.Following is the list of components used in this circuit :
1.) ATmega16-L
2.) 16X2 LCD Display
3.) IC7805
4.) Relay(12 V)
5.) Buzzer
6.) Crystal Oscillator(8 MHz)
7.) Push Buttons (5)
8.) Transformer(12-0-12, 750 mA)
9.) Transistors
10.) Potentiometer(10K)
11.) Diodes
12.) Led
13.) Resistors and Capacitors



The circuits PCB is described below, with the actual names of the components as in the
library given within brackets:

1. At the centre is a 40-pin base (40 dip) .
2. Above 40 dip are header pins of 16X2 LCD which forms the Display section.
3. On the top left side is a Potentiometer(10K) which is used for contrast adjustment of
LCD display.
4. On the top of header pins is a diode and a battery connector for provision of external
power source.
5. The Power supply section consists of 3-pin IC at the top right i.e7805 and above it is a
.1F capacitor base(C4) .
6. On the left side of 7805 is a Led base(D3) and resistor base for a 470-ohm resistor(R2)
(0.25-watt resistor with lead spacing of 0.35 inch).
7. Below it are mounting holes for a sugar cube relay(K1) of 12 V.
8. Adjoining the relay is transistor base(R8) which is connected to the base for a 1-kilo-
ohm resistor (0.25-watt resistor with lead spacing of 0.35 inch) .
9. Lower side of Power supply section consist of base of 2 diodes D2 and D1and a
capacitor base for capacitor C3 connected to 3 holes of center tapped transformer
through 3 holes.
10.At the bottom of PCB are bases for 5 push buttons, S1, S2,S3,S4 and S5.
11.From pin 1 through 7 of 40 dip is having a base of resistor array (U4).
12.Near to that on right is base of crystal oscillator(Y1) connected with 2 capacitor bases
(C1 and C2).
13. At lower side , near switches is a transistor base (R11) connected to buzzer through
connector holes.
This general purpose circuit can be used for
many other applications such as : Displaying
Character on LCD , Electronic Voting Machine ,
Moving message display etc.

1. Displaying Single Character on LCD : Here
again a 16X2 LCD Display is interfaced with
ATmega16-L. LCD is working in 8 bit mode.

You might also like