boots.zip
大小:6.53MB
价格:38积分
下载量:0
评分:
5.0
上传者:酒旗&风暖
更新日期:2025-09-22

基于STM32的Boost电路(最简单的Boost电路)代码

资源文件列表(大概)

文件名
大小
boots/
-
boots/DebugConfig/
-
boots/DebugConfig/Target_1_STM32F103C8_1.0.0.dbgconf
2.35KB
boots/EventRecorderStub.scvd
339B
boots/Hardware/
-
boots/Hardware/AD.c
3.04KB
boots/Hardware/AD.h
127B
boots/Hardware/Key.c
1.33KB
boots/Hardware/Key.h
95B
boots/Hardware/LED.c
2.53KB
boots/Hardware/LED.h
200B
boots/Hardware/OLED.c
7.72KB
boots/Hardware/OLED.h
567B
boots/Hardware/OLED_Font.h
8.94KB
boots/Hardware/PWM.c
1.64KB
boots/Hardware/PWM.h
372B
boots/keilkill.bat
399B
boots/Library/
-
boots/Library/misc.c
6.88KB
boots/Library/misc.h
8.77KB
boots/Library/stm32f10x_adc.c
46.09KB
boots/Library/stm32f10x_adc.h
21.18KB
boots/Library/stm32f10x_bkp.c
8.26KB
boots/Library/stm32f10x_bkp.h
7.38KB
boots/Library/stm32f10x_can.c
44.05KB
boots/Library/stm32f10x_can.h
26.91KB
boots/Library/stm32f10x_cec.c
11.38KB
boots/Library/stm32f10x_cec.h
6.42KB
boots/Library/stm32f10x_crc.c
3.27KB
boots/Library/stm32f10x_crc.h
2.11KB
boots/Library/stm32f10x_dac.c
18.64KB
boots/Library/stm32f10x_dac.h
14.88KB
boots/Library/stm32f10x_dbgmcu.c
5.03KB
boots/Library/stm32f10x_dbgmcu.h
3.73KB
boots/Library/stm32f10x_dma.c
28.91KB
boots/Library/stm32f10x_dma.h
20.27KB
boots/Library/stm32f10x_exti.c
6.8KB
boots/Library/stm32f10x_exti.h
6.66KB
boots/Library/stm32f10x_flash.c
61.08KB
boots/Library/stm32f10x_flash.h
24.85KB
boots/Library/stm32f10x_fsmc.c
34.65KB
boots/Library/stm32f10x_fsmc.h
26.38KB
boots/Library/stm32f10x_gpio.c
22.68KB
boots/Library/stm32f10x_gpio.h
19.7KB
boots/Library/stm32f10x_i2c.c
44.71KB
boots/Library/stm32f10x_i2c.h
29.33KB
boots/Library/stm32f10x_iwdg.c
4.8KB
boots/Library/stm32f10x_iwdg.h
3.74KB
boots/Library/stm32f10x_pwr.c
8.55KB
boots/Library/stm32f10x_pwr.h
4.28KB
boots/Library/stm32f10x_rcc.c
50.07KB
boots/Library/stm32f10x_rcc.h
29.74KB
boots/Library/stm32f10x_rtc.c
8.4KB
boots/Library/stm32f10x_rtc.h
3.77KB
boots/Library/stm32f10x_sdio.c
28.25KB
boots/Library/stm32f10x_sdio.h
21.35KB
boots/Library/stm32f10x_spi.c
29.52KB
boots/Library/stm32f10x_spi.h
17.31KB
boots/Library/stm32f10x_tim.c
106.6KB
boots/Library/stm32f10x_tim.h
51.2KB
boots/Library/stm32f10x_usart.c
37.41KB
boots/Library/stm32f10x_usart.h
16.16KB
boots/Library/stm32f10x_wwdg.c
5.6KB
boots/Library/stm32f10x_wwdg.h
2.9KB
boots/Listings/
-
boots/Listings/Project.map
129.37KB
boots/Listings/startup_stm32f10x_md.lst
40.49KB
boots/Objects/
-
boots/Objects/ad.crf
338.74KB
boots/Objects/ad.d
1.25KB
boots/Objects/ad.o
372.05KB
boots/Objects/core_cm3.crf
3.85KB
boots/Objects/core_cm3.d
108B
boots/Objects/core_cm3.o
10.8KB
boots/Objects/delay.crf
338.11KB
boots/Objects/delay.d
1.34KB
boots/Objects/delay.o
370.35KB
boots/Objects/ExtDll.iex
19B
boots/Objects/key.crf
338.37KB
boots/Objects/key.d
1.32KB
boots/Objects/key.o
370.15KB
boots/Objects/led.crf
338.57KB
boots/Objects/led.d
1.28KB
boots/Objects/led.o
375.42KB
boots/Objects/main.crf
339.8KB
boots/Objects/main.d
1.48KB
boots/Objects/main.o
373.78KB
boots/Objects/misc.crf
338.79KB
boots/Objects/misc.d
1.34KB
boots/Objects/misc.o
373.32KB
boots/Objects/oled.crf
341.39KB
boots/Objects/oled.d
1.35KB
boots/Objects/oled.o
393.36KB
boots/Objects/Project.axf
350.76KB
boots/Objects/Project.build_log.htm
1.67KB
boots/Objects/Project.htm
55.55KB
boots/Objects/Project.lnp
1.17KB
boots/Objects/Project.sct
494B
boots/Objects/Project_Target 1.dep
55.65KB
boots/Objects/pwm.crf
338.47KB
boots/Objects/pwm.d
1.31KB
boots/Objects/pwm.o
369.31KB
boots/Objects/startup_stm32f10x_md.d
64B
boots/Objects/startup_stm32f10x_md.o
5.85KB
boots/Objects/stm32f10x_adc.crf
345.79KB
boots/Objects/stm32f10x_adc.d
1.63KB
boots/Objects/stm32f10x_adc.o
418.27KB
boots/Objects/stm32f10x_bkp.crf
339.7KB
boots/Objects/stm32f10x_bkp.d
1.63KB
boots/Objects/stm32f10x_bkp.o
382.71KB
boots/Objects/stm32f10x_can.crf
347.36KB
boots/Objects/stm32f10x_can.d
1.63KB
boots/Objects/stm32f10x_can.o
404.13KB
boots/Objects/stm32f10x_cec.crf
340.24KB
boots/Objects/stm32f10x_cec.d
1.63KB
boots/Objects/stm32f10x_cec.o
385.21KB
boots/Objects/stm32f10x_crc.crf
338.35KB
boots/Objects/stm32f10x_crc.d
1.63KB
boots/Objects/stm32f10x_crc.o
374.28KB
boots/Objects/stm32f10x_dac.crf
340.37KB
boots/Objects/stm32f10x_dac.d
1.63KB
boots/Objects/stm32f10x_dac.o
383.34KB
boots/Objects/stm32f10x_dbgmcu.crf
338.14KB
boots/Objects/stm32f10x_dbgmcu.d
1.73KB
boots/Objects/stm32f10x_dbgmcu.o
370.55KB
boots/Objects/stm32f10x_dma.crf
341.82KB
boots/Objects/stm32f10x_dma.d
1.63KB
boots/Objects/stm32f10x_dma.o
382.85KB
boots/Objects/stm32f10x_exti.crf
339.33KB
boots/Objects/stm32f10x_exti.d
1.67KB
boots/Objects/stm32f10x_exti.o
377.21KB
boots/Objects/stm32f10x_flash.crf
345.63KB
boots/Objects/stm32f10x_flash.d
1.7KB
boots/Objects/stm32f10x_flash.o
407.64KB
boots/Objects/stm32f10x_fsmc.crf
344.17KB
boots/Objects/stm32f10x_fsmc.d
1.67KB
boots/Objects/stm32f10x_fsmc.o
393.77KB
boots/Objects/stm32f10x_gpio.crf
342.2KB
boots/Objects/stm32f10x_gpio.d
1.67KB
boots/Objects/stm32f10x_gpio.o
392.68KB
boots/Objects/stm32f10x_i2c.crf
344.58KB
boots/Objects/stm32f10x_i2c.d
1.63KB
boots/Objects/stm32f10x_i2c.o
412.63KB
boots/Objects/stm32f10x_it.crf
338.27KB
boots/Objects/stm32f10x_it.d
1.6KB
boots/Objects/stm32f10x_it.o
377.83KB
boots/Objects/stm32f10x_iwdg.crf
338.45KB
boots/Objects/stm32f10x_iwdg.d
1.67KB
boots/Objects/stm32f10x_iwdg.o
374.25KB
boots/Objects/stm32f10x_pwr.crf
339.61KB
boots/Objects/stm32f10x_pwr.d
1.63KB
boots/Objects/stm32f10x_pwr.o
378.77KB
boots/Objects/stm32f10x_rcc.crf
345.69KB
boots/Objects/stm32f10x_rcc.d
1.63KB
boots/Objects/stm32f10x_rcc.o
411.38KB
boots/Objects/stm32f10x_rtc.crf
339.61KB
boots/Objects/stm32f10x_rtc.d
1.63KB
boots/Objects/stm32f10x_rtc.o
384.74KB
boots/Objects/stm32f10x_sdio.crf
342.8KB
boots/Objects/stm32f10x_sdio.d
1.67KB
boots/Objects/stm32f10x_sdio.o
406.39KB
boots/Objects/stm32f10x_spi.crf
342.67KB
boots/Objects/stm32f10x_spi.d
1.63KB
boots/Objects/stm32f10x_spi.o
398.83KB
boots/Objects/stm32f10x_tim.crf
360.35KB
boots/Objects/stm32f10x_tim.d
1.63KB
boots/Objects/stm32f10x_tim.o
493.39KB
boots/Objects/stm32f10x_usart.crf
344.27KB
boots/Objects/stm32f10x_usart.d
1.7KB
boots/Objects/stm32f10x_usart.o
407.66KB
boots/Objects/stm32f10x_wwdg.crf
338.89KB
boots/Objects/stm32f10x_wwdg.d
1.67KB
boots/Objects/stm32f10x_wwdg.o
377.04KB
boots/Objects/system_stm32f10x.crf
339.93KB
boots/Objects/system_stm32f10x.d
1.67KB
boots/Objects/system_stm32f10x.o
372.67KB
boots/Project.uvguix.Admin
86.96KB
boots/Project.uvguix.Administrator
175.39KB
boots/Project.uvoptx
33.6KB
boots/Project.uvprojx
26.47KB
boots/Start/
-
boots/Start/core_cm3.c
16.87KB
boots/Start/core_cm3.h
83.71KB
boots/Start/startup_stm32f10x_cl.s
15.4KB
boots/Start/startup_stm32f10x_hd.s
15.14KB
boots/Start/startup_stm32f10x_hd_vl.s
15.32KB
boots/Start/startup_stm32f10x_ld.s
12.09KB
boots/Start/startup_stm32f10x_ld_vl.s
13.34KB
boots/Start/startup_stm32f10x_md.s
12.47KB
boots/Start/startup_stm32f10x_md_vl.s
13.74KB
boots/Start/startup_stm32f10x_xl.s
15.58KB
boots/Start/stm32f10x.h
619.08KB
boots/Start/system_stm32f10x.c
35.7KB
boots/Start/system_stm32f10x.h
2.04KB
boots/System/
-
boots/System/Delay.c
838B
boots/System/Delay.h
135B
boots/User/
-
boots/User/main.c
1.11KB
boots/User/stm32f10x_conf.h
3.18KB
boots/User/stm32f10x_it.c
4.3KB
boots/User/stm32f10x_it.h
2.04KB

