STM32单片机PVD功能操作流程解析
STM32内部自带PVD功能,用于对MCU供电电压VDD进行监控。通过电
源控制寄存器中的PLS[2:0]位可以用来设定监控电压的阀值,通过对外部电压进行比较
来监控电源。当条件触发,需要系统进入特别保护状态,执行紧急关闭任务:对系统的
一些数据保存起来,同时对外设进行相应的保护操作。
操作流程:
1)、
系统启动后启动PVD,并开启相应的中断。
PWR_PVDLevelConfig(PWR_PVDLevel_2V8); // 设定监控阀值
PWR_PVDCmd(ENABLE); // 使能PVD
EXTI_StrucTInit(
EXTI_InitStructure.EXTI_Line = EXTI_Line16; // PVD连接到中断线16上
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt; //使用中断模式
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Raising;//电压低于阀值时产生中断
EXTI_InitStructure.EXTI_LineCmd = ENABLE; // 使能中断线
EXTI_Init( // 初始
EXTI_InitStructure.EXTI_Trigger的赋值可选项:
EXTI_Trigger_Rising---表示电压从高下降到低于设定阀值时产生中断;
EXTI_Trigger_Falling---表示电压从低上升到高于设定阀值时产生中断;
EXTI_Trigger_Rising_Falling---表示电压上升或下降越过设定阀值时都产生中断。
2)、当工作电压低于设定阀值时,将产生PVD中断,在中断程序中进行相应的处理:
void PVD_IRQHandler(void)
{
EXTI_ClearITPendingBit(EXTI_Line16);
…… // 用户添加紧急处理代码处
}
没有合适的资源?快使用搜索试试~ 我知道了~
STM32F103C8T6模拟IIC控制4针0.96寸OLED显示屏
共91个文件
h:38个
c:35个
s:8个
需积分: 5 1 下载量 191 浏览量
2024-05-15
17:41:00
上传
评论
收藏 2.14MB ZIP 举报
温馨提示
使用STM32F103C8T6模拟IIC控制4针0.96寸OLED显示屏,可以显示数字,字符串,汉字,照片等,可以自行修改成自己想要显示的文字
资源推荐
资源详情
资源评论
收起资源包目录
STM32F103C8T6模拟IIC控制4针0.96寸OLED显示屏.zip (91个子文件)
System
delay
delay.h 159B
delay.c 6KB
usart
usart.h 2KB
usart.c 19KB
system
system.c 27B
system.h 2KB
sys
sys.h 2KB
sys.c 22B
User
stm32f10x_conf.h 3KB
main.c 1008B
stm32f10x_it.c 4KB
stm32f10x_it.h 2KB
Doc
readme.txt 2KB
Libraries
STM32F10x_StdPeriph_Driver
inc
stm32f10x_bkp.h 7KB
stm32f10x_sdio.h 21KB
stm32f10x_dbgmcu.h 4KB
misc.h 9KB
stm32f10x_cec.h 6KB
stm32f10x_can.h 27KB
stm32f10x_fsmc.h 26KB
stm32f10x_spi.h 17KB
stm32f10x_wwdg.h 3KB
stm32f10x_dma.h 20KB
stm32f10x_exti.h 7KB
stm32f10x_tim.h 51KB
stm32f10x_crc.h 2KB
stm32f10x_rtc.h 4KB
stm32f10x_usart.h 16KB
stm32f10x_rcc.h 30KB
stm32f10x_dac.h 15KB
stm32f10x_adc.h 21KB
stm32f10x_i2c.h 29KB
stm32f10x_gpio.h 20KB
stm32f10x_pwr.h 4KB
stm32f10x_flash.h 25KB
stm32f10x_iwdg.h 4KB
src
stm32f10x_adc.c 46KB
stm32f10x_wwdg.c 6KB
misc.c 7KB
stm32f10x_spi.c 30KB
stm32f10x_gpio.c 23KB
stm32f10x_tim.c 107KB
stm32f10x_sdio.c 28KB
stm32f10x_bkp.c 8KB
stm32f10x_rtc.c 8KB
stm32f10x_dac.c 19KB
stm32f10x_dma.c 29KB
stm32f10x_fsmc.c 35KB
stm32f10x_exti.c 7KB
stm32f10x_pwr.c 9KB
stm32f10x_i2c.c 45KB
stm32f10x_crc.c 3KB
stm32f10x_cec.c 11KB
stm32f10x_can.c 44KB
stm32f10x_iwdg.c 5KB
stm32f10x_usart.c 37KB
stm32f10x_dbgmcu.c 5KB
stm32f10x_flash.c 61KB
stm32f10x_rcc.c 50KB
CMSIS
system_stm32f10x.c 36KB
core_cm3.h 84KB
core_cm3.c 17KB
stm32f10x.h 619KB
system_stm32f10x.h 2KB
startup
startup_stm32f10x_cl.s 15KB
startup_stm32f10x_ld_vl.s 13KB
startup_stm32f10x_hd_vl.s 15KB
startup_stm32f10x_hd.s 15KB
startup_stm32f10x_md.s 12KB
startup_stm32f10x_ld.s 12KB
startup_stm32f10x_md_vl.s 14KB
startup_stm32f10x_xl.s 16KB
Project
Objects
Template.hex 10KB
Template.uvprojx 21KB
DebugConfig
Target_1_STM32F103C8.dbgconf 7KB
Target_1_STM32F103C8_1.0.0.dbgconf 2KB
Template.uvguix.Administrator 89KB
Listings
Template.uvguix.ELNOVO 74KB
Template.uvoptx 22KB
JLinkSettings.ini 755B
keilkill.bat 399B
HARDWARE
OLED
oled.c 9KB
bmp.h 5KB
oled.h 1KB
oledfont.h 14KB
IIC1
IIC1.h 436B
IIC1.c 3KB
led
led.h 1KB
led.c 1KB
MYIIC
myiic.c 5KB
myiic.h 2KB
共 91 条
- 1
资源评论
zengyuan666
- 粉丝: 195
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功