tag 标签: stm32f103c8t6

相关帖子
相关博文
  • 2025-3-28 18:03
    0 个评论
    What is the STM32F103C8T6 Microcontroller
    STM32F103C8T6 is an ARM Cortex-M3 core microcontroller. It has the advantages of high performance, low power consumption and strong scalability, and is widely used in various embedded applications. Today we will introduce relevant information about this chip. STM32F103C8T6Overview TheSTM32F103C8T6is a 32-bit microcontroller based on the Cortex-M3 core manufactured by STMicroelectronics . Its hardware comes in LQFP48 package and tray packaging. The program memory has a capacity of 64 kilobytes, and its speed is 75 hertz. The STM32F103C8T6 device operates from 2.0 V to 3.6 V. It is available over the -40°C to 85°C temperature range and the -40°C to 105°C extended temperature range. It supports multiple communication protocols and buses such as CAN, USB, Ethernet, etc., and can easily communicate with other devices. In addition, it supports a variety of timers and counters, as well as various analog and digital conversion functions, which can be used to implement complex control algorithms. Alternatives and Equivalents • STM32F103C8T6TR • STM32F103C8T7TR What Are the Features ofSTM32F103C8T6? • It features seven distinct timers tailored to various analog signal sampling rates. • Phase-locked loop (PLL) clocks achieve stability by phasing the output and input signals. • Three different boot options (via user flash or system memory or SRAM) via USART1 reassembly of flash memory. • A windowed watchdog timer for observing signal reception and transmission errors. • Cyclic Redundancy Check (CRC) to monitor data corruption. • JTAG (Joint Test Action Group) serial protocol for debugging and testing microcontroller units. Programming ofSTM32F103C8T6 First, we need to create a development environment suitable for STM32F103C8T6 programming. The following are some commonly used development tools and software. • ST-Link/V2 ST-Link/V2 is a debugging and programming tool provided by STMicroelectronics. It can communicate with STM32F103C8T6 through the SWD interface and supports debugging and burning programs. • STM32CubeMX STM32CubeMX is a graphical configuration tool provided by STMicroelectronics for generating initialization code and configuring peripherals. It can help us quickly set pin mapping, clock configuration and other peripheral parameters. • Keil MDK Keil MDK is an integrated development environment (IDE) specifically used for the development of ARM microcontrollers. It provides powerful editing, debugging and compilation functions, and is compatible with STM32F103C8T6. After installing the above tools, we can start programming the STM32F103C8T6. There are currently two ways to program theSTM32F103C8T6development board, namely the STLink USB dongle or an external USB or serial converter. While there are many compiler options and IDEs available for writing program and flash code to the STM32F10C8T6 Blue Pill, these are the two most popular and easy-to-use compilers. In addition, Kiel/CubeMX and STLink software are also used to compile and upload programs, which is done through a single-wire debugging interface. This interface is designed specifically for ARM cores and is used for transfer and memory access. What Is the Difference BetweenSTM32F103C8T6and CH32F103C8T6? STM32F103C8T6 and CH32F103C8T6 are both microprocessors. They have the following differences. Brand: TheSTM32F103C8T6is manufactured by STMicroelectronics , while the CH32F103C8T6 is manufactured by Tao Yun Microelectronics, a Chinese company. Voltage: In terms of voltage, both support a voltage range of 1.8V to 3.6V, but the CH32F103C8T6 transistor has a wider input voltage range, from -0.5V to 5.5V. Clock frequency: The clock frequency of STM32F103C8T6 can reach 72MHz, while the clock frequency of CH32F103C8T6 can only reach 48MHz. This shows that the processing speed of STM32F103C8T6 is much higher than that of CH32F103C8T6. Storage: Both the STM32F103C8T6 and the CH32F103C8T6 have the same flash memory size of 64KB. However, in terms of memory, there is a big difference between the STM32F103C8T6 and the CH32F103C8T6. the STM32F103C8T6 has a SRAM memory of 20KB, while the CH32F103C8T6 has an SRAM memory of only 10KB. this means that the STM32F103C8T6 can handle large amounts of data more smoothly without lagging. This means that the STM32F103C8T6 can handle large amounts of data more smoothly without lagging. Application: In scenarios with higher performance requirements, such as automatic control equipment, medical equipment and other fields, STM32F103C8T6 will perform better. For ordinary embedded applications, such as smart homes, smart door locks, etc., CH32F103C8T6 is also a good choice because of its low price, high reliability, low power consumption, and complete functions. Decoupling Circuit ofSTM32F103C8T6 Placing a 104 (0.1μF) capacitor on the power supply pin effectively suppresses power supply noise. Simply put, this is like "decoupling" the power supply noise. "Power - capacitor - ground" the closer the distance between the three, the better the decoupling effect. In practice, we can use capacitors of the same material. Even if the capacitance is reduced to one-tenth of the original, the decoupling effect will not change significantly. For high-frequency decoupling, we recommend the use of the same package form of the device, the capacitance value of 0.01μF, 0.1μF or 1μF can be selected. In addition, the chip (SMD) package capacitors compared to the perforated package better, because the perforated capacitor pin equivalent inductance is larger, which will affect the decoupling effect. Several Working Modes of STM32F103C8T6 Microcontroller STM32F103C8T6has four working modes, namely operation mode, sleep mode, stop mode and standby mode. Operation Mode When theSTM32F103C8T6is reset after power-on, it is in operation mode. In this case, the microcontroller automatically runs the program. When we don't need the core to run, we can choose to put the chip into three modes: sleep, stop and standby. Sleep Mode When theSTM32F103C8T6is running, the core will stop the internal clock and program execution when it encounters a wait for interrupt (WFE) or wait for event (WFI) instruction. Although the Cortex-M3 stopped working, its peripherals continued to work. Until a peripheral generates an event or interrupt, the core will be awakened and exit sleep mode. In sleep mode, it only turns off the core clock, but its on-chip peripherals and the peripherals of the Cortex-M3 core still operate as usual. Stop Mode If the user sets the SLEEPDEEP bit in the Cortex_PCR of the Cortex-M3 processor, and then clears the PDDS (Power Down Deep Sleep) bit in the STM32 PCR, theSTM32F103C8T6stop mode setting is completed. When the shutdown mode is set, the CPU will stop working once it encounters a WFI or WFE instruction, and HSI and HSE will also enter the shutdown state, but the Flash and SRAM will continue to maintain power supply. Therefore, all working states of STM32F103C8T6 are still retained at this time. Stop mode, like sleep mode, can also be woken up by peripheral interrupts. However, in stop mode, the clocks of all devices are disabled except for the external interrupt control unit. STM32 can only wake up the device in the shutdown state by triggering an external interrupt by generating a level edge on the GPIO pin. It should be noted that the external interrupt channel is not only connected to the GPIO, but also connected to the alarm event of the RTC clock. In addition, the counting clock of the RTC does not come from the device bus of the STM32F103C8T6 (but directly from the LSI or LSE), so we can also use the RTC module to wake up theSTM32F103C8T6from the shutdown state regularly. Standby Mode If we set the SLEEP bit in the STM32F103C8T6 power control register, and then set the PDDS bit in STM32_PCR, the microcontroller will enter standby mode. To wake up from standby mode, there are many ways, including RTC alarm event, NRST external pin reset, reset signal generated by the independent watchdog (IWDG), and using the rising edge generated by the PA0 pin to wake up the microcontroller. When entering standby mode, all SRAM data, Cortex-M3 processor registers and STM32F103C8T6 register contents will be cleared, and the effect is equivalent to a hardware reset.
  • 热度 31
    2020-11-9 13:04
    2684 次阅读|
    0 个评论
    关键词:Modbus FreeModbus STM32F103C8T6 CubeMX 1.开发环境 (1)STM32CubeMX,版本:4.27.0,截止写稿时,最新版本已到6,但孔丙火(微信公众号:孔丙火)实在是用不习惯版本5以后的界面,所以还继续用4版本的。 图1 (2)MDK(Keil),版本:5.17,有部分朋友用的还是4版本的,建议升级到5,在5下装一个兼容包,就可以用5打开4版本的程序。 2.时钟及串口初始化 (1)新建CubeMX工程 孔丙火(微信公众号:孔丙火)认为,这一步比较简单,点击初始界面中的New Project,在后面出现的配置窗口中,按照图2搜索STM32F103C8,选择这个器件,然后点击Start Project就可以了。 图2 然后就到了图3的配置界面,红框部分跟图中配置一样即可。左侧红框选择后,右边红框的部分会自动出来。TIM2用来做RTU的3.5字符周期的定时,下一节孔丙火(微信公众号:孔丙火)会详细讲解。 图3 单片机、ARM、现场总线、PLC、嵌入式软硬件的设计经验分享,秉承“点点滴滴皆智慧”的理念,一起分享,共同交流。
  • 热度 23
    2020-11-7 09:15
    3115 次阅读|
    0 个评论
    关键词:Modbus FreeModbus STM32F103C8T6 CubeMX 只有串口通信的话,硬件设计相对简单,孔丙火(微信公众号:孔丙火)认为,大体可以分为3个部分:单片机、电源部分和485部分,分别如图1、图2和图3所示。 图1 图2 图3 单片机采用STM32F103C8T6,从孔丙火(微信公众号:孔丙火)的认知来看,这款单片机是当前比较常用的型号之一。UART1用过ISP下载和串口打印,UART2用于RS485通信,整块板子采用DC5V供电,通过AMIS1117转换成3.3V给单片机供电,RS485采用隔离设计,隔离电源采用IB0505S-W75R3,隔离电压是1500VDC,485信号转换及隔离采用ADM2483BRWZ。在单片机部分加一个外部看门狗SP706SEN,同时具备供电电源监控功能,单片机供电电源低于2.93V时会复位单片机。单片机留有SWD接口,用于程序调试。由于IB0505S-W75R3的负载范围是10%-100%,为了保证电源的稳定,孔丙火(微信公众号:孔丙火)在输出端加了一个R8的死负载。ADM2483BRWZ内部采用磁隔离设计,虽然成本高一些,但电路设计简单,也可以节省PCB面积。 单片机、ARM、现场总线、PLC、嵌入式软硬件的设计经验分享,秉承“点点滴滴皆智慧”的理念,一起分享,共同交流。
  • 热度 30
    2020-10-17 18:41
    2091 次阅读|
    0 个评论
    STM32F103C8T6、FreeModbus从站的设计与测试(1)——引言 关键词:Modbus FreeModbus STM32F103C8T6 CubeMX 在国内的工业控制系统和传感器中,Modbus总线是很常见的,主要原因是其硬件设计简单、通信流程简洁、易于软件实现,Modbus总线最初是由德国的Modicon(莫迪康)公司的提出的,已有几十年的历史,现已成为国际标准。 孔丙火(微信公众号:孔丙火)认为,如果我们仅仅是使用Modbus总线,比如使用带有Modbus通信接口的PLC,则只需要关注Modbus的通信格式即可,如从站地址、功能码、通信超时参数等,而如果我们开发一块带有Modbus接口的控制板或者传感器,则需要关注Modbus通信协议的内部实现方法。 Modbus总线的物理层实现有两种:工业以太网和串口,工业以太网使用的Modbus-TCP协议,串口使用Modbus-RTU和Modbus-ASCII协议。串口是最常用的一种通信方式,那孔丙火(微信公众号:孔丙火)就来说它。 单片机上都有通用异步收发串口(UART),一个或多个,在硬件上,只需要加一个RS485或RS232的电平转换,即可实现工业串口通信。因此,只要我们在UART收发准确的基础上,按照Modbus标准编写通信协议,即可实现单片机的Modbus通信,想想是不难的,但工业通信不仅要实现功能,还要确保稳定,自己编写源码去实现一个通信协议,并不是一个最优方案,性价比不高,还有一种方法,是采用成熟的协议栈实现,成熟的协议栈有专门的组织维护,大量的使用,也更容易发现bug。当然,孔丙火(微信公众号:孔丙火)认为,对于程序猿或攻城狮来说,有免费的成熟的协议栈就更完美了,而FreeModbus协议栈就满足这个要求,然而美中不足,它只支持从站协议,主站协议是要收费的,不过已经很好了,知足常乐。 那么,孔丙火(微信公众号:孔丙火)的主题来了,用FreeModbus协议栈实现一个基于串口通信的Modbus从站,采用什么单片机呢,这个可以随便选,只要有一个UART接口就可以,那就选一个常用的,意法半导体的STM32F103C8T6,Cortex-M3的内核,片上资源对于Modbus协议来说也足够。孔丙火(微信公众号:孔丙火)在网上也查看了一些STM32F103移植FreeModbus的资料,总感觉不清晰,看起来有点费劲,可能是我的水平太差吧,所以在一次开发Modbus从站的过程中,想着整理一下开发心得,目的是对正在开发Modbus的朋友有一些帮助,少走一些弯路,另外,网上缺乏一些对Modbus协议测试的文章,我也把相关的心得写出来,包括各种功能码的测试、错误码的测试等。 意法半导体的单片机,在开发时可以使用CubeMX,生成初始化代码,可以为新手朋友节省不少开发时间,孔丙火(微信公众号:孔丙火)认为,这是意法半导体的一个优势,当然,ST的单片机使用量很大,且网上的资料多,易于学习。 单片机、ARM、现场总线、PLC、嵌入式软硬件的设计经验分享,秉承“点点滴滴皆智慧”的理念,一起分享,共同交流。 关注公众号,欣赏更多精彩文章。
相关资源