Microcontroller Programming (MIP201)
Vietnamese title: Lập trình vi điều khiển
Credits: 3
Prerequisites: PRF192

Description:
Learn how to implement real-world embedded system projects on a simulated microcontroller using the Mbed API.

Modify skeleton code to implement functionality for multiple applications: an audio wave generator, an audio player, and controlling peripherals using analog and digital I/O interfaces, interrupts, timers, and pulse width modulation.

Learn key features of Arm processors and architectures and how a modern API

Learn key serial communication protocols used in the embedded environment including SPI, UARTs and I2C; evaluating their benefits and limitations.
Learn the features of a Real-time Operating System (RTOS) and how it facilitates multitasking in an microcontroller.

Develop working embedded prototypes using the Arm Mbed API, microcontroller on the ST Nucleo F401RE board and low cost parts. Learn hardware and software theory, immediately applied in practice.
Apply your knowledge to create a user interface, temperature sensing system, and music player - with ideas to develop each further.

Apply threads, mutex, semaphores and interrupts to write a fully-functioning multitasking program.
Learn deeper programming skills with C/C++, applying these to use of the powerful Mbed API.
Learn staged circuit development and troubleshooting skills.

Learning outcomes:
Fundamentals of an embedded system and the discovery of Arm architecture and microcontrollers.
Developing working embedded prototypes using the Arm Mbed API, the ST Nucleo F401RE board, and low-cost parts.
Understanding the characteristics of microcontrollers and embedded systems, including their components, benefits, and constraints.
Understanding the industry-standard Arm-based microcontroller architecture, their features, and programming models.
Implementing real-world embedded system projects on a simulated microcontroller using the Mbed API (MbedOS).
Applying knowledge of digital and analog I/O to programming.
Implementing interrupts to control peripherals, utilizing the Mbed API.
Developing an audio player incorporating timers, tickers, and Pulse Width Modulation using the Mbed API.
Evaluating serial communication protocols used in the embedded environment, including SPI, UARTs, and I2C, and their benefits and limitations.
Understanding Real-time Operating System (RTOS) and how it facilitates multitasking in an embedded system.

Student tasks:
- Students must attend at least 80% of contact sessions in order to be accepted to the final examination.
'- Student is responsible to do all exercises and practical given by instructor in class or at home and submit on time. Do quizzes during class.
- Constantly follow announcements on intranet/CMS at http://cms.fpt.edu.vn for up-to-date course information.

Tools:
Specific Tools:
1) Lab equipments/ Training Kits
1.1. Keil Studio Cloud IDE (online free - https://studio.keil.arm.com/ - Main material)
1.2. Mbed Studio (offline free)
1.3. KIT Nucleo-F401RE (STM32F401RE)

2) Simulation software (free)
- Docker desktop
- Arm Education: Mbed_sim ( Arm Cortex-M4 )

Materials:
description: Course from Edx
note: 1. Embedded Systems Essentials with Arm: Getting Started https://learning.edx.org/course/course-v1:ArmEducation+EDARMXES1.6x+3T2020/home
description: Course from Edx
note: 2. Embedded Systems Essentials with Arm: Get Practical with Hardware https://learning.edx.org/course/course-v1:ArmEducationX+EDARMXES2.4x+1T2021/home
description: STM32CubeMX 4 Essential Training
publisher: Udemy.com
note: https://www.udemy.com/course/stm32cubemx-complete-training/learn/lecture/9606338#overview
description: A Beginner’s Guide to Designing Embedded System Applications on Arm Cortex-M Microcontrollers
author: Ariel Lutenberg, Pablo Gomez, Eric Pernia
publisher: ARM Education Media
isbn: 978-1-911531-41-8
note: https://www.arm.com/resources/education/books/designing-embedded-systems

