STM32F103C8T6单片机简介 您所在的位置:网站首页 bcr8km管脚图片 STM32F103C8T6单片机简介

STM32F103C8T6单片机简介

2024-01-03 04:09| 来源: 网络整理| 查看: 265

一、简介

        STM32F103C8T6是一款由意法半导体公司(ST)推出的基于Cortex-M3内核的32位微控制器,硬件采用LQFP48封装,属于ST公司微控制器中的STM32系列。除了被我们熟知的STM32,ST公司还有SPC5X系列、STM8系列等,具体参数如下:

内核Cortex-M3Flash64K x 8bitSRAM20K x 8bitGPIO37个GPIO,分别为PA0-PA15、PB0-PB15、PC13-PC15、PD0-PD1ADC

2个12bit ADC合计12路通道,外部通道:PA0到PA7+PB0到PB1,

内部通道:温度传感器通道ADC_Channel_16和内部参考电压通道ADC_Channel_17

Timers

                        4个16bit定时器/计数器,分别为TIM1、TIM2、TIM3、TIM4

                                TM1带死区插入,常用于产生PWM控制电机

2个看门狗定时器(独立看门狗IWDG、窗口看门狗WWDG)1个24bit向下计数的滴答定时器systick工作电压、温度2V~3.6V、-40°C ~ 85°C通信串口

                                        2*IIC,2*SPI,3*USART,1*CAN

