AT mega8 basics

21
AVR AVR ATMEGA 8 ATMEGA 8 MICRO-CONTROLLER MICRO-CONTROLLER http://bestnetworkingsolutions.blogspot.in 1

Transcript of AT mega8 basics

Page 1: AT mega8 basics

AVR AVR ATMEGA 8 ATMEGA 8

MICRO-CONTROLLERMICRO-CONTROLLER

http://bestnetworkingsolutions.blogspot.in 1

Page 2: AT mega8 basics

INTRODUCTIONINTRODUCTION

• ATmega8 is a 8-bit microcontroller based on the AVR RISC ATmega8 is a 8-bit microcontroller based on the AVR RISC

architecturearchitecture

• By executing powerful instructions in a single clock cycle, By executing powerful instructions in a single clock cycle,

the ATmega8 achieves throughput approaching 1 MIPS per the ATmega8 achieves throughput approaching 1 MIPS per

MHzMHz

http://bestnetworkingsolutions.blogspot.in 2

Page 3: AT mega8 basics

Contd....Contd....

• In order to maximize performance and parallelism, the AVR In order to maximize performance and parallelism, the AVR

uses a Harvard architecture- which separates memories and uses a Harvard architecture- which separates memories and

buses for program and databuses for program and data

• Instruction in program memory are executed with single Instruction in program memory are executed with single

level pipelininglevel pipelining

• This concept enables instructions to be executed in every This concept enables instructions to be executed in every

clock cycleclock cycle

http://bestnetworkingsolutions.blogspot.in 3

Page 4: AT mega8 basics

FEATURESFEATURES

• High-performance 8 bit MicrocontrollerHigh-performance 8 bit Microcontroller

• Up to 16 MIPS Throughput at 16 MHzUp to 16 MIPS Throughput at 16 MHz

• 32 x 8 General Purpose Working Registers32 x 8 General Purpose Working Registers

• Six ADC channels in PDIP packageSix ADC channels in PDIP package

• Internal Calibrated OscillatorInternal Calibrated Oscillator

http://bestnetworkingsolutions.blogspot.in 4

Page 5: AT mega8 basics

TYPES OF PACKAGESTYPES OF PACKAGES

• 28-pin PDIP (Plastic Dual In-line Package)28-pin PDIP (Plastic Dual In-line Package)

• 32-pin TQFP (Thin Quad film Package)32-pin TQFP (Thin Quad film Package)

http://bestnetworkingsolutions.blogspot.in 5

Page 6: AT mega8 basics

MEMORY SEGMENTSMEMORY SEGMENTS

• 8K Bytes of Flash program memory8K Bytes of Flash program memory

• 512 Bytes EEPROM (Electrically Erasable Programmable 512 Bytes EEPROM (Electrically Erasable Programmable Read Only Memory)Read Only Memory)

• 1K Byte Internal RAM (Random Access Memory)1K Byte Internal RAM (Random Access Memory)

http://bestnetworkingsolutions.blogspot.in 6

Page 7: AT mega8 basics

Contd....Contd....

• Write/Erase Cycles: 10,000 Flash/100,000 EEPROMWrite/Erase Cycles: 10,000 Flash/100,000 EEPROM

• Data retention: 20 years at 85°C/100 years at 25°CData retention: 20 years at 85°C/100 years at 25°C

http://bestnetworkingsolutions.blogspot.in 7

Page 8: AT mega8 basics

PIN OUTPIN OUT

http://bestnetworkingsolutions.blogspot.in 8

Page 9: AT mega8 basics

PIN DESCRIPTIONPIN DESCRIPTION

• VCC VCC Digital supply voltageDigital supply voltage

• GND GND GroundGround

• RESET RESET A low level on this pin for longer than the minimum A low level on this pin for longer than the minimum

pulse length will generate a reset, even if the clock is not pulse length will generate a reset, even if the clock is not

runningrunning

• AREF AREF The analog reference pin for the A/D ConverterThe analog reference pin for the A/D Converter

http://bestnetworkingsolutions.blogspot.in 9

Page 10: AT mega8 basics

Contd....Contd....

• AVCC AVCC The supply voltage pin for the A/D ConverterThe supply voltage pin for the A/D Converter

http://bestnetworkingsolutions.blogspot.in 10

Page 11: AT mega8 basics

PORTSPORTS• Three ports i.e PortB, PortC, PortDThree ports i.e PortB, PortC, PortD

• Three registers associated with every portThree registers associated with every port

DDRx – Data Direction RegisterDDRx – Data Direction Register

PINx – Port inputPINx – Port input

PORTx- Port outputPORTx- Port output

*Note – ‘x’ is subscript and could be either of B, C, D*Note – ‘x’ is subscript and could be either of B, C, D

http://bestnetworkingsolutions.blogspot.in 11

Page 12: AT mega8 basics

PORT B (PB7..PB0)PORT B (PB7..PB0)

• Port B is an 8-bit bi-directional I/O portPort B is an 8-bit bi-directional I/O port

• Can be used either as a input port or as output port Can be used either as a input port or as output port

( direction must be specified in programming)( direction must be specified in programming)

http://bestnetworkingsolutions.blogspot.in 12

Page 13: AT mega8 basics

REGISTER DESCRIPTION OF I/O REGISTER DESCRIPTION OF I/O PORTSPORTS

http://bestnetworkingsolutions.blogspot.in 13

Page 14: AT mega8 basics

http://bestnetworkingsolutions.blogspot.in 14

Page 15: AT mega8 basics

PORT C (PC5..PC0)PORT C (PC5..PC0)

• Port C is an 7-bit bi-directional I/O port Port C is an 7-bit bi-directional I/O port

• Can be used either as a input port or as output port Can be used either as a input port or as output port

( direction must be specified in programming)( direction must be specified in programming)

http://bestnetworkingsolutions.blogspot.in 15

Page 16: AT mega8 basics

PORT D (PD7..PD0)PORT D (PD7..PD0)

• Port D is an 8-bit bi-directional I/O port Port D is an 8-bit bi-directional I/O port

• Can be used either as a input port or as output port Can be used either as a input port or as output port

( direction must be specified in coding)( direction must be specified in coding)

http://bestnetworkingsolutions.blogspot.in 16

Page 17: AT mega8 basics

CONTD....CONTD....

http://bestnetworkingsolutions.blogspot.in 17

Page 18: AT mega8 basics

CONTD....CONTD....

http://bestnetworkingsolutions.blogspot.in 18

Page 19: AT mega8 basics

CONTD....CONTD....

http://bestnetworkingsolutions.blogspot.in 19

Page 20: AT mega8 basics

CONTD....CONTD....

http://bestnetworkingsolutions.blogspot.in 20

Page 21: AT mega8 basics

THANK YOU…THANK YOU…

http://bestnetworkingsolutions.blogspot.in 21