Embedded Systems Take home final exam, total 3 questions due date Sunday 2 May 2021 1) Multitask Operating System Assume you have MOS. Here is a program that run two processes. What does it do? (explain the intention of this program) What will appear on the screen? (just show the output of "print()"). ----- begin --------- // function prototype process1() process2() main() di(0) settimer0(120) qindex = 0 qend = 0 nump = 0 p = createp(&process1) p = createp(&process2) boot() // ------------- applications ---------- cnt1, cnt2 delay() asm("nop") . . . process1() cnt1 = 0 while( cnt1 < 10 ) cnt1 = cnt1 + 1 print(cnt1) delay() terminate() process2() cnt2 = 100 while( cnt2 < 110 ) cnt2 = cnt2 + 1 print(cnt2) delay() terminate() ----------------- 2) Embedded communication I2C 2.1 Explain I2C, not more than one page. 2.2 Give a program in Arduino, to "send" two bytes to an I2C device on the bus. ----------------- 3) Implement (on a paper) an Arduino experiment on IoT board. The last RTC experiment (shown in a video) uses interrupt to "read" the real-time-clock chip. It does not conserve battery as it uses "polling" (the while loop) to "know" that an interrupt occurs. Now, use IoT board, design and write a small program to run the same experiment using interrupt AND save battery. You can "assume" that you have API similar to Arduino program. You don't have to write "in detail" about send/receive data from RTC. But, you have to show a scheme how to write interrupt service routine and main loop that run the clock properly and save battery. ----------- end -------------------