您尚未登录。

楼主 # 2024-09-26 17:13:04

shiinakaze
会员
注册时间: 2024-09-21
已发帖子: 20
积分: 31

微控制器通用应用开发教程

嵌入式系统(embedded system)中常用 microcontroller,所以 microcontroller 在嵌入式系统中称为 MCU (microcontroller unit)。

Development resource

MCU 开发一般指应用开发(application development),比如操作 MCU 外设(GPIO,I2C,SPI 等)。
一般 MCU 开发资源包括 3 个方面:Development Software, Development Tool, Development Document
Development Software
Development Software 一般包含 Software Interface 和 Driver Library,Software Interface 定义了各个 Register,Driver Library 则在 Software Interface 基础上,封装了 MCU peripheral 的基本 Function。
以 STM32 为例:
Software Interface (CMSIS)
software_interface.png

Driver Library (STM32 standard peripheral library)
driver_library.png

Development Tool
一般是配合开发的工具软件,例如 IDE,Development Toolchain (compiler, stdlib),Development Kit,只需了解如何使用即可,参考用户手册。
Development Document
供开发者查询的文档,比如 Datasheet,User Manual,Reference Manual(or Product Specification),Application Note 等。

Development step

在开发一款 MCU 时,需要按照以下步骤进行:
1.首先,查阅 MCU 的 Datasheet 或 Product Specification,它提供了MCU的概览和架构图,这是理解MCU结构的基础。Datasheet 还会详细说明 memory map,general register、peripheral register、ROM、RAM 的地址分配情况。
2.接着,粗略查看 Reference Manual,这个文档详细描述了各个 peripheral register 的功能和地址,并且说明了 peripheral register 如何控制 peripheral 工作。
3.最后,阅读 User Manual,这些手册通常包含有关 Driver library 的文档,介绍 Driver library 的使用方法、各个函数的信息,以及如何调用这些函数。User Manual 可能包含示例代码,帮助你理解如何实际应用这些函数。

Development process

由你编写的 Application Code 将和 MCU Library、Software Interface 一起,被工具链编译成可执行文件(一般格式为 ELF),然后通过 Debugger 下载到 MCU 中。
mcu_development_process.jpg

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn