AVR structure

Wafik Rkab
A free video tutorial from Wafik Rkab
Embedded systems engineer
4.0 instructor rating • 7 courses • 3,939 students

Learn more from the full course

Embedded systems using ATmega series#1

PERIPHERALS: PORTS & EEPROM

01:03:20 of on-demand video • Updated January 2020

  • Identify the structure and registerss of the Microcontrollers
  • Customize Microcontrollers Resources in a Business Project
  • Write programs with multiple tasks with simulations
  • becomes ready for integrated projects
English Hello and welcome..we will study the general structure of AVR microcontrollers from Atmel Companey, and study ATMEGA32 in details with applications on it. Atmel company realize on RISC technology in microcontrollers design this technique means the fastest with the least number of machine language instructions. The AVR microcontroller can execute one million instructions per second if it's Clock is 16 MHz. So they are designed as separate units all units are connected to the Data Bus and the Data Bus is 8 bits width. also all units are related with control signals, the units operate on one Clock source. So they work in parallel , while the microcontroller Brings and executes the instructions. These units are called peripherals. Each unit performs specific tasks, in general AVR microcontrollers contains a few units as possible. parts of them are RAMS, other parts perform a different tasks, and the other parts are input and output of the microcontroller to outside. flash program memory unit. It can keep the data after power is out. So the program is saved in the flash memory, It's size depends on the AVR microcontroller, in the ATMEGA32 is 32KBytes ,program counter is a register contains the value of current instruction. address. during execute the program. program counter register increases from the beginning to the end of the program. instruction register contains that code of the current instruction that it's address in the program counter. the width of the instruction register must be equals to 2bytes as width of the flash memory. the instruction maybe logic instructions, control instructions, or move data. the decoder unit execute the instructions by control lines and units. the general register unit contains 32 registers for general purposes. Size of these registers is 8 bits. they are used by instruction register for general or temporary parameters during execution the program. and direct addressing. Of course if we want to program with assembly language we must do all these things. As addressing and move data between units. but all C language compilers do these tasks themselves. And let us program the main idea of our projects. the code of instructions inter to the Arithmetic Logic Unit (ALU). to execute the calculation and logic operations and the results to the Data Bus,Status and control register shows the current flags of the current operation results in ALU. the flags are bits maybe carry, positive or negative. etc ... Data SRAM is a read /write memory, so we can read and write data from and to it. it's size is different by the AVR microcontroller. but in the ATMEGA32 is 2 Kbytes. it contains the general. parameters of the program. and contains a stack to execute the functions and interrupts. EEPROM is a type of memory, also keeps that data as a flash memory. But we use it to save our parameters. that we want to long time, as the parameters of weather for months time. I/O lines unit controls the output/ inpot buffers. I/O modules for PORTS of microcontrollers. ATMEGA32 contains 4 PORTS , PORTA,PORTB,PORTC, And PORTD . the size of PORT is 8 bits as Data Bus. analog comparator changes the analog value to digital value. watchdog timer. restarts the microcontroller, if it is stoped. SPI unit is a type of Master/slave Serial interface. interrupt units. Responsible for external interrupts as INT0,INT1, and INT2 and internal interrupts as ADC or comparator interrupts. This is the general structure of if AVR and we will study the structure of ATMEGA32 in details.