Recently Updated Pages
4. Internal/Timer Interrupts
Internal Interrupts Now Internal interrupts or Timer interrupts is somewhat more complex then ext...
3. External Interrupt Registers
For detailed information about the registers, please refer to the Atmega32p datasheet. here Fro...
2. Interrupt Handler
On the ATMega328P microcontroller, there are three essential requirements that must met to enable...
1. Introduction to Interrupt
An interrupt is a mechanism used in microcontroller programming to pause the execution of the cur...
2. Operating Modes
2.1. Normal Mode In Normal Mode, the timer acts as a simple up-counter. It starts from 0 and inc...
6. Der Code
6.1. Code Example 1 (Timer0) This code toggles PD5 every 0.5s. The delay_timer0 subroutine uses ...
5. Delay Using Timers
5.1. Delay Calculation in Normal Mode In Normal Mode, the timer always counts up to its maximum v...
4. Timer1
4.1. TCNT1 (Timer/Counter Register) TCNT1 is functionally the same as TCNT0, serving as the core...
3. Timer0
3.1. TCNT0 (Timer/Counter 0 Register) The TCNT0 register is the core component of the 8-bit TIME...
1. Introduction to AVR Timers
1.1. Overview The ATmega328P is a widely popular 8-bit microcontroller, serving as the "brain" fo...
5. The Stack
The Stack is a memory section of the SRAM that follows First-In-First-Out (FIFO) principles. It i...
8. References
“AVR ® Instruction Set Manual AVR ® Instruction Set Manual.” Available: https://ww1.microchip.com...
7. 𝔗𝔥𝔢 ℭ𝔬𝔡𝔢
#define __SFR_OFFSET 0x00 #include "avr/io.h" .global main main: RCALL SER_init LDI ZH, ...
6. Printing Bytes as Hexadecimal Values
To easily debug and view numbers, we can create a subroutine that outputs numbers into serial. Si...
4. Advanced Arithmetic Operations
As a refresher, here are some fundamental AVR arithmetic and logical instructions. Mnemonic Op...
3. The Status Register
The Status Register (SREG) is a special 8 bit register that saves different operational status fl...
2. Addressing Modes
Due to how the AVR Architecture and its memory are organized, AVR instructions, including arithme...
1. Memory in AVR Architecture
AVR Architecture is an 8 bit single-chip RISC microcontroller with a modified Harvard Architectur...
USART Register Architecture of ATmega328p
The ATmega328p microcontroller uses several specific registers to control and monitor USART commu...
Introduction to USART
1. USART Definition USART (Universal Synchronous/Asynchronous Receiver/Transmitter) is a communic...