Vous êtes sur la page 1sur 20

ATMEGA16 pin diagram

,ports and its application


Introduction to Atmega16. 
 It is a 40-pin low power 8-bit microcontroller which is
developed using CMOS technology and based on AVR
architecture. This is the most commonly used AVR
microcontroller which belongs to Atmel Mega family.
 Other microcontrollers that are readily available and fall
under AVR category are Atmega 8 and Atmega 32. All
these controllers perform similar tasks, however, they are
only different in terms of their memory size and cost.
 Atmega16 is a 40-pin low power microcontroller which is
developed using CMOS technology.
 CMOS is an advanced technology which is mainly used
for developing integrated circuits. It comes with low
power consumption and high noise immunity.
Introduction to Atmega16.
 It is a single chip computer that comes with CPU, ROM,
RAM, EEPROM, Timers, Counters, ADC and four 8-bit
ports called PORTA, PORTB, PORTC, PORTD where
each port consists of 8 I/O pins.
 Atmega16 has built-in registers that are used to make a
connection between CPU and external peripherals
devices. CPU has no direct connection with external
devices. It can take input by reading registers and give
output by writing registers.
 Atmega16 comes with two 8-bit timers and one 16-bit
timer. All these timers can be used as counters when
they are optimized to count the external signal.
Introduction to Atmega16
 Atmega16 is an 8-bit controller based on AVR advanced
RISC (Reduced Instruction Set Computing) architecture.
AVR is family of microcontrollers developed by Atmel in
1996.
 Most of the necessary peripherals required to run
automatic functions are incorporated in this device like
ADC (analog to digital converter), Analog comparator,
USART, SPI, which make it economical as compared to a
microprocessor that requires external peripheral to
perform various functions.
 Atmega16 comes with 1KB of static RAM which is a
volatile memory i.e stores information for short period of
time and highly depends on the constant power supply.
Introduction to Atmega16
 Whereas 16KB of flash memory, also known as ROM, is
also incorporated in the device which is non-volatile in
nature and can store information for long period of time
and doesn’t lose any information when the power supply
is disconnected.

 Atmega16 works on a maximum frequency of 16MHz


where instructions are executed in one machine cycle.
Architecture of Atmega16
1. CPU
 CPU is like a brain of the controller which helps in
executing a number of instructions. It can handle
interrupts, perform calculations and control peripherals
with the help of registers. Atmega16 comes with two
buses called instruction bus and data bus.

 The CPU reads the instructions in the instruction bus


while data bus is used to read or write the corresponding
data. The CPU mainly consists of the program counter,
general purpose registers, stack pointer, instruction
register and an instruction decoder.
2. ROM
 The controller program is stored in ROM, also known as
non-volatile programmable flash memory. The flash
memory comes with a resolution of at least 10,000
write/erase cycles. Flash memory is mainly divided into
two parts known as Application flash section and booth
flash section

 Program of the controller is stored in the applications


flash section. While booth flash section is optimized to
work directly when the controller is powered up
3. RAM
 The SRAM (static random access memory) is used for
storing information temporarily and comes with 8-bit
registers. This is just like a regular computer RAM which
is used to supply data through the runtime.

 4. EEPROM
 The EEPROM (Electronically Erasable Read Only
Memory) is non-volatile memory used as a long time
storage. It has no involvement in executing the main
program. It is used for storing the configuration of the
system and device parameters which continues to work
in the reset of the application processor
 EEPROM comes with a limited write cycle up to 100,000
while read cycles are unlimited. While using EEPROM,
write minimum instructions as per requirement, so you
can get benefit from this memory for a longer time.

 5. Interrupt
 The interrupt is used for an emergency which puts the
main function on hold and executes the necessary
instructions at that time. Once the interrupt is called and
executed the code switches back to the main program.
6. Analog and Digital I/O
Modules
Digital I/O modules are used to set a digital
communication between the controller and external
devices. While analog I/O modules are used for
transferring analog information. Analog comparators and
ADC fall under the category of analog I/O modules.
 7. Timer/Counter
 Timers are used for calculating the internal signal within
the controller. Atmega16 comes with two 8-bit timers and
one 16-bit timer. All these timers work as a counter when
they are optimized for external signals.
8. Watchdog Timer
 The watchdog timer is a remarkable addition
in this controller which is used to generate
the interrupt and reset the timer. It comes
with 128kHz distinct CLK source.

 9. Serial Communication
 Atmega16 comes with USART and SPI units
that are used for developing serial
communication with the external devices.
Atmega16 Pinout
PIN Description
 Atmega16 is preferred over other
microcontrollers like Atmel 8051 because it
comes with much faster ability to execute
instructions and consist of modified RISC
processor.
 It has a built-in flash which comes with
features of a bootloader. It has built-in 10-bit
ADC, SPI, PWM, and EEPROM.
PORT A
PORT B
PORT C
PORT D
 Reset. Pin9 is an active low reset Pin. A low-level pulse for
longer than minimum pulse length will produce a reset. Short
pulses are unlikely to produce reset.
 VCC. Pin10 is a power supply pin for this controller. The power
supply of 5 V is required to put this controller in a running
condition.
 GND. Pin11 is a ground pin.
 AREF. Pin32 is an analog reference pin mainly used for A/D
converter.
 AVCC. Pin30 is an AVCC which is a supply voltage pin for
PORTA and ADC. It is connected to VCC through a low pass
filter in the presence of ADC. However, in the absence of ADC,
AVCC is externally connected to VCC.
 Pin 12 & 13. A crystal oscillator is connected with these pins.
Atmega16 works at the internal frequency of 1MHZ; the oscillator
is added to generate high clock pulses and frequency.
Applications
 AVR controllers come with a wide range of applications
where automation is required. Following are the main
applications of Atmega16.
 Medical equipment
 Home automation
 Embedded systems
 Arduino Projects
 Used in automobiles and industrial automation
 Home appliances and security systems
 Temperature and pressure control devices

Vous aimerez peut-être aussi