Programming Microcontrollers in C++
Description: The discipline is devoted to the study of the basics of structural and modular programming in C++, program structure for ATmega microcontrollers, modern integrated software development environments, as well as the Arduino IDE for creating and loading programs on Arduino-compatible boards.
Amount of credits: 5
Пререквизиты:
- Mathematics 1
Course Workload:
| Types of classes | hours |
|---|---|
| Lectures | 15 |
| Practical works | |
| Laboratory works | 30 |
| SAWTG (Student Autonomous Work under Teacher Guidance) | 30 |
| SAW (Student autonomous work) | 75 |
| Form of final control | Exam |
| Final assessment method | written exam |
Component: University component
Cycle: Base disciplines
Goal
- formation of theoretical knowledge and practical skills in the field of C++ programming of electronic devices of automated control systems based on microprocessor controllers.
Objective
- - study of programming languages, software engineering technologies;
- - mastering the basics of structural and modular programming in C++;
- - mastering of modern integrated software development environments;
- - acquisition of skills of software development of microcontrollers of ATmega family;
- - formation of skills of software control of electronic devices of automation systems, made on the basis of microcontroller boards.
Learning outcome: knowledge and understanding
- select tool and debugging means of development and simulation when creating software for electronic devices and devices of automation systems based on microprocessor controllers;
Learning outcome: applying knowledge and understanding
- apply technologies of structural and modular programming in C++ language when developing software for microprocessor controllers of control systems;
Learning outcome: formation of judgments
- organise the process of development and implementation of software complexes of automated control systems for various production facilities;
Learning outcome: communicative abilities
- of the proposed project solution in the field of organisation of works on development and operation of microprocessor complexes in automation systems, both for specialists and non-specialists;
Learning outcome: learning skills or learning abilities
- master the C++ programming language for the development and operation of software for automated control systems.
Teaching methods
interactive lecture (application of the following active forms of learning: guided (guided) discussion or conversation; moderation; demonstration of slides or educational films; motivational speech);
information and communication (computer class with the use of professional application packages);
search and research (independent research activity of students in the learning process).
Assessment of the student's knowledge
Teacher oversees various tasks related to ongoing assessment and determines students' current performance twice during each academic period. Ratings 1 and 2 are formulated based on the outcomes of this ongoing assessment. The student's learning achievements are assessed using a 100-point scale, and the final grades P1 and P2 are calculated as the average of their ongoing performance evaluations. The teacher evaluates the student's work throughout the academic period in alignment with the assignment submission schedule for the discipline. The assessment system may incorporate a mix of written and oral, group and individual formats.
| Period | Type of task | Total |
|---|---|---|
| 1 rating | "Installing the software, downloading Blink" PW | 0-100 |
| "GPIO control, blinking" PW | ||
| "Button reading, software debounce" PW | ||
| "Connecting the photoresistor, outputting values" PW | ||
| "PWM to LED, brightness control" PW | ||
| "Steering angle control" PW | ||
| "Debugging via Serial Monitor" PW | ||
| 2 rating | "Working with a TMP102 or similar sensor" PW | 0-100 |
| "Data reading, SPI setting" PW | ||
| "Display of text, temperature, sensor status" PW | ||
| "Menu with buttons, navigating through items" PW | ||
| "Reacting to events without questioning" PW | ||
| "Control of LEDs by states" PW | ||
| "Project: thermometer, alarm clock, robot, etc." PW | ||
| "Assembly, debugging, demonstration" PW | ||
| Total control | Exam | 0-100 |
The evaluating policy of learning outcomes by work type
| Type of task | 90-100 | 70-89 | 50-69 | 0-49 |
|---|---|---|---|---|
| Excellent | Good | Satisfactory | Unsatisfactory | |
| Checklist interview | Demonstrates systematic theoretical knowledge, mastery of terminology, logically and consistently explains the essence of phenomena and processes, makes reasoned conclusions and generalisations, gives examples, shows fluent monological speech and ability to quickly respond to clarifying questions | Demonstrates solid theoretical knowledge, knows the terminology, logically and consistently explains the essence of phenomena and processes, makes reasoned conclusions and generalisations, gives examples, shows fluent monologic speech, but makes minor errors that are corrected independently or with minor correction by the teacher. | Demonstrates shallow theoretical knowledge, shows poorly formed skills of analysing phenomena and processes, insufficient ability to make reasoned conclusions and give examples, shows insufficient fluency in monological speech, terminology, logic and consistency of presentation, makes mistakes that can be corrected only when corrected by the teacher. | Demonstrates systematic theoretical knowledge, mastery of terminology, logically and consistently explains the essence of phenomena and processes, makes reasoned conclusions and generalisations, gives examples, shows fluent monological speech and ability to quickly respond to clarifying questions |
| Working in practical classes | Completed the work in full with observance of the necessary sequence of actions; the report is drawn up in accordance with the requirements; correctly analyses errors. When answering questions, correctly understands the essence of the question, gives a precise definition and interpretation of the main concepts; accompanies the answer with new examples, is able to apply knowledge in a new situation; can establish a connection between the studied and previously studied material, as well as with the material learnt during the study of other disciplines. | Performed the work on the requirement for evaluation "5", but admitted 2-3 shortcomings. The student's answer to the questions meets the basic requirements for the answer to 5, but is given without applying knowledge in a new situation, without using links with previously studied material and material learnt in the study of other disciplines, made one mistake or no more than two flaws, the student can correct them independently or with a little help from the teacher. | Performed the work is not complete, but not less than 50% of the volume, which allows to obtain the correct results and conclusions; in the course of the work were made mistakes. When answering questions, the student correctly understands the essence of the question, but in the answer there are some problems in mastering the issues of the course, not preventing further learning of the programme material; made no more than one gross error and two flaws. | Completed the work in full with observance of the necessary sequence of actions; the report is drawn up in accordance with the requirements; correctly analyses errors. When answering questions, correctly understands the essence of the question, gives a precise definition and interpretation of the main concepts; accompanies the answer with new examples, is able to apply knowledge in a new situation; can establish a connection between the studied and previously studied material, as well as with the material learnt during the study of other disciplines. |
| Midterm Examination | Midterm Examination: 90-100 points - demonstrated knowledge at a high level | Midterm Examination: 70-90 points - knowledge at the basic level is demonstrated | Midterm Examination: 50-70 points - demonstrated knowledge at a satisfactory level | Midterm Examination: 90-100 points - demonstrated knowledge at a high level |
Evaluation form
The student's final grade in the course is calculated on a 100 point grading scale, it includes:
- 40% of the examination result;
- 60% of current control result.
The final grade is calculated by the formula:
| FG = 0,6 | MT1+MT2 | +0,4E |
| 2 |
Where Midterm 1, Midterm 2are digital equivalents of the grades of Midterm 1 and 2;
E is a digital equivalent of the exam grade.
Final alphabetical grade and its equivalent in points:
The letter grading system for students' academic achievements, corresponding to the numerical equivalent on a four-point scale:
| Alphabetical grade | Numerical value | Points (%) | Traditional grade |
|---|---|---|---|
| A | 4.0 | 95-100 | Excellent |
| A- | 3.67 | 90-94 | |
| B+ | 3.33 | 85-89 | Good |
| B | 3.0 | 80-84 | |
| B- | 2.67 | 75-79 | |
| C+ | 2.33 | 70-74 | |
| C | 2.0 | 65-69 | Satisfactory |
| C- | 1.67 | 60-64 | |
| D+ | 1.33 | 55-59 | |
| D | 1.0 | 50-54 | |
| FX | 0.5 | 25-49 | Unsatisfactory |
| F | 0 | 0-24 |
Topics of lectures
- Introduction to microcontrollers and embedded systems
- C++ language for embedded programming
- Architecture of the ATmega328P
- Arduino IDE and sketch structure
- Fundamentals of digital I/O
- Working with analogue signals
- Timers and interrupts
- Working with UART
- Working with I2C
- Working with SPI
- Operation with external sensors
- Working with displays and LCDs
- Communication protocols and interfaces
- Design of control systems
- Embedded software architecture in C++
Key reading
- 1. Banford, S. "Programming for Arduino. Fundamentals and Examples", DMK Press, 2020
- 2. Blank, M."Arduino for beginners", Peter, 2021
- 3. Arduino website: https://www.arduino.cc
- 4. Datasheet ATmega328P: https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-42735-8-bit-AVR-Microcontroller-ATmega328-328P_Datasheet.pdf
Further reading
- Alexey Vasiliev, "Arduino. Practicum on device development", BKHV-Petersburg, 2020
- 2. John Morton, "AVR: An Introduction to C and Assembly Language Programming", Springer, 2013
- 3. Jack Purdum, "Beginning C for Arduino", Apress, 2015
- 4. Тимур Шемсединов, "Ендірілген жүйе бағдарламашыларына арналған заманауи C++", O’Reilly, 2022