Hi,
I'm using S32 DS for Platform and RTD version 3.0.0 and I'm working on S32K324 controller.
In the reference manual I saw this example timing configurations table
Here three different frequencies such as 8MHz, 48MHz and 60MHz are used.
But how to change the frequency for I2C in the Configurator tool?
As it has already 40MHz set I can't be able to change it.
Or else tell me how to set the baud rate 400kbit/s, 100kbit/s and 1Mbit/s with the 40MHz frequency,
Tagging my colleague also in this post for reference, @LavanyaR
Hi @Riyasma07 and @LavanyaR
To change the I2C clock frequency the changes to the clock configuration need to be done to the AIPS_PLAT_CLK following the restrictions shown in the attached image.
If you want to set the desired baud rate with the 40MHz frequency, this is calculated as Frequency/(((CLKLO+CLKHI+2)*2^PRESCALER)+ROUNDDOWN((2+FILTSCL)/2^PRESCALER)). This considering that the function Flexio_I2c_Ip_MasterSetBaudRate_Activity sets the baud rate (SCL frequency) for the I2C master. Note that due to module limitations, not any baud rate can be achieved. The driver will set a baud rate as close as possible to the requested baud rate, but there may still be substantial differences.
B.R.
VaneB
Hi @VaneB,
I've done that too. I've set clock as 48000000 and Baud rate as 400000 and I've checked the baud rate using the GetBaudRate function and the baud rate was 400000. But the problem is, when using I2c interrupt method we were getting busy status and when using I2c blocking method we were getting timeout error. What would be the problem?
Hi @Riyasma07
Please help me by clarifying the following. By default, the configurations made in ConfigTools for the I2C driver as a master are made in the struct called "I2c_Lpi2cMasterChannel0_VS_0", but I saw in your code that you use one called "I2c_Lpi2c_CustomConfig". Just to confirm, did you change the functional group name in ConfigTools?
Also, I saw in the ConfigTools image that you configured the I2C Operating Mode as "LPI2C_STANDARD_MODE", but in the function Lpi2c_Ip_MasterSetBaudRate, the I2C operating mode is LPI2C_FAST_MODE.
Hi @VaneB,
Any updates??