microcontroller atmel avr architecture...
Embedded Systems Engr. Rashid Farid Chishti
[email protected] Chapter 02: AVR AVR Architecture and an d Assembly Programming International IslamicLanguage University H-10, Islamabad, Pakistan http://www.ii.ed.pk
The AVR Data Memory
!wo kinds o" memory space in #$%:
code memory space
data memory space.
pro&ram is pro&ram is stored in code memory space, space, whereas the data memory stores memory stores data data..
!he data memory is memory is composed o" three parts:
'P%s (&eneral prpose re&isters)
*+% (I/ %e&isters)
*%# (&eneral prpose %#)
General urpose Registers In #$% there are &eneral !GRs" in AVR prpose re&isters (all are
bit). !hey are %0-%1 and are located in the lowest location o" memory address in any #$% hip.
!he 'P%s in #$% are like #ccmlator in other microprocessors. !hey can be sed by all arithmetic and lo&ic instrctions.
!he 2, 3, and 4 re&isters are 15-bit address pointers "or indirect addressin& o" the 6ata *pace (%#).
#$% Registers !&FRs" in AVR
!he I/ memory is dedicated to speci"ic "nctions sch as stats re&ister, timers, serial commnication, I/ ports, #6, and so on. !he "nction o" each I/ memory location is "i7ed by the PU desi&ner at the time o" desi&n becase it is sed "or control o" the microcontroller or peripherals. #ll o" the #$%s have at least 58 bytes o" I/ memory locations. !his 58-byte section is called standard I/O memory . In #$%s with more than I/ pins (e.&., #!me&a58, #!me&al, and #!me&a95) there is also an extended I/O memory , which contains the re&isters "or controllin& the e7tra ports and the e7tra peripherals.
The AVR Data Memory Internal data SRAM Internal data *%# is widely sed "or storin& data and parameters by #$% pro&rammers and compilers. 'enerally, this is called scratchpad . ach location o" the *%# can be accessed directly by its address. ;e will se these locations to store data bro&ht into the PU via I/ and serial ports. ach location is bits wide and can be sed to store any data we want as lon& as it is -bit. #&ain, the siently. !he three parts o" the data memory ('P%s, *+%s, and the internal *%#) are made o" *%#. ?y addin& the si