打印
[电池电源管理]

SH367309中颖单片机专用动力电池保护板开发资料 原理图PCB代码

[复制链接]
54|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
tpgf|  楼主 | 2025-3-5 08:50 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
1、简介      
中颖BMS5-16 串 前端芯片,用于充电管理+电池保护+电量计量,有规格书,原理图,PCB, DEMO CODE全套开发资料 。

2、原理图和PCB










3、程序

#include "system.h"
#include "Uart.h"
#include "Main.h"


void main(void)
{
        Initial();                                        //Initialize the system

        while(1)
        {
                RSTSTAT = RSTSTAT;

                  if(bAFE**)
                {
                         bAFE** = 0;
                        AFERdFlag();
                }

                if((ucResetFlag==0x12) && bUartSndAck**)        //Software reset occurs, and ended UART communication
                {
                        if(!bWrFlash**)
            {
                                EA = 0;
                                ResetAFE();                                                //Reset IC
                                ResetInit();                                        //Reset MCU
                        }
                }

                if(bWakeup**)                                                //The charger / load, keys can wake up the system
                {
                        bWakeup** = 0;
                        WakeUpProcess();                                //System to be awakened
                }

                if(bBleOnOff**)                                        //按键长按5秒开启/关闭蓝牙
                {
                        bBleOnOff** = 0;
                        BleOnorOff();
                }
                BleDisplay();

                if(bCADC**)
                {
                        bCADC** = 0;
                        CurProcess();                                        //Calculate the current value and determines the state of charge and discharge
                }

                if(bCalibration**)
                {
                        bCalibration** = 0;
                        CaliProcess();                                        //PC calibration
                }

                if((bWrFlash**)&&(ucUpDataLimitTime == 0))
                {
                        bWrFlash** = 0;
                        if(FlashProcess())
                        {
                                if(bUartNeedAck**)
                                {
                                        UART_SEND_ACK;
                                }
                        }
                        else
                        {
                                if(bUartNeedAck**)
                                {
                                        UART_SEND_NACK;
                                }
                        }
                        bUartNeedAck** = 0;
                }

                if(bLEDOpen)
                {
                        bLEDOpen = 0;
                        bLED** = 1;
                        ucLEDTimeCnt = 0;
                        LEDPowerOn();                                        //By LED displays battery capacity
                }

                if(bEnEEPRomBK && bE2PProcess**)
                {
                        bE2PProcess** = 0;
                        E2PRomBKProcess();
                }

                if(bISP** && bUartSndAck**)
                {
                        bISP** = 0;
                        ISPProcess();
                }

                if(bTimer**)                                                //timer is 1s
                {
                        bTimer** = 0;

                        AFECheck();                            //Check AFE Register               

                        LEDPowerOff();                                        //When the LED display 4s, turn off the LED

                        BatteryInfoManage();                        //Get battery voltage and temperature information

                        RamCheckProcess();                    //Detect the xdata block data

                        GaugeManage();                                        //Calculate the battery charge and discharge capacity

                        VolProcess();                                        //Detection of battery charge and discharge cut-off voltage

                        BalProcess();                                        //Process external voltage balance

                        ProtectProcess();                                //Process battery abnormal state

            if(bEnEEPRomBK)
            {
                            E2PRomBKCheck();                        //Detecting whether to backup EEPRom
            }

                        ShutDownProcess();                                //Detecting whether to enter a low-power
                }

                IntoShutDown();
        }
}

————————————————

                            版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

原文链接:https://blog.csdn.net/qq_35654286/article/details/145109727

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

2140

主题

16380

帖子

16

粉丝