Microcontroller Components

  • Central Processing Unit (CPU)
    • Contains arithmetic circuits, the called Arithmetic Logic Unit (ALU)
    • Executes instructions
  • Memory
    • Holds the program(s)
    • Holds data program(s) operate on
  • Input Port(s)
    • Allows info to enter from the outside world
    • PORTA
    • PORTB
    • PORTC
    • PORTD
  • Output Port(s)
    • Allows info to be sent to the outside world
    • PORTA
    • PORTB
    • PORTC
    • PORTD
  • All ports are 8-bits wide

Memory Types

There are two types of memory:

  • Read/Write
    • typically this memory is volatile – must keep power applied to memory chip in order for it to keep its state
    • Two types:
      • Static Random Access Memory (SRAM) – found on the ATMEGA32
        • Uses a flip-flop to store state
      • Dynamic Random Access Memory (DRAM) – found on
        • Uses capacitor to store state
        • Must refresh memory state frequently or capacitor will lose its charge
        • Can get in high density
  • Read Only Memory (ROM)
    • typically this memory is non-volatile – keeps its state even without power
    • FLASH
    • EEPROM – Electrically Erasable Programable Read Only Memory
      • Actually can write to it, but writing is very slow compared to reading

The ATMEGA32 uses SRAM for data and FLASH memory for the program

  • This is know as the Harvard Architecture which is used by many modern processors
  • This means that your program will still be there the next time you turn your board on, it will run your program (but all data will be lost)
  • The Harvard architecture is safer because it prevents the program from overwriting itself and then executing the data

SRAM

  • Allows storage of 1's and 0's
  • The data is stored in groups of 8 bits per location
  • Memory is organized as an array
  • Each location has a unique address
  • The ATMEGA32 has 2KiB (2048 bytes)
  • We could represent each unique address with 11 bits, but the ATMEGA32 uses 16 bit address
  • 0x60 is the first available address of SRAM
  • 0x85F is the the last available address of SRAM

FLASH

  • Also stores 1's and 0's
  • The data is stored in groups of 16 bits per location
  • Memory is organized as an array
  • Each location has a unique address
  • The ATMEGA32 has 32KiB (32768 bytes)
    • Often 32KiB is referred to as 32KB, but as of November 2000, the correct prefixes for binary multiples are kibibytes (KiB), mebibytes (MiB), gibibytes (GiB), etc.
  • Since each location is 16 bits, we have 214 = 16384 locations
  • We would need 14 bits to represent each unique address

Programmable Registers

  • ATMEGA32 has 32 registers
  • The registers are each 8 bits wide
  • They are located at r0 through r31
  • The registers are located in SRAM at addresses 0x00 through 0x1F
cs280/microcontrollercomponents.txt · Last modified: 2010/03/09 20:55 (external edit)
 

This website is not owned or managed by the Milwaukee School of Engineering.

© 2003-2010 Dr. Christopher C. Taylor, et. al. • Office: L-343 • Phone: 277-7339 • npǝ˙ǝosɯ@ɹolʎɐʇ • -> RSS <-