Avr Microcontroller
Avr Microcontroller
Digital clock
Game
APPLICATION
.
INPUT OUTPUT
RAM ROM
MICROCONTROLLER
Microprocessor & Microcontroller
Microprocessor:
A silicon chip that contains a CPU. In the world of personal computers, the
terms microprocessor and CPU are used interchangeably. At the heart of all
personal computers and most of all automatic systems.
Microcontroller :
A microcontroller (sometimes abbreviated µC, uC or MCU) is a small
computer on a single integrated circuit containing a processor core, memory,
and programmable input/output peripherals.
Basic Block Diagram of Microcontroller
AVR
A: Advance
V: Virtual
R:Risc
AVR
ATMEGA 8
MICRO-CONTROLLER
It was developed by Atmel Corporation
It is a very fast architecture which executes one instruction per clock
cycle.
PORTB-8ch 1.VCC
2.GND
PORTC-7ch 3.GND
4.AVCC
PORTD-8ch 5.AREF
total port pin:23
PORT
PORT is use for input and out put communication.
Every PORT has three registers associated with it each one with 8 bit.
PORT IS 8 BIT REGISTERS.
PORT IS COMBINATION OF 8 FLIP FLOP
PORTB
PORTD
PD7 PD6 PD5 PD4 PD3 PD2 PD1 PD0
PORT Associated Registers
DDRx (Data Direction Register) configures data direction of port pins. Means its
setting determines whether port pins will be used for input or output. Writing 0
to a bit in DDRx makes corresponding port pin as input, while writing 1 to a bit in
DDRx makes corresponding port pin as output.
DDRB= 0 0 0 0 0 0 0 0
DDRB= 1 1 1 1 1 1 1 1
PORTB=0b00000000
0 0 0 0 0 0 0 0
PORTB=0b11111111
1 1 1 1 1 1 1 1
PORTB=0b11000011
1 1 0 0 0 0 1 1
STEP1:
Make Portb as output
DDRB=0b11111111
STEP2:
Provide +5v to LED.
PORTB=0b11111111
LED BLINKING
shifting
PORTB=0b00000001
PORTB=0b00000010
PORTB=0b00000100
PORTB=0b00001000
PORTB=0b00010000
PORTB=00100000
STEP1: WRITING CODE.
COMPUTER
.hex file
Thanks........