As mentioned in the original post, measurement of the I3C pins on an oscilloscope shows that they remain LOW even after the pin initialization is executed (with Open Drain, and Pullup enabled). As a result, when I try to execute a transfer, I3C_MasterTransferBlocking returns kStatus_I3C_Busy (because the masterState was detected to be kI3C_MasterStateSlvReq, i.e. slave holding SDA low). However, I believe that it is not the slave holding SDA low, but that the MCXA has failed to configure the I3C pins as open drain (both SDA and SCL remain low).
I've attached a minimum working example.
I noticed that the i3c_master_enable_t included in fsl_i3c.h does not include an enumeration for I2C Controller mode (MSTENA = 0b11). Is this a problem?
Lastly, the description of I2CBAUD in the Reference Manual with regards to how the I2C baudrate is calculated is quite unclear. From the manual:
I2C Baud Rate
Specifies the I2C low and high times in ODBAUD counts:
- I2CBAUD >> 1 is the main count load, and it is count - 1. So, I2CBAUD >> 1: I2CBAUD = 0 for one ODBAUD beat and I2CBAUD = 1 for two ODBAUD beats.
- If I2CBAUD[28] is 1, then the low time has one extra ODBAUD beat. The I2CBAUD field is normally 3, where ODBAUD gives 200 ns. For I2CBAUD >> 1, I2CBAUD = 1, which means two ODBAUD beats. To meet the requirements for Fast-mode Plus (Fm+), (2 + 1) * 200 = 600 ns low, with 2 * 200 = 400 ns high for 1 μs period. For Fast mode (Fm), I2CBAUD is normally 11 (giving 2.6 μs) or 6 (giving 2.4 μs).
Should I understand this to mean the following:
T_low_I2C = ((I2CBAUD >> 1) + 1 + (I2CBAUD & 0x1)) * T_ODBAUD
T_high_I2C = ((I2CBAUD >> 1) + 1) * T_ODBAUD
which implies:
T_I2C = (2 + 2*(I2CBAUD >> 1) + (I2CBAUD & 0x1)) * T_ODBAUD
This works for the example of I2CBAUD = 11, but not for I2CBAUD = 6. However, in the attached project I have configured the following:
- FCLK = 24 MHz (I3CFCLKDIV = 4)
- Push-Pull baudrate = 2 MHz
- Open-Drain baudrate = 500 kHz
- I2C baudrate = 100 kHz
I can see from the Peripherals that
- PPBAUD = 5
- ODBAUD = 3
- I2CBAUD = 8
Since the I2C baudrate is 5x slower than the OD baudrate, this suggests that
T_I2C = ((I2CBAUD >> 1) + 1) * T_ODBAUD
But this calculation doesn't agree with any of the examples in the Reference Manual.
Can you help me understand where my calculation is wrong so that I may figure out the I2CBAUD settings (and related clock frequencies and divisors) necessary for my application (which requires an I2C baudrate of 100 kHz)?