SLAAEB3A May   2023  – July 2024 MSPM0G3507 , MSPM0L1106 , MSPM0L1306

PRODUCTION DATA  

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2Hardware Connection
  6. 3Software Structure and Important Functions
    1. 3.1 System Initialization
    2. 3.2 Low-Level Command Control
    3. 3.3 High-Level Function
  7. 4Test Result of Important Functions
    1. 4.1 Read Alarm Status
    2. 4.2 Read Safety Status
    3. 4.3 Read PF Status
    4. 4.4 Read Current
    5. 4.5 Read All Temperatures
    6. 4.6 Read All Voltages
  8. 5References
  9. 6Revision History

System Initialization

The sample code described in this application note is created by using MSPM0 I2C interface to control BQ76952 and realize necessary commands. The final code is composed of three types of functions: MSPM0 initializing functions, I2C communication functions and BQ76952 functions. The code shows a demonstration of how to communicate MSPM0 with BQ756952 by I2C interface and implement specific command.

The MSPM0 initialization is for system initialization of MCU power, system controller, system clock, and I2C peripherals, shown in Figure 3-2 and Figure 3-3. All the configuration is done by Sysconfig (Graphic code generation tool). The I2C peripheral in MSPM0 is configured as a Controller device to communicate with BQ769x2.

 SYSCFG_DL_init ()
                    Function Figure 3-2 SYSCFG_DL_init () Function
 SYSCFG_DL_I2C_0_init ()
                    Function Figure 3-3 SYSCFG_DL_I2C_0_init () Function

The I2C module is initialized by the SYSCFG_DL_I2C_0_init() function. The clock source for I2C module is BUSCLK which depends on the power domain of MSPM0L. The I2C standard bus speed can be configured to Standard Mode(100k), Fast Mode(400k) and Fast Mode Plus(1M), three modes. This code is set to 100kHz. All details of these settings can be found in CCS Sysconfig page.

 Sysconfig Setting
                    Interface Figure 3-4 Sysconfig Setting Interface