Assessments:
category: Active learning
type: on-going
weight: 10.0
duration: From start to finish in schedule
question_type: All CLOs
note: Supervised by instructor.
Study 02 Couses on edx.
category: Exercise
type: on-going
weight: 10.0
grading_guide: All chapters; knowledge and skills
note: Supervised by instructor
category: Lab
type: on-going
weight: 20.0
question_type: All CLOs
no_question: Mini-project
grading_guide: Lab1: Covering knowledge from Chapter 1 to Chapter 4
Lab2: Covering knowledge from Chapter 4 to Chapter 5
Lab3: Covering knowledge from Chapter 5 to Chapter 6
Lab4: Covering knowledge from Chapter 6 to Chapter 8
Lab5: Covering knowledge from Chapter 5 to Chapter 9
Lab6: Covering knowledge from Chapter 8 to Chapter 10
note: Supervised by instructor
category: Progress test
type: on-going
weight: 10.0
duration: 30' - 40'
question_type: PT1: CLO 1,2,3,4,5
PT2: CLO 5,6,7,8,9,10
no_question: Multiple choice
knowledge_and_skill: 30
grading_guide: PT1: Covering knowledge from Chapter 1 to Chapter 5
PT2: Covering knowledge from Chapter 6 to Chapter 10
note: Supervised by instructor
category: Project
type: on-going
weight: 20.0
duration: From start to finish in schedule
question_type: All CLOs
no_question: Present
grading_guide: All chapters; knowledge and skills
note: Supervised by instructor
category: Final exam
type: Final exam
weight: 30.0
duration: 60'
question_type: All CLOs
no_question: Multiple choice
knowledge_and_skill: 50
grading_guide: All chapters; knowledge and skills
note: by Exam board

