This example code brief :-- 1> Tested without the SL of BMS, so no dependency on the BMS Safety library. 2> Its tested on 3 AFE MC33774 board connected in TPL 3> Change following macro in mc33774_cfg.h file to change the numbers of AFE connected in TPL.
Dinesh_Guleria_25-1751448180253.png
RTD : 3.0.0 P07 BMS SDK : 1.0.2
This example does this task :--
Application Measurement.
SYNC measurement
Periodic Measurement.
Read AFE temperature.
Cell balancing timer method.
Reading the Cell balancing status register & fault registers.
=================== Setup used ============ Attached code is tested with TWO MC33774 AFE connected in TPL mode. FRDM665SPIEVB stackable board used for MC33665.
Dinesh_Guleria_2-1751446322823.png
Dinesh_Guleria_3-1751446581217.png
Dinesh_Guleria_5-1751446645337.png
=============== MCU Pins used ===========
Dinesh_Guleria_6-1751446713080.png
FRDM665SPIEVB Jumper setting :---
Dinesh_Guleria_8-1751446761725.png
Dinesh_Guleria_7-1751446740262.png Dinesh_Guleria_9-1751446794794.png Dinesh_Guleria_10-1751446821343.png Dinesh_Guleria_14-1751447262458.png
Dinesh_Guleria_11-1751447163899.png
K1, K2 & K4 connector of S32J344 EVB :--
Dinesh_Guleria_12-1751447210478.png
Dinesh_Guleria_13-1751447220438.png Dinesh_Guleria_17-1751447440073.png
K1 on MC33665 & S32K334 evb :--
Dinesh_Guleria_15-1751447331208.png Dinesh_Guleria_16-1751447372666.png
K2 on MC33665 & S32K334 evb :--
Dinesh_Guleria_18-1751447532421.png
K4 on MC33665 & S32K334 evb :--
Dinesh_Guleria_19-1751447635350.png
Dinesh_Guleria_20-1751447642455.png
================= EVB Link ==================
https://www.nxp.com/design/design-center/development-boards-and-designs/18-cell-battery-pack-emulator-to-supply-mc33774-bcc-evbs:BATT-18EMULATOR
https://www.nxp.com/design/design-center/development-boards-and-designs/FRDM665SPIEVB
https://www.nxp.com/design/design-center/development-boards-and-designs/mc33774ata-evaluation-board-with-isolated-daisy-chain-communication:RD33774ADSTEVB
https://www.nxp.com/design/design-center/development-boards-and-designs/automotive-development-platforms/s32k-mcu-platforms/s32k3x4evb-t172-evaluation-board-for-automotive-general-purpose:S32K3X4EVB-T172
================== Measurement types used in example ===== Periodic measurement is done by 33774 , this is cyclic Other Two : application , sync need send command to start
Application measurement , need send app_capture command twice , and then read the result.
Dinesh_Guleria_5-1737009817595.png
Synchronous measurement take out the Primary adc result(VC)and secondary result(VB) .But the VC and VB result comes from different adc.
Dinesh_Guleria_7-1737009854223.png
Period measurement start when you send API "MSR_StartMeasurement" and then 774 will do period measurement automatically periodically :--
Dinesh_Guleria_0-1737006679159.png
Why we need to measure Vc & Vb both :-- ASIL-D ,yes we can measurement VC channel by primary ADC and measurement VB by secondary ADC from hardware VC and VB are come from same point of battery cell. Now 2 ADC compare with each other, that lead to high safety (ASIL D).
Primary & Secondary Device temperature reading :-- This API is used for it MC33774_CDD_BCC_SWC_Running_Slot4(). ============= Cell Balancing =========== Cell Balancing method used :-- MC33774 balance will switch between odd channel (1,3,5,7,... 17) and even channel (2,4,6,8,..18) by 500ms period , (250ms for odd and then switch to even 250ms and then odd 250ms...)it is because of IC design and cannot change by software. MC33774 have lots of balance method this example uses "timer method ". How to check Balancing is enabled :-- Following function MC33774_CDD_BCC_SWC_Running_Slot5() read the : Balance status & fault registers BAL_SWITCH_STAT0, BAL_SWITCH_STAT1 represent the balancing MOSFET current status.
Dinesh_Guleria_9-1737010317798.png
Measure the voltage drop across the balancing register is the best approach. You will see the voltage drop appears every 250ms if PWM is 100%. Please check the schematic of the 33774 EVB, find the balancing resistor on which channel balancing is enabled.
Dinesh_Guleria_8-1737009961220.jpeg
======= How much time to wait to extract the measurements results =======
240 us is the time of one SCAN
Time between each Application measurement sequence. Min App measure time for 16 sample :-- 4.08ms = (16+1) *240 Min 1 SYNC measurement time, for 16 samples = 18 cycle ≈ 18 * (16*240us) ≈ 69 ms ============= Using Debugger ============ Debugger breakpoint will cause the communication timeout at the AFE, which will RESET the AFE. To use the debugger while development you need to disable the communication timeout. In S32DS MEX file you cannot disable the timeout function ( limit the value of 0~255)
Dinesh_Guleria_2-1737009365867.png Dinesh_Guleria_3-1737009457282.png
Disable Communication timeout in code :--
Dinesh_Guleria_1-1737009207053.png
================= Results for FIRST AFE ===========================
Dinesh_Guleria_21-1751447844674.png
Dinesh_Guleria_22-1751447886464.png
Dinesh_Guleria_23-1751447903059.png
Dinesh_Guleria_24-1751447923327.png
Dinesh_Guleria_26-1751448200293.png
記事全体を表示