1- Describe and/or design a lockless circular buffer. It's irrelevant whether you use it for output or input data streams. You must be able to detect overflow and underflow, know how much data was lost, and neither the reader nor the writer should ever block waiting for the peer -- or stop execution of the peer. 2- Imagine you have a single-interrupt system that drives a number of PWM signals: with a 20kHz interrupt we drive 256 light levels for each lamp, thus acheiving 78.1 Hz in the output. This is the code, in the periodic interrupt for (lamp = 0; lamp < ARRAY_SIZE(lamps); lamp++) { if (step == 0) gpio_set(lamps[lamp].gpio, 1); if (step == lamps[lamp].pwm) gpio_set(lamps[lamp].gpio, 0); } step++; step &= 0xff; Please find the important and the trivial bug in the code above, and fix them. 3- In the lamp situation above, when you make a photograp with 50% lighting (or otherwise), the resulting image is striped, because image acquisition lasts for 40ms and 78Hz is 12.8ms. Plesae suggest a way to attack the problem (whether or not the issue can be solved depends on several factors; sure an analogue camera with a real shutter and photographic film wouldn't be affected). 4- In the Cortex-M0, processor status is pushed on the stack and interrupts are disabled until you "return" to special address 0xfffffff9, and that special return address forces the stack to be popped. See page 447 of the user manual for details about the stack frame. This is different from most other processors, where you can touch special CPU status registers to "leave" interrupt mode and jump to your own code (e.g., a new task that preempted what was running before). Please figure how you can implement preemption (i.e. a context switch) and return to the previous task (i.e. the other context switch) with this strange CPU setup. 5- Imagine you are writing your scheduler. Please design diagnostic tools to help you and your mates undestand that the scheduler is working as expected, or that it does not. Please consider both situations where an oscilloscope is available, and those where it is not. 6- We saw how the square wave application written by the main loop stops where the interrupt fires, and saw on the oscilloscope that it takes slightly more than 1us to execute. How would you measure this time if you lacked an oscilloscope? The figure is here: http://hsw2020.gnudd.com/square1.jpg 7- And how would you measure the duration of the interrupt handler itself if you lack an oscilloscope? This is the cyan oscilloscope trace in this image: http://hsw2020.gnudd.com/square2.jpg