Awes0meE / 66CCFF LabXJTLU Undergraduate西交利物浦大学本科生
Back to work返回项目

Tianjin Metro STM32 Foundation Internship天津轨道交通 STM32 基础实习记录

A first embedded-internship trail around STM32F103C8T6: Keil, ST-Link, GPIO, EXTI, timers, PWM, ADC, UART, sensors, and a small metro-environment monitoring demo.第一次嵌入式实习留下的 STM32F103C8T6 学习路线:Keil、ST-Link、GPIO、中断、定时器、PWM、ADC、串口、传感器和一个地铁环境监测小综合。

Timeline时间线
2025.022025.02
Status状态
Completed已完成
Stack技术栈
STM32Rail TransitEmbeddedKeil MDKInternship
Tianjin Metro STM32 Foundation Internship

Project Brief项目简介

这段天津轨道交通相关实习是我第一次比较系统地摸 STM32。起点很基础:Keil 能不能装好,ST-Link 能不能连上,工程能不能编译,程序能不能烧进去,GPIOC13 的 LED 能不能按预期闪。

From there the exercises moved outward: GPIO, EXTI, encoder counting, timers, PWM, UART, ADC, DHT11, OLED, servo output, and finally a small "metro environment monitoring" demo. The title sounds large, but the useful training was lower-level: sensing, timing, output, display, and debugging several peripherals together.

后面才慢慢往外设扩:GPIO、中断、编码器计数、定时器、PWM、串口、ADC、DHT11、OLED、舵机,再拼成一个“地铁环境智能检测系统”的小综合。名字听起来很大,真正有用的是更底层的训练:感知、计时、输出、显示,以及几个外设同时跑时怎么调。

STM32F103C8T6 pinout reference / STM32F103C8T6 引脚定义参考
STM32F103C8T6 pinout referenceSTM32F103C8T6 引脚定义参考

Source Folder源目录里有什么

  • Study_STM32F103C8T6 is the main learning line: basic peripherals, interrupts, timers, PWM, servo control, encoder work, and the metro environment-monitoring demo.
  • STM32 reference material is a learning library: Keil5 MDK, reference manuals, firmware libraries, module notes, slides, and sample projects. Most of it comes from vendors or web sources, so it stays as reference material rather than website content.
  • MG995 vendor material is mainly useful for servo PWM parameters; the page keeps the needed reference image.
  • The internship report explains the route from 2025-02-05 to 2025-02-16. The original file contains personal information, so it stays outside downloads.
  • Control-center manuals, equipment drawings, fault ledgers, installers, firmware libraries, .hex, .o, .crf, and .axf build products stay out of the public folder.
  • Study_STM32F103C8T6 是主线材料:基础外设、中断、定时器、PWM、舵机、编码器,以及地铁环境智能检测系统。
  • STM32相关资料 更像学习资料库:Keil5 MDK、参考文档、固件库、模块资料、课件和例程。里面很多是 vendor 或网络资料,没有整包搬到网站。
  • MG995商家资料 主要用来看舵机 PWM 参数,只抽了必要参考图。
  • 实习报告能说明 2025-02-05 到 2025-02-16 的学习路线,但原文件含个人信息,所以没有作为下载文件公开。
  • 控制中心手册、设备图纸、故障台账、安装包、固件库、.hex.o.crf.axf 等文件没有复制进公开目录。

Learning Route学习路线

The first useful milestone was the smallest development loop: Keil builds, ST-Link flashes, the onboard LED blinks, OLED output appears, and the debugger can show registers and variables. Once that loop worked, later failures became easier to classify as code, flashing, wiring, power, or module timing.

前几天基本是在把最小开发链路跑通:Keil 工程能编译,ST-Link 能下载,板载 LED 能闪,OLED 能显示,调试器里能看到寄存器和变量变化。这个链路稳定以后,后面的故障才更容易分清是代码、下载、接线、供电还是模块时序。

Then the exercises moved from output to input and timing: GPIO modes, EXTI, encoder counting, timers, PWM, UART, ADC, DMA, SPI, I2C, RTC, watchdog, and FreeRTOS basics. In the folder, most topics are separate Keil projects, which fits a short placement better than one polished report.

