Midterm_Post_Review - Midterm#1 Post Review Fundamentals of Mechatronics Engineering Addressing How many bytes can I address with an 8 or 16 bit

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Midterm #1 Post Review Fundamentals of Mechatronics Engineering 10/14/08
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Addressing How many bytes can I address with an 8 or 16 bit register? 8 bits=2^8=256 (0-255) 16 bits=2^16=65,536 (0-65,535) The question was not: How many bytes is a 8 or 16 bit register?
Background image of page 2
Program Counter What element holds the address of the next line to be executed in program memory? The program counter The stack pointer is a holds copies of program addresses temporarily that can be restored (copied back) to program counter, but whatever is in the program counter is the address of what will executed. Also, while some microcontrollers use EEPROM for program memory, the Atmega128 uses Flash RAM
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Program Counter/Stack Pointer 10 FF Stack Point (16 bit) Program Memory (Flash RAM) 00 00 Program Counter (16 bit) Internal Memory (Gen. Purpose Registers, I/O registers, SRAM) rjmp Main ldi R9, 0xFF ; (main label) ldi R10, 0x34 call MySubroutine; ….more code MySubroutine: ….subroutine code here ret ; jump back to Main loop 0x0000 0x0001 0x0002 0x0003 0x0004 0x01BD 0x01BE 00 00 00 00 00 0x0100 0x0101 0x01FD 0x01FE 0x01FF 01 02 03 04 FE BD 01 BE 04 Restore Program counter using SP as address to retrieve value from stack Call Subroutine jumps Program counter and stores return address in stack Stack Pointer Initialized
Background image of page 4
Hexadecimal What is 0110 1111 in hex? What is 12 in hex?
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/08/2010 for the course ME 106 at San Jose State University .

Page1 / 13

Midterm_Post_Review - Midterm#1 Post Review Fundamentals of Mechatronics Engineering Addressing How many bytes can I address with an 8 or 16 bit

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online