当前位置:网站首页>STM32F103 several special pins are used as ordinary io. Precautions and data loss of backup register 1,2
STM32F103 several special pins are used as ordinary io. Precautions and data loss of backup register 1,2
2022-07-28 12:42:00 【yi_ tianchou】
stm32F103C8T6 chip
There are two possibilities for backup register data loss :
1、 Triggered an intrusion interrupt
PC13 As an ordinary IO When using To disable the intrusion interrupt function , Otherwise, the backup register data will be shut down , Data loss at startup ,( You can check other articles , Don't explain in detail )
2、 chip VBAT Power off when the machine is turned off . If you need to back up the register to save data when it is shut down , that VBAT Need to connect to button battery , If after shutdown VBAT Also power down , Backup registers cannot be saved , At that time, I was curious about why the backup register data was always lost , It turns out that VBAT Why , Later it was changed to flash Stored data , practice : Triggered when shutdown Low voltage interruption , Then save the data to flash.( It's usually used MCU Inside flash For storage ,100uF enough 512 Byte storage )
The following is a description of several special pins :
1、PC13 RTC
Introduction to intrusion function :
Intrusion detection function analysis : Functional data backup .
1 BKP_CR Of TPAL position , Set the decision TAMPER The signal of the pin is determined by 0 change 1 Or another 1 change 0 Is a valid trigger signal , Generate intrusion detection event set flag position (BKR_CSR Of TEF).
2 After the intrusion detection event, all data backup registers will be reset .
3 One thing to notice is that : stay BKP_CR Of TPE Bit allows before enabling , An intrusion detection event generated by an intrusion detection pin is also effective . This is beneficial For better protection of data .
4. When TPAL=0( or 1), If you are in BKP_CR Of TPE Bit permission ( Intrusion detection pin allows bit ) Before enabling TPAL=1( or 0), Once the intrusion detection function is allowed , An additional intrusion event will occur . Even though BKP_CR Of TPE( Intrusion detection pin allows bit ) Position as 1 Then there is a new edge jump
5 After an intrusion detection event is detected and cleared , Intrusion detection pin should be prohibited . Reset before writing the data backup register again BKP_CR Of TPE position ( Intrusion detection pin allows bit ). In this way, it can avoid the intrusion detection event still occurring on the intrusion detection pin , Keep writing to the data backup register .
6VDD When the power supply is disconnected , Intrusion detection function is still valid , Bit to avoid unnecessary data backup register reset ,TAMPER The outside of the pin should be connected to the correct level .
initialization IO Add this full stop when :
PWR_BackupAccessCmd( ENABLE );/* Allow modification of RTC And backup registers */
RCC_LSEConfig(RCC_LSE_OFF);// Turn off the external low-speed external clock signal function after ,PC13 PC14 PC15 Can be ordinary IO use .
BKP_TamperPinCmd(DISABLE); /* Turn off intrusion detection ,PC13 Can be used as ordinary IO*/
BKP_ITConfig(DISABLE); /* prohibit TAMPER interrupt */
2、 PA13 PA14 PA15 These three feet are JTAG foot , Even according to ordinary IO Initialization is also not normal. You need to add
GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable , ENABLE);
It can be regarded as normal IO Use
边栏推荐
- Developing NES games with C language (cc65) 10. Game cycle
- Is it overtime to be on duty? Take up legal weapons to protect your legitimate rights and interests. It's time to rectify the working environment
- New Oriental's single quarter revenue was 524million US dollars, a year-on-year decrease of 56.8%, and 925 learning centers were reduced
- Use json.stringify() to format data
- 连通块&&食物链——(并查集小结)
- Some API interfaces purchased by Yiwu hope to bring you some help
- 开源汇智创未来 | 2022 开放原子全球开源峰会 OpenAtom openEuler 分论坛圆满召开
- Yan Ji lost Beijing again, and more than half of the stores in the country were closed
- 03 pyechars 直角坐标系图表(示例代码+效果图)
- What SaaS architecture design does a software architect need to know?
猜你喜欢

01 pyechars 特性、版本、安装介绍

HMS core audio editing service supports 7 kinds of audio effects to help one-stop audio processing

软件架构师必需要了解的 saas 架构设计?

卸载 Navicat:正版 MySQL 官方客户端,真香!

New Oriental's single quarter revenue was 524million US dollars, a year-on-year decrease of 56.8%, and 925 learning centers were reduced

Exploration on cache design optimization of community like business

Uninstall Navicat: genuine MySQL official client, really fragrant!

Knowledge points of MySQL (13)

leetcode:数组

用C语言开发NES游戏(CC65)07、控制器
随机推荐
New Oriental's single quarter revenue was 524million US dollars, a year-on-year decrease of 56.8%, and 925 learning centers were reduced
Unity加载Glb模型
Under what circumstances can the company dismiss employees
通过Jenkins 拉取服务器代码 权限不足问题及其他注意事项
用C语言开发NES游戏(CC65)08、背景 碰撞
MarkDown简明语法手册
01 pyechars 特性、版本、安装介绍
MMA8452Q几种模式的初始化实例
Brief discussion on open source OS distribution
arduino pro mini ATMEGA328P 连线和点亮第一盏LED(同时记录烧录失败的问题stk500_recv)
If you don't roll the golden nine and silver ten, it's too late
图书馆自动预约脚本
leetcode:数组
How to build knowledge management system in enterprises and institutions
Unity 安装 Device Simulator
The usage and Simulation Implementation of vector in STL
What SaaS architecture design does a software architect need to know?
Distributed session solution
Come to tdengine Developer Conference and have an insight into the future trend of data technology development
SuperMap game engine license module division