S32K344 + MC33664 + MC33774 : RTD 3.0.0 : BMS SDK 1.0.2

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K344 + MC33664 + MC33774 : RTD 3.0.0 : BMS SDK 1.0.2

S32K344 + MC33664 + MC33774 : RTD 3.0.0 : BMS SDK 1.0.2

This example code brief  :--
1> Tested without the SL of BMS, so no dependency on the BMS Saftey lbrary.
2> Its tested on 2 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_17-1737011497931.png



RTD : 3.0.0 P07
BMS SDK : 1.0.2

This example does this task :--

  1. Application Measurement.
  2. SYNC measurement
  3. Periodic Measurement.
  4. Read AFE temperature.
  5. Cell balancing timer method.
  6. Reading the Cell balancing status register & fault registers.



=================== Setup used ============

Attached code is tested with TWO MC33774 AFE connected in TPL mode.

Dinesh_Guleria_13-1737010598219.png

 

Dinesh_Guleria_14-1737010607362.png

 

Dinesh_Guleria_15-1737010623130.png

 

Dinesh_Guleria_16-1737010636852.png

 

=============== MCU Pins used ===========

TPL1-TX :--
TPL1TXCSB  --> PTC6/LPSPI0_PCS1
TPL1TXSCLK --> TPL12TXCLK --> PTE1/LPSPI0_SCK   
TPL1TXDATA --> TPL12TXDATA --> PTE2/LPSPI0_SOUT 

 

TPL1-RX :--
TPL1RXCSB  --> PTB17/LPSPI1_PCS3
TPL1RXCLK  --> PTB14/LPSPI1_SCK
TPL1RXDATA --> PTB15/LPSPI1_SIN

 

Dinesh_Guleria_0-1737012601104.png

 




================= EVB Link ==================

https://www.nxp.com/design/design-center/development-boards-and-designs/18-cell-battery-pack-emulato...

https://www.nxp.com/design/design-center/development-boards-and-designs/analog-toolbox/evaluation-bo...

https://www.nxp.com/design/design-center/development-boards-and-designs/mc33774ata-evaluation-board-...

https://www.nxp.com/design/design-center/development-boards-and-designs/automotive-development-platf...

 

================== 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.pngDinesh_Guleria_3-1737009457282.png


Disable Communication timeout in code :--

Dinesh_Guleria_1-1737009207053.png

 

================= Results for FIRST AFE ===========================

Application Measurement : Cell voltage result :--

Dinesh_Guleria_10-1737010449756.png


SYNC measurement : VC, VB same for both primary & Secondary  measure :--

Dinesh_Guleria_11-1737010480668.png

 

Dinesh_Guleria_12-1737010488510.png

 

 

Attachments
No ratings
Version history
Last update:
3 weeks ago
Updated by: