[FRDM-MCXA153] LPI2C Beginner's Guide (Japanese Blog) Introduction
This article is aimed at beginners in microcontrollers and explains the peripheral functions and usage of the NXP MCX A153 microcontroller. You will learn the basic concepts and implementation methods by actually modifying the SDK sample programs provided by NXP.
table of contents
1. Common Usage Examples in Applications (I²C Edition)
1.1 Main Uses
1.2 Usage example
2. Fundamentals of I²C
2.1 What is I²C in the first place?
2.2 Microcontroller I²C Module
3. Main functions and block diagram of the MCX A153 I²C module (LPI2C)
3.1 Overview
3.2 Block Diagram
3.3 Functions
4. Equipment and Development Tools Used
4.1 Evaluation Board (FRDM-MCXA153)
4.2 Development Tools (MCUXpresso for VS Code and IDE)
5. Programming
5.1 Check the contents of the base sample code
5.2 Pin Configuration
5.3 Changes in the program code
6. Practical Training
6.1 Practical Training Content
6.2 Practical Exercise Procedure
6.3 Add pull-up resistors to the evaluation board
6.4 Coding the changes
6.5 Change the pin settings using the PIN configurator
6.6 Build & Debug, Test Functionality
1. Common Usage Examples in Applications (I²C Edition)
Key points of this chapter: We will examine the situations in which I²C is used.
1.1 Main Uses
I²C is a communication method that reads and writes data by specifying the register address within a device. Because it uses fewer signal lines, it is suitable for controlling multiple ICs on a single circuit board. However, it is susceptible to wiring capacitance and noise, so it is generally used for short-distance communication.
Connection of various sensors such as temperature, acceleration, and magnetic sensors.
Digital potentiometer
IO Expander
EEPROM
RTC
Input/output expansion for display devices (LCD, LED, etc.)
Microcontroller-to-microcontroller communication (included in the sample program on the FRDM-MCXA153 evaluation board)
1.2 Usage example
Actual applications include computer motherboards, embedded systems, and mobile phones.
2. Fundamentals of I²C
Key points of this chapter: We will clarify the basic I²C terminology, including SDA, SCL, address, ACK/NACK, and pull-up resistor.
2.1 What is I²C in the first place?
I²C is a serial bus communication standard developed by Philips Semiconductors (now NXP Semiconductors). It is now widely used as a representative method for connecting sensors and peripheral ICs on circuit boards.
I²C is a synchronous serial communication method that sends data synchronized with a clock. The data line is called SDA, and the clock line is called SCL. Communication is performed by timing SDA to SCL.
Each slave has a unique address, and the master communicates by specifying that address. When the address is sent at the start of communication, the target slave returns an ACK (acknowledgment). If an ACK cannot be received, no ACK is returned, which is called a NACK (non-acknowledgment).
Communication is performed using a protocol consisting of start condition, address, R/W bits, ACK/NACK, and stop condition.
Addresses can be in 7-bit mode or 10-bit mode.
I²C is an open-drain protocol. Pull-up resistors keep SDA and SCL normally high, and each device pulls them low when needed. Therefore, pull-up resistors are required on communication lines.
A microcontroller is typically used as the master. There are two ways to determine communication completion: using interrupts from the slaves, and a polling method where the master repeatedly checks a completion flag. When using interrupts, each slave must have an interrupt output and the master must have an interrupt input. Using interrupts results in faster response times, but the hardware becomes more resource-intensive.
For more detailed information about I²C, please refer to the following article.
Overview of the I²C Bus (Japanese Blog)
This time, we will use a polling method to match the wiring conditions of the evaluation board.
Typical transfer speeds are 100kbps in standard mode and 400kbps in fast mode. The MCX A153 also supports Fast Mode Plus, allowing for communication at a maximum speed of 1Mbps.
The procedure for sending data from the master to the slave is as follows:
Master initiated communication.
The master specifies the slave address.
Sending data from master to slave
The master terminated the communication.
Conversely, the procedure for a master receiving data from a slave is as follows:
Master initiated communication.
The master specifies the slave address.
The master receives data from the slave.
The master terminated the communication.
2.2 Microcontroller I²C Module
The diagram below shows a block diagram of an I²C module typically found in microcontrollers.
The number of components is not that large. The main components are the Command/TX FIFO for the transmit buffer, the RXFIFO for the receive buffer, configuration registers, and the control circuit that controls communication. Furthermore, most microcontrollers nowadays have a built-in noise filter.
3. Main functions and block diagram of the MCX A153 I²C module (LPI2C)
Key points of this chapter: We will examine the differences between general I²C and the LPI2C module of the MCX A153.
3.1 Overview
Up to this point, we have explained the basics of general I²C, but in this chapter we will explain the LPI2C I²C module of the MCX A153. LPI2C is far more functional than the basic I²C mentioned above. LPI2C supports efficient interfacing to the I²C bus as both a master (controller) and a slave (target).
The main features are listed below.
Supports logic for Standard, High Speed, High Speed+, HS Mode (Target Only), and Ultra High Speed operating modes.
CPU overhead is minimized by DMA offloading access to the FIFO.
LPI2C also complies with the System Management Bus (SMBus) specification version 3.
*Note 1
The MCX A153 reference manual uses the terms "master and controller" and "slave and target" interchangeably. While "controller" and "target" are now recommended, we will use "master and slave" consistently in this document.
3.2 Block Diagram
The MCX A153's LPI2C module has a master section in the upper half and a slave section in the lower half. The SDA and SCL modules are also divided into master and slave versions, with the slave versions having an "S" appended to them, hence SDAS and SCLS. Communication can also be started using the external HREQ terminal or the internal Trigger signal.
3.3 Functions
The functions of LPI2C are as follows:
Standard, High Speed, High Speed+, Ultra High Speed Mode
Multi-controller (including synchronization and arbitration)
Clock stretching
Arbitration (when a system has multiple controllers)
7-bit addressing, 10-bit addressing
Software reset, start byte, device ID (software support is also required).
Command and transmit FIFO (4 words, 8-bit transmit data + 3-bit command)
Received FIFO (4 words, 8-bit received data)
Host request input for controlling the start time of I²C bus transfer
Interrupt generation upon data match and rejection of unwanted data based on received data matching.
Flags and optional interrupt signals for repeat start conditions, stop conditions, loss of arbitration, unexpected NACK, and command word errors.
configurable bus idle timeout and pin stack low timeout.
Independent I²C target registers
7-bit or 10-bit addressing
Send/receive data registers that support interrupts or DMA requests
ACK or NACK can be controlled by software.
Clock stretching can be configured to avoid transmit FIFO underrun and receive FIFO overrun errors.
Packet termination flags and optional interrupt, stop condition, or bit error detection.
4. Equipment and Development Tools Used
4.1 Evaluation Board (FRDM-MCXA153)
The equipment used for this practical exercise will be a Windows PC and the FRDM-MCXA153 evaluation kit for the MCX A153 (FRDM-MCXA153 Development Board using MCUXpresso | NXP Semiconductors).
A USB Type-C cable is included with the FRDM-MCXA153. Board information and circuit diagrams for the FRDM-MCXA153 can be obtained by clicking "Design Files" on the website. (Account registration required)
The FRDM-MCXA153 is equipped with a P3T1755 temperature sensor. In its initial state, the P3T1755 is connected to I3C0, so this time we will change the pin settings to connect it to LPI2C and read the temperature using LPI2C.
Since there is no interrupt line wired from the P3T1755 to the LPI2C, the LPI2C will be used as a polling master. Also, since there are no pull-up resistors on the signal lines of the MCX A153 and P3T1755, external resistors will be added.
4.2 Development Tools (MCUXpresso for VS Code and IDE)
This article will guide you through editing and running SDK samples using MCUXpresso for VS Code or the MCUXpresso IDE. Development tools are the environment for creating projects, editing code, configuring settings, and running applications. This article does not cover tool installation or initial setup; please refer to NXP's official guides for instructions specific to your environment.
5. Programming
The key point of this chapter is to first understand how the sample code works, and then modify it for the P3T1755.
5.1 Check the contents of the base sample code
Several sample programs for I²C are provided.
This time, we will use the sample program "lpi2c_edma_b2b_polling_master" which uses polling as the master. We will modify this sample program to create a program that reads temperature data from the P3T1755 temperature sensor installed in the FRDM-MCXA153 using I²C.
By default, the P3T1755 is connected to the I3C module I3C0, but we will modify the program to switch to the LPI2C module and create a program that uses the LPI2C to read the temperature of the P3T1755.
In the FRDM-MCXA153, there is no interrupt line wired from the P3T1755 to the LPI2C, so the LPI2C must be used as the polling master. Also, the wiring connecting the MCX A153 and the P3T1755 does not have a pull-up resistor, so a pull-up resistor must be added.
In this example, an LPI2C instance is implemented as a master on one board and as a slave on the other board. The master sends data to the slave and receives data from the slave. This example verifies whether the data received from the slave is correct.
The general outline of the communication procedure is as follows:
The master unit sends a signal to begin communication (start condition).
The master sends the slave address.
The slave sends a signal (acknowledgment) to the master indicating that it is ready to communicate.
Perform data communication (repeated depending on the data to be sent)
The master unit issues a signal to end communication (stop condition).
Further breakdown reveals two types of control: Write control, which writes information to the slave, and Read control, which reads information from the slave. First, Write control is performed, followed by Read control to read the temperature data.
This is the basic procedure for controlling the master side using polling. It's the same whether the slave is a microcontroller's I²C module or a sensor IC such as a temperature sensor.
[Write control]
The procedure for controlling the write operation is as follows. The functions used and their explanations are listed below.
① Send Start condition + slave address + write bit:
LPI2C_MasterStart:スタート信号とスレーブアドレスを送信。
This function initiates a new master mode transfer.
② Send the register address and data of the target device:
LPI2C_MasterSend:I²Cバスにデータを送信。
This function waits until the data in the buffer is sent.
③ Send Stop condition:
LPI2C_MasterStop:I²Cバスにストップ信号を送信。
This function waits until a stop signal is sent, and the transaction
Wait until it finishes.
[Read control]
The procedure for Read control is as follows. The functions used and their explanations are also listed here.
① Send Start condition + slave address + write bit:
LPI2C_MasterStart:スタート信号とスレーブアドレスを送信。
This function initiates a new master mode transfer.
② Send the register address of the target device:
LPI2C_MasterRepeatedStart:LPI2C_MasterStart を再度実行する。
This function typically sends a register address.
③ Send Start condition + slave address + read bit:
LPI2C_MasterReceive:I²Cバスからデータを受信。
This function waits until the data in the buffer has been transferred.
④ Receive data from the target device:
LPI2C_MasterSend:I²Cバスにデータを送信。
This function waits until the data in the buffer is sent.
⑤ Send Stop condition:
LPI2C_MasterStop:I²Cバスにストップ信号を送信。
This function waits until a stop signal is sent and until the transaction is completed.
A flowchart for the sample program "lpi2c_edma_b2b_polling_master" is included in the supplementary explanation at the end of the last chapter. Please refer to it.
Furthermore, while explanations of the functions used can be found in the MCX A153 API Reference , we have extracted the explanations of the functions used in this example into the supplementary explanations at the end of the last chapter. Please refer to this as well.
5.2 Pin Configuration
By default, the P3T1755 is connected to the I3C0 pin of the I3C module, so you need to change this to the LPI2C pin. To change the pin connections, you can use the convenient Pin Configurator function within the Config Tools tool. The Pin Configurator allows you to change pin assignments via a GUI and even automatically generates C language code for you. The specific operation will be explained in detail in the practical exercises chapter.
5.3 Changes in the program code
The basic communication flow is the same as the sample, but the slave address, register address, and data length are changed to match the P3T1755. Furthermore, the received 16-bit value is converted to temperature.
First, change the slave address to 0x48U of P3T1755.
The sample program handles 33 bytes of data, but the P3T1755 uses 16-bit temperature data, so we will change the data length to 16 bits.
We define a constant to store the 16-bit temperature data read from the P3T1755. Here, we'll call it "temperature".
The register address is defined by deviceAddress, which is 0x01U, but in the case of P3T1755 it is 0x00U.
The number of data points to transfer is defined by txCount, which is 0xFFU in the sample program, but since the temperature data read from the P3T1755 is 2 bytes (16 bits), we reduce it to 0x01U.
In the sample program, the master sends data and the slave sends the same data back, and then a comparison of the transmitted and received data is performed, but this process is unnecessary.
Instead, it is necessary to process the data received from the P3T1755 into temperature data. The data received from the P3T1755 is 2 bytes (16 bits). The receive buffer is defined as g_master_rxBuff[1] and g_master_rxBuff[0], each containing 1 byte, so g_master_rxBuff[0] is used as the upper byte and g_master_rxBuff[1] as the lower byte, and they are combined into 16 bits. The combined result is stored in temp.
Each bit of the combined temperature data corresponds to 0.0625°C, so multiplying by 0.0625 gives the temperature. Fortunately, multiplying by 0.0625 can be easily calculated by shifting 4 bits to the right, without using floating-point arithmetic. The calculation result is entered into the 'temperature' field.
Finally, display the host using printf.
6. Practical Training
This chapter focuses on the necessary hardware preparations and the points where you need to modify the code for the P3T1755, rather than detailing tool installation or screen operations.
6.1 Practical Training Content
This method reads the P3T1755 temperature sensor mounted on the FRDM-MCXA153 using LPI2C. Since the P3T1755 is initially connected to I3C0, pin configuration is required to connect it to LPI2C. Additionally, a pull-up resistor must be added to the I3C signal line.
The software is based on the LPI2C SDK sample, with modifications to the calculation process for the P3T1755's slave address, register address, data length, and temperature data.
6.2 Practical Training Procedure (Overview)
Connect 4.7kΩ pull-up resistors to the SDA and SCL pins of the evaluation board.
Prepare a sample LPI2C project in the MCUXpresso environment. Specific installation and import procedures are omitted.
Change the pin settings to the LPI2C pins to which the P3T1755 is connected.
The following code changes will be made as shown in Section 6.7.
Run the program and verify that a temperature value is output.
6.3 Add pull-up resistors to the evaluation board
The P3T1755 has Junction PAs (J20, J21) on its I²C line. Connect 4.7kΩ resistors to J20 and J21, and pull up SDA and SCL.
important!
The built-in pull-up resistor may not provide stable communication depending on the board. To ensure reliable communication, please use an external pull-up resistor.
6.4 Coding the changes
We will now code the concepts explained in the programming chapter into an actual .c file.
We will now implement the changes described in "5.3 Changes to the Program Code" into the code.
(1) Change the slave address to 0x48U of P3T1755.
[変更前]#define LPI2C_MASTER_SLAVE_ADDR_7BIT 0x7EU
[変更後]#define LPI2C_MASTER_SLAVE_ADDR_7BIT 0x48U
(2) Change the data length to 16 bits.
[変更前]#define LPI2C_DATA_LENGTH 33U
[変更後]#define LPI2C_DATA_LENGTH 2U
(3) Define a constant `temperature` to store the 16 bits of temperature data read from the P3T1755.
[追加]uint16_t temperature;
(4) Change the register address deviceAddress to 0x00U.
[変更前]uint8_t deviceAddress = 0x01U;
[変更後]uint8_t deviceAddress = 0x00U;
(5) Change the number of data to be transferred, txCount, to 0x01U.
[変更前]size_t txCount = 0xFFU;
[変更後]size_t txCount = 0x01U;
(6) Adjustment of the number of received data
[変更前]reVal = LPI2C_MasterReceive(EXAMPLE_I2C_MASTER, g_master_rxBuff, LPI2C_DATA_LENGTH - 1);
[変更後]reVal = LPI2C_MasterReceive(EXAMPLE_I2C_MASTER, g_master_rxBuff, LPI2C_DATA_LENGTH);
(7) Remove the section comparing the transmitted data and the received data.
[削除] /* Transfer completed. Check the data.*/以下のコード
(8) The data received from P3T1755 is combined into temperature data. The upper byte of g_master_rxBuff[0] and the lower byte of g_master_rxBuff[1] are combined into a 16-bit array, and the combined result is stored in temp.
[追加] temp = (((uint16_t) g_master_rxBuff[0] << 8U) | (uint16_t) g_master_rxBuff[1]) >> 4U;
(9) Shift temp to the right by 4 bits and put it into temperature.
[追加]temperature = temp >> 4;
(10) Display the temperature using printf.
[追加] PRINTF("Temperature=%d", temperature);
PRINTF("Celsius");
(11) Finally, we'll add an infinite loop.
[追加]while (1) {}
The complete code reflecting the changes made so far is shown below for reference.
[All Code]
/*
* Copyright 2017 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
/* Standard C Included Files */
#include
#include
#include "board.h"
#include "fsl_debug_console.h"
#include "fsl_lpi2c.h"
#include "app.h"
/*******************************************************************************
* Definitions
******************************************************************************/
#define EXAMPLE_I2C_MASTER ((LPI2C_Type *)EXAMPLE_I2C_MASTER_BASE)
#define LPI2C_MASTER_SLAVE_ADDR_7BIT 0x48U
#define LPI2C_BAUDRATE 100000U
#define LPI2C_DATA_LENGTH 2U
/*******************************************************************************
* Prototypes
******************************************************************************/
/*******************************************************************************
* Variables
******************************************************************************/
uint8_t g_master_txBuff[LPI2C_DATA_LENGTH];
uint8_t g_master_rxBuff[LPI2C_DATA_LENGTH];
uint16_t temp; /* 追加 */
uint16_t temperature; /* 追加 */
/*******************************************************************************
* Code
******************************************************************************/
/*!
* @brief Main function
*/
int main(void)
{
lpi2c_master_config_t masterConfig;
status_t reVal = kStatus_Fail;
uint8_t deviceAddress = 0x00U;
size_t txCount = 0x01U;
BOARD_InitHardware();
/* Set up i2c master to send data to slave*/
/* First data in txBuff is data length of the transmiting data. */
g_master_txBuff[0] = LPI2C_DATA_LENGTH - 1U;
for (uint32_t i = 1U; i < LPI2C_DATA_LENGTH; i++)
{
g_master_txBuff[i] = i - 1;
}
for (uint32_t i = 0U; i < LPI2C_DATA_LENGTH - 1U; i++)
{
if (i % 8 == 0)
{
}
}
/*
* masterConfig.debugEnable = false;
* masterConfig.ignoreAck = false;
* masterConfig.pinConfig = kLPI2C_2PinOpenDrain;
* masterConfig.baudRate_Hz = 100000U;
* masterConfig.busIdleTimeout_ns = 0;
* masterConfig.pinLowTimeout_ns = 0;
* masterConfig.sdaGlitchFilterWidth_ns = 0;
* masterConfig.sclGlitchFilterWidth_ns = 0;
*/
LPI2C_MasterGetDefaultConfig(&masterConfig);
/* Change the default baudrate configuration */
masterConfig.baudRate_Hz = LPI2C_BAUDRATE;
/* Initialize the LPI2C master peripheral */
LPI2C_MasterInit(EXAMPLE_I2C_MASTER, &masterConfig, LPI2C_MASTER_CLOCK_FREQUENCY);
/* Send master start bit &Slave Address + Write Bit */
if (kStatus_Success == LPI2C_MasterStart(EXAMPLE_I2C_MASTER, LPI2C_MASTER_SLAVE_ADDR_7BIT, kLPI2C_Write))
{
LPI2C_MasterGetFifoCounts(EXAMPLE_I2C_MASTER, NULL, &txCount);
while (txCount)
{
LPI2C_MasterGetFifoCounts(EXAMPLE_I2C_MASTER, NULL, &txCount);
}
if (LPI2C_MasterGetStatusFlags(EXAMPLE_I2C_MASTER) & kLPI2C_MasterNackDetectFlag)
{
return kStatus_LPI2C_Nak;
}
reVal = LPI2C_MasterSend(EXAMPLE_I2C_MASTER, &deviceAddress, 1);
if (reVal != kStatus_Success)
{
if (reVal == kStatus_LPI2C_Nak)
{
LPI2C_MasterStop(EXAMPLE_I2C_MASTER);
}
return -1;
}
reVal = LPI2C_MasterSend(EXAMPLE_I2C_MASTER, g_master_txBuff, LPI2C_DATA_LENGTH);
if (reVal != kStatus_Success)
{
if (reVal == kStatus_LPI2C_Nak)
{
LPI2C_MasterStop(EXAMPLE_I2C_MASTER);
}
return -1;
}
reVal = LPI2C_MasterStop(EXAMPLE_I2C_MASTER);
if (reVal != kStatus_Success)
{
return -1;
}
}
for (uint32_t i = 0U; i < WAIT_TIME; i++)
{
__NOP();
}
if (kStatus_Success == LPI2C_MasterStart(EXAMPLE_I2C_MASTER, LPI2C_MASTER_SLAVE_ADDR_7BIT, kLPI2C_Write))
{
/* Check master tx FIFO empty or not */
LPI2C_MasterGetFifoCounts(EXAMPLE_I2C_MASTER, NULL, &txCount);
while (txCount)
{
LPI2C_MasterGetFifoCounts(EXAMPLE_I2C_MASTER, NULL, &txCount);
}
/* Check communicate with slave successful or not */
if (LPI2C_MasterGetStatusFlags(EXAMPLE_I2C_MASTER) & kLPI2C_MasterNackDetectFlag)
{
return kStatus_LPI2C_Nak;
}
reVal = LPI2C_MasterSend(EXAMPLE_I2C_MASTER, &deviceAddress, 1);
if (reVal != kStatus_Success)
{
if (reVal == kStatus_LPI2C_Nak)
{
LPI2C_MasterStop(EXAMPLE_I2C_MASTER);
}
return -1;
}
reVal = LPI2C_MasterRepeatedStart(EXAMPLE_I2C_MASTER, LPI2C_MASTER_SLAVE_ADDR_7BIT, kLPI2C_Read);
if (reVal != kStatus_Success)
{
return -1;
}
reVal = LPI2C_MasterReceive(EXAMPLE_I2C_MASTER, g_master_rxBuff, LPI2C_DATA_LENGTH);
if (reVal != kStatus_Success)
{
if (reVal == kStatus_LPI2C_Nak)
{
LPI2C_MasterStop(EXAMPLE_I2C_MASTER);
}
return -1;
}
reVal = LPI2C_MasterStop(EXAMPLE_I2C_MASTER);
if (reVal != kStatus_Success)
{
return -1;
}
}
for (uint32_t i = 0U; i < LPI2C_DATA_LENGTH; i++)
{
if (i % 8 == 0)
{
}
}
temp = (((uint16_t) g_master_rxBuff[0] << 8U) | (uint16_t) g_master_rxBuff[1]) >> 4U;
temperature = temp >> 4;
PRINTF("Temperature=%d", temperature);
PRINTF("Celsius");
while (1)
{
}
}
6.5 Change the pin settings using the PIN Configurator
We will reconnect the I3C port currently connected to the P3T1755 to the LPI2C port . This is done using the Pin Configurator tool within MCUXpresso Config Tools , rather than modifying the program code.
First, we will disable the default settings of pins 33 and 34 , which are LPI2C0_SDA and LPI2C0_SCL . In the Pins tab, scroll down to display pins 33 and 34. Then, scroll to the right to display the LPI2C column. Clicking on LPI2C0_SDA and LPI2C0_SCL , respectively, displayed in the LPI2C column for pins 33 and 34 will disable pins 33 and 34 .
Next, in the Pins tab, assign pin 54 to LPI2C0_SDA . Clicking the checkbox for pin 54 will display all the functions assigned to that pin. Select LPI2C0:SDA from the list. Pin 54 in the Pins tab will then turn green. Click " Done " to complete the assignment.
Similarly, in the Pins tab, assign pin 55 to LPI2C0_SCL . Click the checkbox for pin 55 and select LPI2C0:SCL . Pin 55 in the Pins tab will then turn green. Click " Done " to complete the assignment.
Next, we will configure the functions of pins 54 and 55. To configure the functions, use " Routing Details for… " located at the bottom.
In Routing Details for…, change the Pull Select for pins 54 ( LPI2C0_SDA ) and 55 ( LPI2C0_SCL ) to Pullup , and change Pull enable to Enabled . If you set the Label to I2C_SDA and I2C_SCL , then in board/pin_mux.hIt adds a definition to it.
The pin configuration is now complete.
To reflect the changes made so far in the code, click the Update Code button.
6.6 Build & Debug, Test Functionality
Once you've finished changing the code, build it.
When you hover your cursor over "Projects," a build button will appear. Clicking it will build the project.
If you see the message " build finished successfully, " then it's OK .
Next to the build button, there's a debug button. Clicking this will enter debug mode.
When you enter debug mode, the program stops at the breakpoint, so click the " |▶ " icon at the top of the screen. The program will then run.
The temperature will be displayed on the Tera Term screen.
summary
This article explained the basic I²C communication method and the main functions of the LPI2C module installed in the MCX A153. It also demonstrated how to add pull-up resistors, configure pins using the Pin Configurator, and modify the LPI2C SDK sample code, using the P3T1755 temperature sensor installed in the FRDM-MCXA153 as an example. In I²C communication, it is crucial to configure the slave address, register address, and data length according to the specifications of the connected device. Please use the information in this article to apply it to communication with various I²C devices such as sensors and EEPROMs.
=========================
We are currently unable to respond to comments left in the " Comment " section of this post . We apologize for the inconvenience, but please refer to " Technical Questions to NXP - How to Contact Us( Japanese Blog) " when making inquiries.(If you are already an NXP distributor or have a relationship with NXP, you may ask your representative directly.)
This article focuses on the LPI2C (Low Power Inter-Integrated Circuit) controller included in the NXP microcontroller MCX A153. After reviewing the basics of I²C, we will explain the differences between I²C and LPI2C, and then learn about the specifications and usage of the LPI2C on the MCX A153.
(Reading time: 30 minutes) MCUXpresso IDE MCUXpresso SDK MCX Japanese Blog
View full article