STM32 MCUs Products

cancel
Showing results for 
Search instead for 
Did you mean: 

Forum Posts

Resolved! How to initialize and use TIM2 for output compare?

I am using the STM32F303CB controller.System Clock - 72MHz APB1ENR - 72MHz for TimerI followed the below steps as per the reference manual.Timer2 Initialization: RCC->APB1ENR|= RCC_APB1ENR_TIM2EN;   TIM2->ARR = 72000-1;   TIM2->CCR1= 4000;   TIM2->...

It always work ok for RTC. But sometimes HAL_RTC_MspInit retrun me HAL_TIMEOUT, which case would cause this error? I did not change my hardware and firmware for RTC, I use the internal clock for rtc.

It will occur @here: /** @addtogroup RTC_Private_Functions * @{ *//** * @brief Enter the RTC Initialization mode. * @note  The RTC Initialization mode is write protected, use the *     __HAL_RTC_WRITEPROTECTION_DISABLE() before calling this function....

ZXiao.1 by Associate II
  • 791 Views
  • 4 replies
  • 0 kudos

Resolved! Can a Timer Capture Compare be skipped if needed?

I'm using a Timer (TIM8) in a capture compare application for measuring timing between signals. In some cases I don't need the value so I have been skipping the read of the CCRx register. I'm using a HAL command as the code below shows:The HAL_TIM_R...

BTrem.1 by Senior II
  • 482 Views
  • 2 replies
  • 0 kudos

How to read VBATT Voltage from ADC

I Am using STM32F303CB.I want to read the VBATT voltage from ADC1_IN17 as VBATT is connected to ADC1 channel 17.Here my Code:void ADC1_Init(){   RCC->CFGR2 |= RCC_CFGR2_ADCPRE12_DIV1;   RCC->AHBENR |= RCC_AHBENR_ADC12EN;   RCC->AHBENR |= RCC_AHBENR_G...

Structure in bit band region

Hi, I have this very simple code that sets generic flags to the desired value:struct GenFlgStr{ uint8_t F1 : 1; uint8_t F2 : 1; uint8_t f3 : 1;};struct GenFlgStr GenFlg;main{ GenFlg.F1=1; GenFlg.F2=0;}----------------------------------------...