How to Configure LPC55S16 I2C to Fast Mode Plus

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to Configure LPC55S16 I2C to Fast Mode Plus

1,324 Views
kwf
Contributor III

Hi Community

I download I2C example from SDk 1.10.1

The goal is 1Mbis/s I2c communication.

 I notice that the I2C Fast mode Plus has specified  pin Type I  PIO0_13 and PIO0_14.

Modify the example to PIO0_13 and PIO0_14 which is FLEXCOMM1.

When I configured Pin. And configure associate module configuration. 

The I2C result as below, The SCL clock is 800KHz,but the SDA data is right.

Is I2C Fast Mode Plus need configured something ? 

 kwf_0-1639563146894.png

 

0 Kudos
4 Replies

1,310 Views
PabloAvalos
NXP TechSupport
NXP TechSupport

Hi, @kwf 

 

I am so glad for your patience.

 

Hoping you are well, I would like to know, if it is not an inconvenience for you, to share with me your code snippet about the configuration of FLEXCOMM1 as I2C in fast mode plus, so I can help you more personalizedly.
Also, I would like to know if you tried to configure all the pin and the associate module by using the config tools (pin, clocks and perfipheral config.) from our MCUXpresso IDE? Because it might be helpful.

 

Hoping you have an excellent weekend, I'll stay tuned for your reply so I can help you with.

 

Please let me know if you have more questions.

 

Sincerely,

Pablo Avalos.

0 Kudos

1,298 Views
kwf
Contributor III

Hi PabloAvalos

The attachment is my I2C code, modified base on SDK example.

The SDK Version is 2.10.1 and IED Version 11.3.0.

I had try modify CLOCK_AttachClk to different clock soure, but the I2C result still same 800KHz.

I noticed in the fsl_i2c.c has enum i2c_slave_bus_speed_t when slave initial can be configure kI2C_SlaveFastModePlus.

Is it fast mode plue only configured on slave mode?

Tags (1)
0 Kudos

1,285 Views
kwf
Contributor III

Hi Community

I found the cause what the I2C can not output 1MHz.

I tried configure the flexcom1 through MCUXpresso Config tool.

Configured clock to flexcom1, it call API CLOCK_SetClkDiv with kCLOCK_DivFlexFrg1.

It's different with SDK example. It is necessary to configure  CLOCK_SetClkDiv ?

Or, it is necessary configuration to Fast mode plus?

kwf_0-1640244310865.png

 

0 Kudos

1,255 Views
PabloAvalos
NXP TechSupport
NXP TechSupport

Hi @kwf 

 

Due to holidays, the replies were delayed. Hope you are having happy holiday too.

 

I was checking your code and I realized that you missed to enable the FRG1 (Free Running Generator) that is needed to have the clock of 12MHz activated for FlexComm1 (selecting the option of FRO 12MHz Clock in the column value), so the answer is Yes, it is necessary to configure CLOCK_SetClkDiv for having Fast Mode Plus.
You can check the changes that can be implemented right here:

PabloAvalos_1-1640903709742.png

 

 

Regarding your question about if fast mode plus is only possible on slave mode, the answer is no, you can set this bus speed for both modes, as master or as slave. Only for High-speed mode (3.4Mbit/s) is possible on slave mode.

 

Hoping this information could be helpful, please let me know if you have more questions.

 

Best Regards.

Pablo Avalos.

0 Kudos