In the previous article, we have learned how to connect the S32K with the MC33771B/MC33772B via the classic SPI protocol. This allows our application to manage a battery pack up to 14 cells.
This article details the TPL communication setup between S32K1xx boards and MC3377xBTPL Battery Cell Controllers. It covers both hardware and software setup for the Battery Management System models designed using Model-Based Design Toolbox for battery packs of more than 14 cells in series. At the end of this article, the user will be able to set up the Battery Cell Controller hardware and to design a Simulink model that reads the cell and pack voltages, current, temperatures, and faults status. The measured values will be displayed on the host PC using FreeMaster.
For controlling larger battery backs consisting of more than 14 cells, we have to ‘divide’ the battery packs in modules of 6 or 14 cells (the maximum numbers that an NXP Cell Controller can connect) and to monitor each module. The main MCU must communicate with all the controllers in order to get or set the information needed. To accomplish this communication we connect all the cell controllers in a daisy chain topology and we use a transceiver to connect the Main MCU to the TPL network.
This setup consists of the following parts:
The software approach is very similar to the SPI. The model needs to have an MBD_S32K1xx_Config_Information Block and a FreeMaster_Config for FreeMaster communication.
Unlike the previous article, when we used only one SPI instance for communication with one BCC device, now the TPL requires two SPI Instances, one configured as Slave and one as Master. The user must add two LPSPI configuration blocks to the model and select the Hardware Instances used.
For the Battery Cell Controller Configuration, we need to add the same MC3377xB_Config block. Here, the mode has to be set on TPL and the Device Number set according to the BCC devices number: in our case, 2.
In the next tab, SPI, we have to choose the Instances number for Master and Slave and the Chip select connected to the TPL transceiver. For the Master SPI instance, the user can also use a regular GPIO as a Chip Select pin in case the hardware designer assigned other pins than a hardware SPI.
For reading the values, we use the same blocks as for SPI, just that now we have to specify the CID of the Battery Cell Controller from which we want to read the values.
As you can see in the picture above, our application uses two MC33772BTPL devices. We added two MC3377xB_Get_Values blocks, one for the device with CID 1, the second for the device CID 2. The total Pack Voltage will be the sum of each measured Module Stack Voltage. Since all the cells are connected in series we will measure the Pack current only for the device with CID1.
This article comes with the examples described above. Running the models on your setup could be a good starting point for your project. Once the code has been successfully generated and deployed on the target, the FreeMaster can be connected to the board via UART and the values can be monitored on the Host PC, just like in the application below.
5.1. UM 11143 https://www.nxp.com/webapp/Download?colCode=UM11143&location=null
5.2. FRDM33664BEVB https://www.nxp.com/design/development-boards/analog-toolbox/...
5.3. FRDM33771BTPLEVB https://www.nxp.com/docs/en/user-guide/FRDM33771BTPLEVBUG.pdf
5.4. FRDM33772BTPLEVB https://www.nxp.com/docs/en/user-guide/FRDM33772BTPLEVBUG.pdf
5.5. S32K144 EVB https://www.nxp.com/design/development-boards/automotive-development-...