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.
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.
=============== MCU Pins used ===========
FRDM665SPIEVB Jumper setting :---
K1, K2 & K4 connector of S32J344 EVB :--
K1 on MC33665 & S32K334 evb :--
K2 on MC33665 & S32K334 evb :--
K4 on MC33665 & S32K334 evb :--
================= 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.
Synchronous measurement take out the Primary adc result(VC)and secondary result(VB) .But the VC and VB result comes from different adc.
Period measurement start when you send API "MSR_StartMeasurement" and then 774 will do period measurement automatically periodically :--
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.
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.
======= 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)
Disable Communication timeout in code :--
================= Results for FIRST AFE ===========================
View full article