Schedule:
session: Course overview
Chapter 1: Introduction To Embedded Systems
1.1. CPUs vs. MCUs vs. Embedded Systems
learning_outcomes: IT
materials: MIP201
session: 1.2. Examples of Embedded Systems
1.3. Options for Building Embedded Systems
learning_outcomes: T
session: 1.4. Features of Embedded Systems
1.5. Building Embedded Systems
learning_outcomes: T
session: Chapter 2: Arm CortexM4 Processor Architecture
2.1. What is Arm architecture?
2.2. Arm processor families
2.3. Arm Cortex-M series
learning_outcomes: T
session: 2.4. Cortex-M4 processor
2.5. Arm processors vs. Arm architectures
2.6. Processor overview
learning_outcomes: T
session: 2.7. Block diagram
2.8. Registers
learning_outcomes: T
session: Lab0_GettingStarted
learning_outcomes: TU
session: Lab0_GettingStarted
learning_outcomes: TU
session: Lab0_GettingStarted
learning_outcomes: TU
session: Chapter 3: Introduction To Arm CortexM4 Programming
3.1. C language vs. assembly language
3.2. Program-generation flow
3.3. Cortex-M4 program image
learning_outcomes: T
session: 3.4. How is data stored in RAM?
3.5. Data types
3.6. Accessing data using C and assembly
learning_outcomes: T
session: 3.7. Calling a C function from assembly
3.8. Calling an assembly function from C
3.9. Embedded assembly
learning_outcomes: T
session: Lab00_GettingStarted_Docker
learning_outcomes: TU
session: Lab00_GettingStarted_Docker
learning_outcomes: TU
session: Lab00_GettingStarted_Docker
learning_outcomes: TU
session: Chapter 4: Introduction To The Mbed Platform And CMSIS
4.1. Mbed Overview
4.2. Mbed and the Internet of Things
learning_outcomes: T
session: 4.3. Overview of Software Libraries
4.4. Mbed OS
4.5. Mbed Software Development Kit
learning_outcomes: T
session: 4.6. Mbed Hardware Development Kit (HDK)
4.7. Cortex Microcontroller Software Interface Standard (CMSIS)
learning_outcomes: T
session: Chapter 5: Digital Input And Output
5.1. Voltages and logic values
5.2. Using pointers to access GPIO
5.3. Define data structure for peripherals
learning_outcomes: T
session: 5.4. DigitalIn/DigitalOut
5.5. BusIn/BusOut
learning_outcomes: T
session: 5.6. Using LED
5.7. Using 7-segment display
5.8. Using infrared emitter/detector
learning_outcomes: T
session: Lab01_Chapter5_DigitalInputAndOutput_HW
learning_outcomes: TU
session: Lab01_Chapter5_DigitalInputAndOutput_HW
learning_outcomes: TU
session: Lab01_Chapter5_DigitalInputAndOutput_HW
learning_outcomes: TU
session: ProccessTest1
learning_outcomes: U
session: Chapter 6: Interrupts And Low Power Features
6.1. Interrupts
What are interrupts?
Why use interrupts?
6.2. Exceptions
Entering an exception handler
Exiting an exception handler
learning_outcomes: T
session: 6.3. Microcontroller interrupts
Lab02_Chapter6_InterruptsAndLowPowerFeatures_Sim
6.4. Timing analysis
6.5. Program design with interrupts
6.6. Sharing data safely between ISRs and other threads
learning_outcomes: T
session: Lab02_Chapter6_InterruptsAndLowPowerFeatures_HW
learning_outcomes: TU
session: Lab02_Chapter6_InterruptsAndLowPowerFeatures_HW
learning_outcomes: TU
session: Lab02_Chapter6_InterruptsAndLowPowerFeatures_HW
learning_outcomes: TU
session: Chapter 7: Analog Input And Output
7.1. Analog input and output overview
7.2. Analog input
Digital-to-analog converter
learning_outcomes: T
session: 7.3. Analog output
7.4. Analog-to-digital converter
ADC range
Resolution and quantization
Sampling frequency
learning_outcomes: T
session: 7.5. Input/output analog signals using Mbed
Mbed analog input
Mbed analog output
Lab03_Chapter7_AnalogInputAndOutput_Sim
learning_outcomes: T
session: Lab03_Module07_AnalogInputAndOutput_HW
learning_outcomes: TU
session: Lab03_Module07_AnalogInputAndOutput_HW
learning_outcomes: TU
session: Lab03_Module07_AnalogInputAndOutput_HW
learning_outcomes: TU
session: Chapter 8: Timer And Pulse Width Modulation
Lab04_Chapter8_TimerAndPulseWidthModulation_Sim
learning_outcomes: T
session: 8.1. Timer and pulse-width modulation (PWM)
Timer overview
Components of a standard timer
Compare mode, capture mode, PWM mode
learning_outcomes: T
session: 8.2. Mbed timer and PWM
Mbed timer
Mbed time ticker
Mbed PWM
learning_outcomes: T
session: Lab04_Module08_TimerAndPulseWidthModulation_HW
learning_outcomes: TU
session: Lab04_Module08_TimerAndPulseWidthModulation_HW
learning_outcomes: TU
session: Lab04_Module08_TimerAndPulseWidthModulation_HW
learning_outcomes: TU
session: Chapter 9: SerialCommunication
9.1. Serial communication overview
Lab05_Chapter9_SerialCommunication_Sim
learning_outcomes: TU
session: 9.2. Universal Asynchronous Receiver/Transmitter (UART) communication
UART protocol
Character-encoding scheme
Mbed UART API
learning_outcomes: T
session: 9.3. Serial Peripheral Interface (SPI) bus
SPI protocol
Mbed SPI API
9.4. I2C bus
I2C protocol
Mbed I2C API
learning_outcomes: T
session: Lab05_Chapter9_SerialCommunication_HW
learning_outcomes: TU
session: Lab05_Chapter9_SerialCommunication_HW
learning_outcomes: TU
session: Lab05_Chapter9_SerialCommunication_HW
learning_outcomes: TU
session: Chapter10: RealTimeOperatingSystems
10.1. Operating System Overview
What is an Operating System?
Functions, types, and services of Operating Systems
learning_outcomes: TU
session: 10.2. Real-Time Operating System (RTOS)
RTOS overview
RTOS task scheduling
Keil RTX RTOS
learning_outcomes: T
session: 10.3. RTOS on Mbed Platform
Mbed RTOS API
Using Mbed RTOS API for your project
Threads, Mutex, and Semaphore
learning_outcomes: T
session: ProccessTest2
learning_outcomes: U
session: Lab06_Chapter10_RealTimeOperatingSystems_HW
learning_outcomes: TU
session: Lab06_Chapter10_RealTimeOperatingSystems_HW
learning_outcomes: TU
session: Project Review
learning_outcomes: U
session: Final report document
learning_outcomes: U
session: Block diagram
Circuit analysis and assembly
learning_outcomes: U
session: Project Review
learning_outcomes: U
session: Presentation
Flowchart
learning_outcomes: U
session: Source code analysis
Demonstration, Q&A
learning_outcomes: U