Advanced Search
Search Results
9 total results found
1. Memory in AVR Architecture
AVR Architecture is an 8 bit single-chip RISC microcontroller with a modified Harvard Architecture that is organized as the following which causes it to behave certain ways when handling memory. You don't have to memorize all this don't worry. There are sev...
2. Addressing Modes
Due to how the AVR Architecture and its memory are organized, AVR instructions, including arithmetic instructions, must follow certain addressing methods. Addressing methods are how the control unit may access different data locations according to the instruct...
3. The Status Register
The Status Register (SREG) is a special 8 bit register that saves different operational status flags in each bit. Different operations may affect different flags (bit) of the register which then would be useful to create decisions after. In AVR architecture, S...
4. Advanced Arithmetic Operations
As a refresher, here are some fundamental AVR arithmetic and logical instructions. Mnemonic Operand Description Example Notes ADD Rd, Rr Add ADD R1, R2 Rd = Rd + Rr ADC Rd, Rr Add with Carry ADC R1, R2 Rd = Rd + Rr + C (Carry flag) ADIW Rd, K Add Im...
5. The Stack
The Stack is a memory section of the SRAM that follows First-In-First-Out (FIFO) principles. It is generally used to store temporary data for quick and easy access. The top of the stack is tracked by the 16 bit (adjusting to memory addressing) Stack Pointer th...
6. Printing Bytes as Hexadecimal Values
To easily debug and view numbers, we can create a subroutine that outputs numbers into serial. Since our architecture uses 8 bits, it is easier to print bytes as two hexadecimal values 0x00 - 0xFF by splitting the upper and lower nibbles. In this page, we will...
7. 𝔗𝔥𝔢 ℭ𝔬𝔡𝔢
#define __SFR_OFFSET 0x00 #include "avr/io.h" .global main main: RCALL SER_init LDI ZH, hi8(opening_msg) LDI ZL, lo8(opening_msg) RCALL SER_print ; 16 Bit Addition LDI ZH, hi8(addition_msg) LDI ZL, lo8(addition_msg) RCALL SER_print ...
8. References
“AVR ® Instruction Set Manual AVR ® Instruction Set Manual.” Available: https://ww1.microchip.com/downloads/en/DeviceDoc/AVR-InstructionSet-Manual-DS40002198.pdf “Lecture 02 – AVR Architecture,” Umbc.edu, 2025. https://eclipse.umbc.edu/robucci/cmpe311/Lectures...