微控制器开发教程

Microcontroller Development Tutorial

嵌入式系统(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

在这里插入图片描述

Driver Library(legacy)

在这里插入图片描述

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 中。

在这里插入图片描述

  • 8
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值