====== HW 02 - First program on embedded platform ====== * Get familiar with the HW - [[http://www.st.com/stm32nucleo|NUCLEO]] and especially with the [[http://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-eval-tools/stm32-mcu-eval-tools/stm32-mcu-nucleo/nucleo-f401re.html|NUCLEO-F401RE]] * The description of the board available [[http://www.st.com/resource/en/user_manual/dm00105823.pdf|in one document]]. * With help of [[http://www.st.com/en/development-tools/stm32cubemx.html?icmp=stm32cubemx_pron_pr-stm32cubef2_apr2014&sc=stm32cube-pr2|STM32 CubeMX]] find the correct settings of the clock distribution for NUCLEO STM32F401 - Revision MB1136 C-03 - see [[http://www.st.com/resource/en/user_manual/dm00105823.pdf|chapter 6.7 OSC clock]]. * Propose a concept of the communication protocol structure (list of commands and line endings) - e.g. Standard Commands for Programmable Instruments [[http://www.ivifoundation.org/docs/scpi-99.pdf|(SCPI) interface]]. * Get familiar with the extension board [[https://www.adafruit.com/product/802|802]] and its interconnection with NUCLEO * Write a program for NUCLEO board ==== Homework submission ==== Show to the lab instructor you can: * Compile the test project * Transmit the data between NUCLEO and PC (known serial interface) * Present a report containing: * proposal of the communication protocol - what will be the reply for identification request (e.g. *IDN? command) * list of I/O pins used to control the LED * list of I/O pins used to control and read the state of the button * Determine why the serial line initialization requires multiplication by 3 The result of this homework is a file with code (main.c) for the embedded platform which allows communication between the board and the computer. These parameters of the program will be evaluated: * 1 point - student is able to compile and upload the program to the Nucleo board. * 1 point - student is capable to set a break point in the code, stop the execution of the code on a condition and resume the program operation * 1 point - student will present a list of commands which will be sent from computer to Nucleo with description what these commands will do - it will be written in the comment section of the source code - these commands can be simple characters like 'o' - led on, 'c' - led off, and 'r' - read the state of the button * 1 point - student will present a description of pin IDs and their initialization to control LED and Button - it will be written in the comment section of the source code * 1 point - the program will be able co control the state of the LED based on button e.g. when the button is pressed the LED will switch on and opposite. extra point * 1 point - student will create a report comparing the StdLib and CubeMX HAL libraries, e.g. definition, what they are, what are the differences - it will be written in the comment section of the source code