系统时钟内部8MHz时钟HSI最高可倍频到64MHz,外部8MHz时钟HSE最高可倍频到72MHz

        ARM公司在ARM11以后改用Cortex命名,并分成A、R和M三类,M系列有M0、M0+、M3、M4、M7。 Cortex-M3是ARM公司推出的基于ARMv7架构的MCU内核,ST公司在此内核的基础上完成了USART、DMA、GPIO等外围电路的设计。在M系列不同内核开发下的STM32,大致可分成低功耗系列、主流系列、高性能系列3个部分,其具体信息如下图所示:

        相同系列的内核一般相同,如F1系列都采用Cortex-M3内核开发,但根据Flash大小不同可将STM32分成小容量产品(" data-link-title="">,详细的安装与使用教程见《硬汉哥分享的资料》。

        导入源代码后可以在程序中使用以下函数,这些函数根据描述看很容易知道他的作用:

函数名描述SEGGER_RTT_Read()Read data from an input buffer.SEGGER_RTT_Write()Write data to an output buffer.SEGGER_RTT_WriteString()Write a zero-terminated string to an output buffer.SEGGER_RTT_printf()Write a formatted string to an output buffer.SEGGER_RTT_GetKey()Get one character from input buffer 0.SEGGER_RTT_HasKey()Check if a character is available in input buffer 0.SEGGER_RTT_WaitKey()Wait for a character to be available in input buffer 0 and get it.SEGGER_RTT_ConfigUpBuffer()Configure an up (output) buffer.SEGGER_RTT_ConfigDownBuffer()Configure a down (input) buffer.SEGGER_RTT_Init()Initialize RTT Control Block structure when using RAM only targets.SEGGER_RTT_SetTerminal()Set the "virtual" Terminal to use for output on channel 0 via Write and WriteString.SEGGER_RTT_TerminalOut()Send a zero-terminated string via a "virtual" terminal.

         最后,使用RTT需要在电脑上安装J-Link RTT Viewer、J-Link RTT Client、J-Link RTT Logger,这3个终端可以选择自己喜欢的安装使用。 

RTTViewer

七、RTOS

        RTOS(Real-time operating system)是实时操作系统的总称,目前市面上有freeRTOS、RT-Thread、UCOS-III等多种实时操作系统,到了STM32这种复杂而强大的硬件层面,程序员将不再仅仅拿它当传统的MCU来跑裸机程序(裸机是指没有用上RTOS的程序),而是开始考虑程序的协调性和并行多任务(并不是真正意义上的并行,因为单核同一时间只能处理一件事情)。RTOS是一个有趣的东西,如果大家感兴趣我后期会考虑更新一篇有关RTOS的文章,大家目前可以去freeRTOS官网看看或者阅读其他作者的文章。 

八、官网原文介绍

        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.

        主要特性

ARM®32-bit Cortex®-M3 CPU Core 72 MHz maximum frequency,1.25 DMIPS/MHz (Dhrystone 2.1) performance at 0 wait state memory accessSingle-cycle multiplication and hardware divisionMemories 64 or 128 Kbytes of Flash memory20 Kbytes of SRAMClock, reset and supply management 2.0 to 3.6 V application supply and I/OsPOR, PDR, and programmable voltage detector (PVD)4-to-16 MHz crystal oscillatorInternal 8 MHz factory-trimmed RCInternal 40 kHz RCPLL for CPU clock32 kHz oscillator for RTC with calibrationLow-power Sleep, Stop and Standby modesVBAT supply for RTC and backup registers2 x 12-bit, 1 μs A/D converters (up to 16 channels) Conversion range: 0 to 3.6 VDual-sample and hold capabilityTemperature sensorDMA 7-channel DMA controllerPeripherals supported: timers, ADC, SPIs, I2Cs and USARTs 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-tolerantDebug mode Serial wire debug (SWD) & JTAG interfaces7 timers Three 16-bit timers, each with up to 4 IC/OC/PWM or pulse counter and quadrature (incremental) encoder input16-bit, motor control PWM timer with dead-time generation and emergency stop2 watchdog timers (Independent and Window)SysTick timer 24-bit downcounterUp to 9 communication interfaces Up to 2 x I2C interfaces (SMBus/PMBus)Up to 3 USARTs (ISO 7816 interface, LIN, IrDA capability, modem control)Up to 2 SPIs (18 Mbit/s)CAN interface (2.0B Active)USB 2.0 full-speed interfaceCRC calculation unit, 96-bit unique IDPackages are ECOPACK®

九、文章小结

        STM32F103C8T6单片机采用LQFP48封装设计,芯片一共引出44只引脚,其中A口有A0-A15共16个引脚,B口有B0-B15共16个引脚,C口有C13-C15共3个引脚,D口有D0-D1共两个引脚。值得注意的是最小核心板C14和C15接了32.768K晶振,D0和D1接了8MHz晶振,一般不要用做IO口。如果实在要用只能去掉外部晶振电路(使用HSI、LSI),通过重映射和配置AFIO_MAPR寄存器实现。

        其实在学习STC15系列单片机后对STM32单片机一度有恐惧感,STC15F2K60S2单片机的寄存器我觉得已经很多了,STM32那么多寄存器大家是怎么记住的。现在开始学习才了解到官方有出固件库供大家调用,根据推出时间不同可分早期固件库(V3.0.0以下)、标准外设库(点我跳转)、HAL库(点我跳转)、LL库(LL库包含在HAL库里了) 四种。目前最新的标准库版本为V3.5.0,调用官方提供的API进行开发,为ST公司2011年发布,停更已有10年的时间了。使用HAL可进行图形化开发,感官上更加生动形象。不过由于HAL库旨在解决标准库在不同系列单片机上不同通用的问题,其代码执行效率没有标准库高。如果编译器优化等级低,产生HEX文件会比较大。后来ST针对此问题推出了LL库,LL库大多数API函数是直接调用寄存器,提高了代码的执行效率。不过,一般推出的时间越久,我们所能搜集到的资料就越丰富,我目前在学习标准库的开发方式,建议大家根据自身情况做出选择。

        更多资料可上ST公司的中文官网:首页 - STMicroelectronics寻找。

        推荐几个学习论坛:

        1.正点原子:OpenEdv-开源电子网-正点原子论坛

        2.硬石论坛:硬石电子 - 社区

        3.硬汉嵌入式论坛:硬汉嵌入式论坛 - Powered by Discuz!

        4.野火论坛:野火电子论坛 -

        5.51黑电子论坛:51黑电子论坛-单片机 电子制作DIY MCU 嵌入式技术学习

        6.STM32 Arduino:STM32 Arduino-Arduino中文社区 - Powered by Discuz!



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有