Then the peripherals started connecting to each other. Buttons and encoders made EXTI and NVIC less abstract; timers moved delays away from empty loops; PWM drove LEDs and servos; ADC read the light sensor; UART and OLED made the data visible. The code was still introductory, but each piece matched something observable on the board.

后面开始把外设往一起接。按钮和编码器让人开始理解 EXTI 和 NVIC;定时器让延时不再只靠空循环;PWM 用来调 LED 和舵机;ADC 读光敏传感器;串口/OLED 用来观察数据。很多代码还很入门,但每一段都能对应到板子上的一个现象。

Small Integration小综合

The most complete project was x-x STM32地铁环境智能检测系统. It put OLED, an LDR light sensor, DHT11, an encoder, TIM3/TIM4, PWM dimming, tricolor LEDs, and a servo into one STM32F103C8T6 project. The project used a metro scenario to hold the exercises together; the actual engineering practice was sensor reading, timed update, external-interrupt input, PWM output, display refresh, and debugging several modules at once.

最完整的工程是 x-x STM32地铁环境智能检测系统。它把 OLED、LDR 光敏传感器、DHT11、编码器、TIM3/TIM4、PWM 调光、三色灯和舵机放在同一个 STM32F103C8T6 工程里。名字里有“地铁环境”,实际训练重点是更底层的:传感器读数、定时更新、外部中断输入、PWM 输出、显示刷新,以及几个模块同时跑时怎么调。

The useful public evidence is kept as small excerpts:

Rail-Control Reading轨道交通阅读

The later report also touched PID, ATP, ATO, and ATS. These concepts sit at a higher level than the STM32 exercises, but they helped connect board-level input/output to a larger control picture: sensor feedback, actuators, speed and position control, automatic protection, and dispatch management.

For me, the useful part was putting microcontrollers, control algorithms, and rail-transit terminology on the same map for the first time.

实习报告后半段还读到 PID、ATP、ATO、ATS 这些词。它们和前面的 STM32 练习不是同一个层级,但能让人把“板子上的输入输出”往系统概念上靠一点:传感器反馈、执行机构、速度/位置控制、自动防护和调度管理分别在什么位置。

对我来说,这部分最有用的是第一次把微控制器、控制算法和轨道交通术语放在同一张图里看。

Looking Back回头看

The part worth keeping is how plain the whole thing was. Set up the environment, blink the LED, read a button, run an interrupt, watch a timer, then connect sensors and a display. There were plenty of small failures: no light, no debugger connection, data jumping around. That is what embedded learning felt like at the start.

Keeping it in the portfolio preserves the first embedded learning trail: starting from one STM32 board, then slowly touching peripherals, control, and the industry context around it.

这段经历最值得保留的地方就是它很朴素。先装环境,点灯,读按键,跑中断,看定时器,再把传感器和显示接起来。中间有很多“不知道为什么不亮”“下载器没连上”“数据跳来跳去”的小问题,但这些正是嵌入式入门真正会遇到的东西。

现在把它放进作品集,是为了留下第一阶段的学习轨迹:从一块 STM32 板子开始,慢慢摸到外设、控制和行业语境。

Development Notes开发笔记

Project notes connected to hardware, firmware, documentation, and archive material.和这个项目相关的硬件、固件、文档和归档笔记。

Open notes archive打开笔记归档

Public Project Files公开项目资料

Uploaded evidence served from the public asset folder. Use the file index to preview documents, source code, media, PDFs, and downloadable artifacts without leaving the page.这里列出已经上传到公开目录的项目证据。可以在左侧索引里选择文件,在右侧直接预览文档、源码、媒体、PDF 和可下载附件。

7 files7 个文件

encoder-servo-speed-excerpt.c

C / 506 B

Open file打开文件
C
// Condensed from Study_STM32F103C8T6 / encoder knob controlled servo example.
// Evidence scope: mapping encoder count to bounded servo speed.

#include "stm32f10x.h"
#include "servo.h"
#include "encoder.h"

int main(void)
{
    int speed = 0;

    servo_init();
    encoder_init();

    while (1) {
        speed = encoder_count * 50;

        if (speed > 500) {
            speed = 500;
        }

        if (speed < -500) {
            speed = -500;
        }

        servo_set_speed(speed);
    }
}

Related Media相关媒体

Images, videos, board renders, and public evidence connected to this project.和这个项目相关的图片、视频、板卡渲染图和公开证据。

Open media gallery打开媒体库