NPRG037 - Programování mikrokontrolerů / Microcontroller programming

Informace ke cvičení / Tutorials info

2024/2025 winter term

- The course and tutorial is held in English, 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 built-in LED flash. Any human visible frequency is OK.
-- T3: 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)
-- T4: Blink (1Hz; ASM + Arduino)
     Toggle LED pin at 1Hz frequency. Do it in assembly as well as natively in Arduino (to compare the precision 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 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)
-- T8: puts
     In assembly, write a c/c++ -callable puts function and use it for sending Hello world.
-- T9: blik+watchdog
     After power-on start, let a LED blink at 1 Hz. As long as the user activates the button every now and then, blink like that. Set a reasonable watchdog timeout so that if the user stops pressing the button, the watchdow resets your device. Since that reset, blinking speed should be 2 Hz.

-- (self-pace): Baudrates
     Write a table showing whitch actual Baudrate would be used for defferent USART UBBR values with main clock at 16 MHz.