{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Midterm_Post_Review

# Midterm_Post_Review - Midterm#1 Post Review Fundamentals of...

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

Midterm #1 Post Review Fundamentals of Mechatronics Engineering 10/14/08

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

View Full Document
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?
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

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

View Full Document
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
Hexadecimal What is 0110 1111 in hex? What is 12 in hex?

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}