Endpreise in CHF – Versand inklusive Schweizer Unternehmen · 076 792 63 50 (WhatsApp/SMS)
Kurse › Arduino › Stufe 21
Arduino · Intermediate · Stufe 21 / 40

Under the Hood: AVR Registers, Timers and the Bare Chip

Control the ATmega328P directly through its registers and run it outside a ready-made board.

Intermediate freischalten · CHF 19.90 Stufen 14–26, einmalig, kein Abo

10 Lektionen in dieser Stufe

  1. Navigating the ATmega328P Datasheet and Pin Functions
    Find register descriptions, electrical limits and alternate pin functions quickly. · Lab: Map every UNO header pin to its port bit and alternate functions in a table.
  2. Port Registers: DDRx, PORTx and PINx
    Configure, write and read whole ports and single bits directly. · Lab: Rewrite Blink and a button reader using only port registers.
  3. What digitalWrite Costs: Timing Direct Port Access
    Measure and explain the speed difference between core functions and register writes. · Lab: Toggle a pin both ways and compare frequencies on the logic analyzer.
  4. Timer Hardware: Prescalers, Counters and Compare Units
    Describe how Timer0, Timer1 and Timer2 count and what the core already uses them for. · Lab: Calculate prescaler and compare values for 1 Hz, 1 kHz and 38 kHz.
  5. Generating Precise Frequencies in CTC Mode
    Configure Timer1 to toggle an output pin at an exact frequency without software involvement. · Lab: Produce 1 kHz on pin 9 and verify within the analyzer's resolution.
  6. Custom PWM Frequency and Resolution with Timer1
    Select fast or phase-correct PWM with a chosen top value. · Lab: Generate 20 kHz inaudible motor PWM and 16-bit LED dimming.
  7. Input Capture for Accurate Pulse Timing
    Timestamp edges in hardware to measure period and frequency precisely. · Lab: Measure a signal from 10 Hz to 50 kHz and compare with pulse-counting results.
  8. ADC Registers, Reference Selection and Free-Running Mode
    Set the prescaler, reference and trigger source and read results in an interrupt. · Lab: Sample at a fixed rate with the internal 1.1 V reference and measure the board's own supply voltage.
  9. Writing Interrupt Vectors by Hand
    Enable timer, pin-change and ADC interrupts with ISR blocks and the correct mask bits. · Lab: Replace a pin-change library from level 12 with your own vector code.
  10. Fuses, Bootloader and ISP Programming a Bare ATmega328P
    Read and set fuses carefully, burn a bootloader and upload through an ISP programmer. · Lab: Build a minimal chip circuit on a breadboard, set fuses for the crystal and upload Blink over ISP.

Abschlussprojekt

A breadboard-built ATmega328P signal generator and frequency counter programmed over ISP and written with register-level code only.

Teile für diese Stufe

  • 1 × UNO-compatible board
  • 1 × USB cable matching the board
  • 2 × ATmega328P microcontroller DIP-28
  • 2 × Crystal 16 MHz
  • 4 × Ceramic capacitor 22 picofarad
  • 6 × Ceramic capacitor 100 nanofarad
  • 2 × Resistor 10 kilohm
  • 1 × USBasp-compatible ISP programmer
  • 2 × Solderless breadboard 830 points
  • 1 × Jumper wire set male-male
  • 1 × USB logic analyzer 8 channel
  • 1 × Digital multimeter
  • 4 × LED 5 mm assorted
  • 4 × Resistor 220 ohm
  • 2 × Tactile push button
  • 1 × Potentiometer 10 kilohm
  • 1 × LCD 16x2 with I2C backpack
  • 1 × Passive buzzer

In jeder Lektion legst du die passenden Teile direkt in den Warenkorb. Arduino-kompatibel →

Voraussetzung: Levels 1–20, especially bitwise operations, interrupts, timing and logic analyzer use.

🔒 Sichere Zahlung · 3D Secure 🔐 SSL-verschlüsselt 🚚 Versand in die ganze Schweiz 🇨🇭 Schweizer Unternehmen