资源内容介绍

在电子工程领域中,Boost电路是一种常用的直流-直流转换器,其功能是将一个较低的直流输入电压转换成一个较高的直流输出电压。Boost电路的原理基于电感在断电时产生的感应电动势,通过控制开关元件(通常是MOSFET或者晶体管)的导通与截止,可以在负载端得到一个高于输入电压的稳定输出电压。STM32是一种广泛使用的32位ARM Cortex-M微控制器系列,由意法半导体(STMicroelectronics)公司生产。STM32微控制器以其高性能、低功耗、丰富的外设接口和成本效益而著称,广泛应用于嵌入式系统和物联网设备中。它具备出色的处理能力和灵活的外设配置,使其成为实现复杂控制算法的理想选择,比如控制Boost电路的运行。在设计基于STM32的Boost电路时,通常需要编写控制代码,以便微控制器可以实时监测电路状态并相应地调节开关元件的工作。这通常涉及到模拟信号的采集(如电压和电流检测),PWM信号的生成来控制MOSFET的开关频率和占空比,以及反馈机制的实现来稳定输出电压。代码的实现会涉及到STM32的硬件抽象层(HAL)或者直接寄存器操作,根据不同的需求和设计复杂度,开发者会选择合适的方法。例如,对于初学者来说,HAL库提供了较为直观的编程接口,而经验丰富的工程师可能会直接操作寄存器以获得更好的性能和资源利用。Boost电路的应用广泛,例如在太阳能电池板的最大功率点跟踪(MPPT)系统、电动汽车的电池管理系统、可再生能源的电能转换等场景中都能见到其身影。在这些应用中,微控制器的代码需要精细地控制电路的开关,以响应输入电压和负载电流的变化,确保电能高效且稳定地传输。在实现Boost电路时,除了硬件设计和软件编程,还需要考虑电路的保护机制,比如过流保护、过压保护和热保护等。这些保护措施能够防止电路因意外情况而损坏,延长Boost电路的使用寿命。基于STM32的Boost电路设计是一个将微控制器编程与电力电子技术紧密结合的工程项目,它不仅展示了微控制器在电力电子应用中的潜力,也考验了电子工程师在软硬件设计方面的综合能力。
/** ****************************************************************************** * @file stm32f10x_tim.c * @author MCD Application Team * @version V3.5.0 * @date 11-March-2011 * @brief This file provides all the TIM firmware functions. ****************************************************************************** * @attention * * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. * * <h2><center>© COPYRIGHT 2011 STMicroelectronics</center></h2> ****************************************************************************** */#include "stm32f10x_tim.h"#include "stm32f10x_rcc.h"/** @addtogroup STM32F10x_StdPeriph_Driver * @{ *//** @defgroup TIM * @brief TIM driver modules * @{ *//** @defgroup TIM_Private_TypesDefinitions * @{ *//** * @} *//** @defgroup TIM_Private_Defines * @{ */#define SMCR_ETR_Mask ((uint16_t)0x00FF) #define CCMR_Offset ((uint16_t)0x0018)#define CCER_CCE_Set ((uint16_t)0x0001) #define CCER_CCNE_Set ((uint16_t)0x0004) /** * @} *//** @defgroup TIM_Private_Macros * @{ *//** * @} *//** @defgroup TIM_Private_Variables * @{ *//** * @} *//** @defgroup TIM_Private_FunctionPrototypes * @{ */static void TI1_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, uint16_t TIM_ICFilter);static void TI2_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, uint16_t TIM_ICFilter);static void TI3_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, uint16_t TIM_ICFilter);static void TI4_Config(TIM_TypeDef* TIMx, uint16_t TIM_ICPolarity, uint16_t TIM_ICSelection, uint16_t TIM_ICFilter);/** * @} *//** @defgroup TIM_Private_Macros * @{ *//** * @} *//** @defgroup TIM_Private_Variables * @{ *//** * @} *//** @defgroup TIM_Private_FunctionPrototypes * @{ *//** * @} *//** @defgroup TIM_Private_Functions * @{ *//** * @brief Deinitializes the TIMx peripheral registers to their default reset values. * @param TIMx: where x can be 1 to 17 to select the TIM peripheral. * @retval None */void TIM_DeInit(TIM_TypeDef* TIMx){ assert_param(IS_TIM_ALL_PERIPH(TIMx)); if (TIMx == TIM1) { RCC_APB2PeriphResetCmd&#40;RCC_APB2Periph_TIM1, ENABLE&#41;; RCC_APB2PeriphResetCmd&#40;RCC_APB2Periph_TIM1, DISABLE&#41;; } else if (TIMx == TIM2) { RCC_APB1PeriphResetCmd&#40;RCC_APB1Periph_TIM2, ENABLE&#41;; RCC_APB1PeriphResetCmd&#40;RCC_APB1Periph_TIM2, DISABLE&#41;; } else if (TIMx == TIM3) { RCC_APB1PeriphResetCmd&#40;RCC_APB1Periph_TIM3, ENABLE&#41;; RCC_APB1PeriphResetCmd&#40;RCC_APB1Periph_TIM3, DISABLE&#41;; } else if (TIMx == TIM4) { RCC_APB1PeriphResetCmd&#40;RCC_APB1Periph_TIM4, ENABLE&#41;; RCC_APB1PeriphResetCmd&#40;RCC_APB1Periph_TIM4, DISABLE&#41;; } else if (TIMx == TIM5) { RCC_APB1PeriphResetCmd&#40;RCC_APB1Periph_TIM5, ENABLE&#41;; RCC_APB1PeriphResetCmd&#40;RCC_APB1Periph_TIM5, DISABLE&#41;; } else if (TIMx == TIM6) { RCC_APB1PeriphResetCmd&#40;RCC_APB1Periph_TIM6, ENABLE&#41;; RCC_APB1PeriphResetCmd&#40;RCC_APB1Periph_TIM6, DISABLE&#41;; } else if (TIMx == TIM7) { RCC_APB1PeriphResetCmd&#40;RCC_APB1Periph_TIM7, ENABLE&#41;; RCC_APB1PeriphResetCmd&#40;RCC_APB1Periph_TIM7, DISABLE&#41;; } else if (TIMx == TIM8) { RCC_APB2PeriphResetCmd&#40;RCC_APB2Periph_TIM8, ENABLE&#41;; RCC_APB2PeriphResetCmd&#40;RCC_APB2Periph_TIM8, DISABLE&#41;; } else if (TIMx == TIM9) { RCC_APB2PeriphResetCmd&#40;RCC_APB2Periph_TIM9, ENABLE&#41;; RCC_APB2PeriphResetCmd&#40;RCC_APB2Periph_TIM9, DISABLE&#41;; } else if (TIMx == TIM10) { RCC_APB2PeriphResetCmd&#40;RCC_APB2Periph_TIM10, ENABLE&#41;; RCC_APB2PeriphResetCmd&#40;RCC_APB2Periph_TIM10, DISABLE&#41;; } else if (TIMx == TIM11) { RCC_APB2PeriphResetCmd&#40;RCC_APB2Periph_TIM11, ENABLE&#41;; RCC_APB2PeriphResetCmd&#40;RCC_APB2Periph_TIM11, DISABLE&#41;; } else if (TIMx == TIM12) { RCC_APB1PeriphResetCmd&#40;RCC_APB1Periph_TIM12, ENABLE&#41;; RCC_APB1PeriphResetCmd&#40;RCC_APB1Periph_TIM12, DISABLE&#41;; } else if (TIMx == TIM13) { RCC_APB1PeriphResetCmd&#40;RCC_APB1Periph_TIM13, ENABLE&#41;; RCC_APB1PeriphResetCmd&#40;RCC_APB1Periph_TIM13, DISABLE&#41;; } else if (TIMx == TIM14) { RCC_APB1PeriphResetCmd&#40;RCC_APB1Periph_TIM14, ENABLE&#41;; RCC_APB1PeriphResetCmd&#40;RCC_APB1Periph_TIM14, DISABLE&#41;; } else if (TIMx == TIM15) { RCC_APB2PeriphResetCmd&#40;RCC_APB2Periph_TIM15, ENABLE&#41;; RCC_APB2PeriphResetCmd&#40;RCC_APB2Periph_TIM15, DISABLE&#41;; } else if (TIMx == TIM16) { RCC_APB2PeriphResetCmd&#40;RCC_APB2Periph_TIM16, ENABLE&#41;; RCC_APB2PeriphResetCmd&#40;RCC_APB2Periph_TIM16, DISABLE&#41;; } else { if (TIMx == TIM17) { RCC_APB2PeriphResetCmd&#40;RCC_APB2Periph_TIM17, ENABLE&#41;; RCC_APB2PeriphResetCmd&#40;RCC_APB2Periph_TIM17, DISABLE&#41;; } }}/** * @brief Initializes the TIMx Time Base Unit peripheral according to * the specified parameters in the TIM_TimeBaseInitStruct. * @param TIMx: where x can be 1 to 17 to select the TIM peripheral. * @param TIM_TimeBaseInitStruct: pointer to a TIM_TimeBaseInitTypeDef * structure that contains the configuration information for the * specified TIM peripheral. * @retval None */void TIM_TimeBaseInit(TIM_TypeDef* TIMx, TIM_TimeBaseInitTypeDef* TIM_TimeBaseInitStruct){ uint16_t tmpcr1 = 0; assert_param(IS_TIM_ALL_PERIPH(TIMx)); assert_param(IS_TIM_COUNTER_MODE(TIM_TimeBaseInitStruct->TIM_CounterMode)); assert_param(IS_TIM_CKD_DIV(TIM_TimeBaseInitStruct->TIM_ClockDivision)); tmpcr1 = TIMx->CR1; if((TIMx == TIM1) || (TIMx == TIM8)|| (TIMx == TIM2) || (TIMx == TIM3)|| (TIMx == TIM4) || (TIMx == TIM5)) { tmpcr1 &= (uint16_t)(~((uint16_t)(TIM_CR1_DIR | TIM_CR1_CMS))); tmpcr1 |= (uint32_t)TIM_TimeBaseInitStruct->TIM_CounterMode; } if((TIMx != TIM6) && (TIMx != TIM7)) { tmpcr1 &= (uint16_t)(~((uint16_t)TIM_CR1_CKD)); tmpcr1 |= (uint32_t)TIM_TimeBaseInitStruct->TIM_ClockDivision; } TIMx->CR1 = tmpcr1; TIMx->ARR = TIM_TimeBaseInitStruct->TIM_Period ; TIMx->PSC = TIM_TimeBaseInitStruct->TIM_Prescaler; if ((TIMx == TIM1) || (TIMx == TIM8)|| (TIMx == TIM15)|| (TIMx == TIM16) || (TIMx == TIM17)) { TIMx->RCR = TIM_TimeBaseInitStruct->TIM_RepetitionCounter; } TIMx->EGR = TIM_PSCReloadMode_Immediate; }/** * @brief Initializes the TIMx Channel1 according to the specified * parameters in the TIM_OCInitStruct. * @param TIMx: where x can be 1 to 17 except 6 and 7 to select the TIM peripheral. * @param TIM_OCInitStru

用户评论 (0)

发表评论

captcha