AT mega8 basics
-
Upload
thetechnicalzone -
Category
Education
-
view
211 -
download
6
Transcript of AT mega8 basics
AVR AVR ATMEGA 8 ATMEGA 8
MICRO-CONTROLLERMICRO-CONTROLLER
http://bestnetworkingsolutions.blogspot.in 1
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
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
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
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
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
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
PIN OUTPIN OUT
http://bestnetworkingsolutions.blogspot.in 8
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
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
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
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
REGISTER DESCRIPTION OF I/O REGISTER DESCRIPTION OF I/O PORTSPORTS
http://bestnetworkingsolutions.blogspot.in 13
http://bestnetworkingsolutions.blogspot.in 14
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
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
CONTD....CONTD....
http://bestnetworkingsolutions.blogspot.in 17
CONTD....CONTD....
http://bestnetworkingsolutions.blogspot.in 18
CONTD....CONTD....
http://bestnetworkingsolutions.blogspot.in 19
CONTD....CONTD....
http://bestnetworkingsolutions.blogspot.in 20
THANK YOU…THANK YOU…
http://bestnetworkingsolutions.blogspot.in 21