ATmega32

2,943 views
2,593 views

Published on

AVR Atmega 32 microcontroller basics

Published in: Education
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,943
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

ATmega32

  1. 1. MICROCONTROLLERATmega32Saad AhmedBE(E)
  2. 2. What is Microcontroller ?• A microcontroller is a small computer on a singleintegrated circuit containing a processor core, memory,and programmable input/output peripherals.
  3. 3. Types of Microcontrollers
  4. 4. AT mega 32• ATMEL AVR chips pack lots of power (1MIPS/MHz, clocks up to 16MHz)and space (up to 128K of flash program memory and 4K of EEPROM andSRAM) at low prices.• HLL Support, like C, helps increase reuse and reduce turn-around/debugtime/headaches.• In-System Programmable flash--can easily program chips, even while in-circuit.• Many peripherals: a whole bunch of internal and external interrupt sourcesand peripherals are available on a wide range of de-vices (timers, UARTs,ADC, watchdog, etc.).• 32 registers: The 32 working registers (all directly usable by the ALU) helpkeep performance snappy, reducing the use of time-consuming RAMaccess.
  5. 5. Basic Architecture
  6. 6. Pin Configuration
  7. 7. Instruction Set
  8. 8. Application(Stepper Motor)
  9. 9. Source code#include<avr/io.h>#include<util/delay.h>void main(){DDRB=0b00001111;while(1){if(PIND==0b00000001){PORTB=0b00000001;_delay_ms(10);PORTB=0b00000011;_delay_ms(10);PORTB=0b00000010;_delay_ms(10);PORTB=0b00000110;_delay_ms(10);PORTB=0b00000100;_delay_ms(10);PORTB=0b00001100;_delay_ms(10);PORTB=0b00001000;_delay_ms(10);PORTB=0b00001001;_delay_ms(10);}
  10. 10. Cont…if(PIND==0b00000010){PORTB=0b00001000;_delay_ms(10);PORTB=0b00001100;_delay_ms(10);PORTB=0b00000100;_delay_ms(10);PORTB=0b00000110;_delay_ms(10);PORTB=0b00000010;_delay_ms(10);PORTB=0b00000011;_delay_ms(10);PORTB=0b00000001;_delay_ms(10);PORTB=0b00001001;_delay_ms(10);}DDRD=0b00010000;}}
  11. 11. Thank you

×