[应用相关] STM32F103C8T6单片机简介

[复制链接]
12941|43
 楼主| 无法去污粉 发表于 2021-8-6 12:51 | 显示全部楼层
了解接线后,可以尝试编译下载。下载软件有很多,ST官方出了Flash Loader Demonstrator软件用于程序下载,国内也有一款FLYMCU的下载软件。
 楼主| 无法去污粉 发表于 2021-8-6 12:52 | 显示全部楼层
 楼主| 无法去污粉 发表于 2021-8-6 12:53 | 显示全部楼层
2.SWD下载

使用SWD接口下载只需要连接3.3V、GND、SWDIO(PA13)、 SWCLK(PA14)、RST(非必要连线),可以从淘宝购买十几块的STLINK下载器。使用SWD接口除了可以烧录程序外,还可以实现在线仿真(debug),仿真过程可以监视寄存器等数据,非常适合软件开发(找问题)。
 楼主| 无法去污粉 发表于 2021-8-6 12:54 | 显示全部楼层
 楼主| 无法去污粉 发表于 2021-8-6 12:54 | 显示全部楼层
3.JTAG下载

JTAG下载会占用PA13、PA14、PA15、PB3、PB4引脚,STM32F103C8T6默认启动JTAG模式,这就是上面所说的为什么这些引脚不能简单的当GPIO用。
 楼主| 无法去污粉 发表于 2021-8-6 12:55 | 显示全部楼层
采用JTAG下载时需要使用JLINK下载器,价格比较昂贵(近100元),能实现的功能SWD差不多也能实现,不推荐这种下载方式。
 楼主| 无法去污粉 发表于 2021-8-6 12:55 | 显示全部楼层
 楼主| 无法去污粉 发表于 2021-8-6 12:56 | 显示全部楼层
如果我们不采用JTAG下载,而且要使用这些引脚做GPIO,那么我们就需要关闭JTAG。比如说我要使用GPIOA15作为GPIO口,那么代码层面需要这样实现:
 楼主| 无法去污粉 发表于 2021-8-6 12:57 | 显示全部楼层
  1. GPIO_InitTypeDef GPIO_InitStructure;
  2.         RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA|RCC_APB2Periph_AFIO,ENABLE);//使能PORTA时钟
  3.         GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable , ENABLE);// 关闭JTAG但使能SWD
  4.         GPIO_InitStructure.GPIO_Pin  = GPIO_Pin_15;//PA15
  5.         GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU; //设置成上拉输入
  6.         GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  7.         GPIO_Init(GPIOA, &GPIO_InitStructure);//初始化GPIO
 楼主| 无法去污粉 发表于 2021-8-6 12:57 | 显示全部楼层
ST公司对STMF103系列单片机的介绍
 楼主| 无法去污粉 发表于 2021-8-6 12:58 | 显示全部楼层
The STM32F103xx medium-density performance line family incorporates the high-performance ARM®Cortex®-M3 32-bit RISC core operating at a 72 MHz frequency, high-speed embedded memories (Flash memory up to 128 Kbytes and SRAM up to 20 Kbytes), and an extensive range of enhanced I/Os and peripherals connected to two APB buses. All devices offer two 12-bit ADCs, three general purpose 16-bit timers plus one PWM timer, as well as standard and advanced communication interfaces: up to two I2Cs and SPIs, three USARTs, an USB and a CAN.

The devices operate from a 2.0 to 3.6 V power supply. They are available in both the –40 to +85 °C temperature range and the –40 to +105 °C extended temperature range. A comprehensive set of power-saving mode allows the design of low-power applications.
The STM32F103xx medium-density performance line family includes devices in six different package types: from 36 pins to 100 pins. Depending on the device chosen, different sets of peripherals are included, the description below gives an overview of the complete range of peripherals proposed in this family.
These features make the STM32F103xx medium-density performance line microcontroller family suitable for a wide range of applications such as motor drives, application control, medical and handheld equipment, PC and gaming peripherals, GPS platforms, industrial applications, PLCs, inverters, printers, scanners, alarm systems, video intercoms, and HVACs.
 楼主| 无法去污粉 发表于 2021-8-6 12:59 | 显示全部楼层
主要特性

ARM®32-bit Cortex®-M3 CPU Core
72 MHz maximum frequency,1.25 DMIPS/MHz (Dhrystone 2.1) performance at 0 wait state memory access
Single-cycle multiplication and hardware division
 楼主| 无法去污粉 发表于 2021-8-6 12:59 | 显示全部楼层
Memories
64 or 128 Kbytes of Flash memory
20 Kbytes of SRAM
 楼主| 无法去污粉 发表于 2021-8-6 13:00 | 显示全部楼层
Clock, reset and supply management
2.0 to 3.6 V application supply and I/Os
POR, PDR, and programmable voltage detector (PVD)
4-to-16 MHz crystal oscillator
Internal 8 MHz factory-trimmed RC
Internal 40 kHz RC
PLL for CPU clock
32 kHz oscillator for RTC with calibration
 楼主| 无法去污粉 发表于 2021-8-6 13:01 | 显示全部楼层
Low-power
Sleep, Stop and Standby modes
VBAT supply for RTC and backup registers
 楼主| 无法去污粉 发表于 2021-8-6 13:01 | 显示全部楼层
2 x 12-bit, 1 μs A/D converters (up to 16 channels)
Conversion range: 0 to 3.6 V
Dual-sample and hold capability
Temperature sensor
 楼主| 无法去污粉 发表于 2021-8-6 13:02 | 显示全部楼层
DMA
7-channel DMA controller
Peripherals supported: timers, ADC, SPIs, I2Cs and USARTs
 楼主| 无法去污粉 发表于 2021-8-6 13:02 | 显示全部楼层
Up to 80 fast I/O ports
26/37/51/80 I/Os, all mappable on 16 external interrupt vectors and almost all 5 V-tolerant
 楼主| 无法去污粉 发表于 2021-8-6 13:03 | 显示全部楼层
Debug mode
Serial wire debug (SWD) & JTAG interfaces
 楼主| 无法去污粉 发表于 2021-8-6 13:04 | 显示全部楼层
7 timers
Three 16-bit timers, each with up to 4 IC/OC/PWM or pulse counter and quadrature (incremental) encoder input
16-bit, motor control PWM timer with dead-time generation and emergency stop
2 watchdog timers (Independent and Window)
SysTick timer 24-bit downcounter
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 在线客服 返回列表 返回顶部