博文

目前显示的是标签为“STM32F1”的博文

Is there a bug in the hardware I2C of STM32F103RCT6?

图片
 The STM32F103RCT6 , part of the STM32F1 series, does have known hardware issues with the I2C peripheral , especially in early silicon revisions. These issues are well-documented in the ST errata sheets .  Known I2C Issues in STM32F103RCT6 From the STM32F103xC/D/E errata sheet , here are some notable I2C-related bugs : 1. I2C Busy Flag Stuck (BSY bit never cleared) Issue : If a communication is interrupted (e.g., by a reset or a glitch), the I2C peripheral can think the bus is still busy. Impact : The I2C_SR2.BSY bit stays high indefinitely, preventing further communication. Workaround : You must manually reset the I2C peripheral and reinitialize it . 2. Failure to Detect Stop Condition Issue : Under some conditions, the STOP condition is not correctly detected by the I2C hardware. Impact : The I2C peripheral might hang or misbehave after repeated communications. Workaround : Often handled by carefully placing delays and confirming the STOP bit in s...

How do you set up ADC (Analog-to-Digital Converter) in STM32?

图片
  Setting up the   ADC (Analog-to-Digital Converter)   in an STM32 microcontroller involves configuring the ADC peripheral to read analog signals from one or more input channels and convert them into digital values. STM32 microcontrollers have highly flexible ADC peripherals, and the setup process can vary slightly depending on the specific STM32 series (e.g., STM32F1 , STM32F4 , STM32H7 ). Below is a general guide to setting up the ADC in STM32 using   STM32CubeMX   and   HAL (Hardware Abstraction Layer)   libraries. 1.  Hardware Setup Connect the analog signal source (e.g., a sensor or potentiometer) to the ADC input pin on the STM32. Ensure the analog signal voltage is within the ADC's input range (typically 0V to 3.3V for most STM32 devices). 2.  Software Setup Using STM32CubeMX STM32CubeMX is a graphical tool provided by STMicroelectronics to configure STM32 peripherals and generate initialization code. Steps: Open STM32CubeMX: Create...