# NPRG037 - Programování mikrokontrolerů / Microcontroller programming

Winter term 2023/24 Class Friday 9:00 N10, Tutorials Friday 10:40 N10

Na přednášce a cvičení se podíváme na moderní mikrokontrolerové platformy jako jsou Arduino, Micro:bit, Raspberry Pi Pico apod. Kromě základního použití se zvolenou platformou budeme zabývat podrobněji (co je v pozadí, jak to funguje atd.), na cvičeních je prakticky budeme používat.
In the course, modern microcontroller platforms (like Arduino, Micro:bit, Raspberry Pi Pico and/or similar) are explored. Besides basic use, we will concern more on one such platform - what is behind, how it works etc. The platform will be used practically on the tutorials.

Kurs se průběžně mění podle novinek v oboru.
The course evolves based on advances in the branch.

In case non-Czech speaking students enroll, the course is held in English, otherwise in Czech.

Current slides:
will be gradually added as we proceed and also when changed from previous years
if a link is dead, either I have pulled that down intentionally for being obsolete, or it is some error, so notify me. A few links (last "homework" - watch these): Tutorials / tasks / homeworks:
Default due date: before next tutorial session.
• T1: r1=0
Write as many ways as you can how to make register r1 to be zero
• T2: "if" construct
Write in assembly a snippet of code equivalent of the following C/C++ construct:
```    if( r1 == r0 )
A();
else
B();
C();
```
• T3: Light up the LED at B5
Immediately after reset, just light up the LED connected to B5.
(not to be submitted to SIS)
• T4: LED blink at B5
After the start, blink the LED indefinitely.
Blinking frequency is not defined - any frequency will do as long as one can notice it by eye.
Calculate the frequency by analysing your code and write the explanation.
At user button press, toggle the frequency between two noticeably different values.
• T7: Hello world via USART
At user button press, send "Hello World." via USART (add new line too)
• T8: LED blinking via timer + Hello world via USART
At user button press, send "Hello World." via USART (add new line too)
Set timer and interrupt routine to blink LED at 4 Hz, independent on the button reaction
• T9: Read fuses and serial number, send over via USART, interpret the fuses
Read fuses and serial number from your program and send it over via USART
Write interpretation of the fuses in text, not using "internet fuse calculator"
• T10: Read temperature, send over via USART
Periodically read internal temperature and send it over via USART
In your code, describe what you send and when
• T11: C-callable serial_init and puts
serial_init - initialize UART, pass all needed arguments
puts - send a string via serial; how is the string stored?
• T12: Watchdog
blink LED, change frequency after watchdog reset