NPRG037 - Programování mikrokontrolerů / Microcontroller programming

Informace ke cvičení / Tutorials info

2025/2026 winter term

- In case non-Czech speaking students enroll, the course is held in English, otherwise in Czech. Questions may be asked in English, Czech, Slovak (and other languages I can understand).
- For programming, we will use Microchip Studio (free download from Microchip website)
- The slides are mostly generic. Sometimes they describe ATmega128 (our recent educational modules are using it) but the principles are same for ATmega328PB.
- This year, we will probably use the "ATmega328PB Xplained Mini" boards first (maybe later replaced by other boards). Therefore, find & fetch the ATmega328PB datasheet + AVR Instruction Set Manual + ATmega328PB Xplained Mini Board documentation (all availabe in PDF at Microchip website)
- If you want to use other AVR based board, discuss it with me in advance and mind the differences.
- Homeworks are to be submitted via SiS. If you miss the class/tutorial, ask about the setup.

Tasks:
-- T1: r1=0
     Find as many ways as you can to zero register r1
-- T2: Blink (any frequency)
     Let the Xplained board built-in LED flash. Any human visible frequency is OK.
-- T3: Blink (1Hz; ASM + Arduino)
     Toggle LED pin at 1Hz frequency sharp. Do it in assembly as well as natively in Arduino (to compare the precision reached). Don't use timers.
-- T4: Blink (fastest; ASM + Arduino)
     Toggle LED pin as fast as possible. Do it in assembly as well as natively in Arduino (to compare the frequency reached)
-- T5: echo 115200 8N1
     Echo whatever you receive via serial line back to serial line (same config for both: 115200 8N1).
-- T6: echo + Hello world
     As previous plus send "Hello world" upon user button press
-- T7: Read and send config
     From within AVR, read all possible config (at least fuses but aim for more) and send it over via serial. Then interpret it (what do all these settings mean?) (this interpretaion can be done manually, no need to implement full parser)