Skip to content

Experiments ​

Each guide is a step-by-step replacement for the matching chapter of the department manual, written for current STM32CubeIDE. Linked experiments are ready, and the rest are coming soon. Finish the Setup Guide before your first lab.

No.ExperimentTopics
1GPIO, Switch Debouncing and InterruptsGPIO input/output modes, push-pull vs open-drain, EXTI, NVIC, software debouncing with HAL_GetTick()
2LCD, I2C and KeypadHD44780 character LCD, PCF8574 I²C expander, 4×4 matrix keypad scanning from SysTick_Handler
3ADC and Analog Sensor InterfacingADC principles, resolution and sampling time, potentiometer / LDR / temperature sensors, showing readings on the LCD
4Timer Configuration and Output CompareTimer clock tree, prescaler and period, update interrupts, output compare mode, generating a variable frequency
5DC Motor Control and PWMPWM generation, duty cycle and speed, the L298 H-bridge, direction control
6Rotary Encoder InterfaceIncremental encoders, quadrature signals, the timer's encoder mode, computing position and speed
7Stepper Motor ControlFull-step and half-step sequences, the ULN2003 driver, position, speed and direction
8UART ProtocolFraming, baud rate and error, HAL_UART_Transmit / Receive, interrupt-driven reception, a serial terminal
9Bare Metal ProgrammingDriving RCC and GPIO registers directly, no HAL, memory-mapped peripherals, what CubeMX generates for you

INFO

Lab tasks and pre-lab questions are graded by your TA during the session. The Task section at the end of each guide is the work you hand in, not a worked solution.

How each guide is laid out ​

Every page follows the same shape, matching the manual:

  • Objectives and Pre-Lab — what to read and answer before you come in.
  • Theory — the background you need, with the figures from the manual.
  • Materials — what to collect from the lab technician.
  • Relevant HAL APIs — the handful of functions this experiment needs.
  • Procedure — hardware wiring, then CubeMX configuration, then code.
  • After the lab — what to observe and the questions to answer.
  • Task — the hand-in work.

ENCS4101 · Embedded Systems Laboratory