introduction to avr microcontroller atmel atmega16

44
INTRODUCTION TO ATMEGA16 Robo India http://roboindia.com

Upload: robo-india

Post on 18-Nov-2015

75 views

Category:

Documents


5 download

DESCRIPTION

This presentation of Robo India is expressing the introduction to AVR microcontroller series microcontroller Atmel Atmega 16. This presentation contains all one need to learn AVR microncontoller, If you dont want to read hundreds of pages of data sheet then it is the best solution for you. It is to be noted that all of the microcontrollers of AVR family behave in same manner. So this documents is suitable for you if you want to learn any of the micrcocontroller of AVR family.We welcome you queries and views. We are fond at;website: http://roboindia.commail: [email protected]

TRANSCRIPT

Embedded system

Introduction to atmega16Robo Indiahttp://roboindia.com

1

OverviewThe ATmega16 is a low-power CMOS 8-bit microcontroller based on the AVR enhanced RISC Architecture.

2

OverviewWHAT IS CMOS 8-bit microcontroller RISC Architecture

3

CMOSCMOS -Complementary Metal Oxide SemiconductorCMOS is a technology for constructing integrated circuitsTwo important characteristics of CMOS devices are high noise immunity and low static power consumption.

CMOS = COMPLEMENTRY , NOISE IMUNE , LOW POWER CONSUMPTION4

OverviewWHAT IS CMOS 8-bit microcontroller RISC Architecture

5

X-bit microcontroller8 bit : 00000000 capable of doing number up to 255 (0-255)

16 bit: 00000000_00000000 capable of doing numbers up to 65535 (0-65535)

32 bit: 00000000_00000000_00000000_00000000 capable of doing numbers up to 4294967295 (0-4294967295)

Qn : now convert 32 bit binary data to decimal upto 255 , 65535 , 42949672956

OverviewWHAT IS CMOS 8-bit microcontroller RISC Architecture

7

RISC ArchitectureRISC stands for Reduced Instruction Set Computer.RISC is a type of microprocessor architecture that utilizes a small, highly-optimized set of instructions

Reduced Instruction Set Computer , better then cisc8

Feature of atmega1616 Kbytes of In-System Programmable FlashProgram memory with Read-While-Write capabilities 512 bytes EEPROM, 1 Kbyte SRAM 32general purpose I/O lines32 general purpose working registers

16 KB FLASH MEMORY512 byte EEPROM9

FEATURE of atmega16Write/Erase Cycles: 10,000 Flash/100,000 EEPROMData retention: 20 years at 85C/100 years at 25C(1)Programming Lock for Software SecurityUp to 16 MIPS Throughput at 16 MHz512 Bytes EEPROM

WRITE CYCLE 10KERASE CYCLE 100K

10

Peripheral FeaturesTwo 8-bit Timer/Counters One 16-bit Timer/Counter Four PWM Channels8-channel, 10-bit ADC

8 and 16 Bit timer/counter4 PWM8 channel 10 bit ADC11

Peripheral FeaturesProgrammable Watchdog Timer Six Sleep Modes:IdleADC Noise ReductionPower-savePower-downStandby Extended Standby

IdleADC NOISE REDUCTIONPOWER SAVEPOWER DOWNSTANDBYEXTENDED STANDBYThe ADC features a noise canceler that enables conversion during sleep mode to reduce noiseinduced from the CPU core and other I/O peripherals.12

Peripheral FeaturesOperating Voltages2.7V - 5.5V for ATmega16L4.5V - 5.5V for ATmega16Speed Grades0 - 8 MHz for ATmega16L0 - 16 MHz for ATmega16Power Consumption @ 1 MHz, 3V, and 25C for ATmega16LActive: 1.1 mAIdle Mode: 0.35 mAPower-down Mode: < 1 A

2.7 5.5 QN SPEED GRADE EXPLAIN13

registerRegister is a data holding place and very fast memory, its a part of CPU.Registers serves as connection between a CPU and a Peripheral device CPU doesnt give instruction directly to peripherals or output devices.

14

registerCPU doesnt give instruction directly to peripherals or output devices.CPU give output by writing registersCPU take input by reading registers

15

Writing register

16

Reading register

17

register IN CPU

18

Atmega16 Pin Diagram

19

Atmega16 Pin Diagram

20

Input/output Ports Atmega16 have total of 40 pins 32 I/O pins.. PORTA = 8 Pins PORTB = 8 Pins PORTC = 8 Pins PORTD = 8 Pins

21

Pin descriptionVCC (PIN11) - Digital supply voltage.

GND (PIN12) - Ground

22

Pin descriptionPort A (PA7..PA0) - Port A serves as the analog inputs to the A/D Converter Port A also serves as an 8-bit bi-directional I/O port, if the A/D Converter is not used. Port pins can provide internal pull-up resistors (selected for each bit)

23

Pin description

24

Pin descriptionPort B (PB7..PB0) - Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). Port B also serves the functions of various special features of the ATmega16

25

Pin description

PB7- Master Clock output, Slave Clock input

26

Pin descriptionPort C (PC7..PC0) - Port C is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). If the JTAG interface is enabled, the pull-up resistors on pins PC5(TDI), PC3(TMS) and PC2(TCK) will be activated even if a reset occurs.

JTAG JOINT TEST ACTION GROUPTCK , TMS , TDI are USED IN TAP TEST ACCESS PORT27

Pin description

Timer Oscillator pin 1: When the AS2 bit in ASSR is set (one) to enable asynchronousclocking of Timer/Counter2

JTAG JOINT TEST ACTION GROUPTCK , TMS , TDI are USED IN TAP TEST ACCESS PORT28

Pin descriptionPort D (PD7..PD0) - Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). Port D also serves the functions of various special features of the ATmega16

29

Pin description

30

Pin descriptionRESET - Reset Input. A low level on this pin for longer than the minimum pulse length will generate a reset. Shorter pulses are not guaranteed to generate a reset.

31

Pin descriptionAVCC - AVCC is the supply voltage pin for Port A and the A/D Converter. It should be externally connected to VCC, even if the ADC is not used. If the ADC is used, it should be connected to VCC through a low-pass filter.AREF - AREF is the analog reference pin for the A/D Converter.

32

STACK POINTER

SP used for storing temporary datafor storing local variables and for storingreturn addresses after interrupts33

System Clock and Clock Options

34

System Clock and Clock Options

35

System Clock and Clock Options

36

System Clock and Clock Options

37

SLEEP MODE SELECTION

38

RESET

39

RESET

40

Instruction Fetch and execution

41

Interrupt Handling

42

Interrupt Handling

43

In case of queries please write us-

[email protected]