资源简介
STM32控制BQ76940的BMS的保护部分源代码C程序,底层用的是TI的例程IIC通讯,初始化部分大家自己设置好就应该可以用的。
代码片段和文件信息
/**
******************************************************************************
* @file Project/STM32F10x_StdPeriph_Template/stm32f10x_it.c
* @author MCD Application Team
* @version V3.5.0
* @date 08-April-2011
* @brief Main Interrupt Service Routines.
* This file provides template for all exceptions handler and
* peripherals interrupt service routine.
******************************************************************************
* @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 CONSEQUENTI
AL 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.
*
* © COPYRIGHT 2011 STMicroelectronics
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include “stm32f10x_it.h“
#include “i2c_ee.h“
#include “main.h“
#include “Temper.h“
#include “can.h“
volatile uint16_t Tempa1[4]={0000};
volatile uint16_t Sum_Tempa1=0;
volatile uint16_t Avg_Tempa1=0;
volatile int8_t Real_T1=0;
volatile uint16_t Avg_Real_CC=0;
volatile uint32_t Sum_Real_CC=0;
volatile int16_t Real_BatTemp=0; //用于CAN传输
volatile uint16_t Read_State=0;
volatile uint16_t NTC1=0;
volatile uint16_t NTC2=0;
volatile uint16_t NTC3=0;
volatile int16_t Real_NTC1=0;
volatile int16_t Real_NTC2=0;
volatile int16_t Real_NTC3=0;
volatile uint16_t Flag_Fault_IIC=0;
volatile uint16_t Avg_CC=0;
volatile int16_t Real_CC=0;
volatile uint16_t ABS_CC=0;
volatile uint16_t Flag_CC=0;
volatile int16_t Offset_CC=0;
volatile int16_t Avg_CC_NF=0;
volatile uint16_t State_BMS=0; //0==待机 1==充电 2==放电
volatile uint16_t InitFlag=0;
volatile uint16_t InitCount=0;
volatile uint16_t InitState=0;
//滤波变量
volatile uint16_t Count_Fault_Read=0;
volatile uint16_t Count_Fault_Read1=0;
volatile uint16_t Count_Fault_ReadCC=0;
volatile uint16_t Count_Fault_IIC=0;
volatile uint16_t Count_CellUV[15];
volatile uint16_t Count_CellUV1[15];
volatile uint16_t Count_CellOV[15];
volatile uint16_t Count_CellOV1[15];
volatile uint16_t Count_CellUVRE[15];
volatile uint16_t Count_CellUVRE1[15];
volatile uint16_t Count_CellOVRE[15];
volatile uint16_t Count_CellOVRE1[15];
volatile uint16_t Count_BATUV=0;
volatile uint16_t Count_BATUV1=0;
volatile uint16_t Count_BATOV=0;
volatile uint16_t Count_BATOV1=0;
volatile uint16_t Count_BATUVRE=0;
volatile uint16_t Count_BATUVRE1=0;
volatile uint16_t Count_BATOVRE=0;
volatile uint16_t Count_BATOVRE1=0;
volatile uint16_t Count_OCC=0;
volatile uint16
- 上一篇:Flash动画演示 数据结构和算法
- 下一篇:linux系统安全检测
相关资源
- 基于STM32F4x9的LCD显示
- VS1053B编解码器的VDR分布式声音采集卡
- stm32的DAC播放音乐文件
- STM32+TMC5160代码电路图.rar
- 基于STM32的深海钻机甲板控制系统
- stm32f103.SchDoc
- STM32F103 USART+DMA
- DMA+stm32 407.zip
- 4_USART串口通信(空闲中断+DMA.zip
- stm32f105-usart-DMA收发demo
- STM32F042F6P6 Uart12DMA;发送中断接收
- 基于STM32的嵌入式双目图像采集系统设
- 基于STM32F103C8单片机的晶联讯电子JL
- 基于STM32的温湿度检测系统实现
- stm32F4+w5300
- 14284969_《STM32单片机应用与全案例实践
-
ST-li
nk-V2的SWD仿真使用方法.docx - 安富莱STM32开发板资料
- STM32F103实现OV7670摄像头显示
- STM32F207学习板例程
- STM32F103VCT6TR - High-density performance lin
- STM32 SRAM启动的 KeiL 配置
- STM32的IAP-Bootloader程序
- STM32例程之Bootloader
- stm32f103 虚拟U盘,调试成功的
- 基于stm32F103vct6的SD卡FATFS文件系统移植
- STM32F030从机中断接收的iic代码,附带
- FreeModbus_Slave+STM32F407+USART2代码亲测可
- STM32+1602液晶proteus仿真.zip
- STM32循迹小车
评论
共有 条评论