AnsweredAssumed Answered

Setting i2c/SPI baud rate on rt1050?

Question asked by Jack King on Jul 18, 2018
Latest reply on Jul 26, 2018 by Jack King

I'm trying to set my i2c bus to run at 1MHz, but it seems to be running at 200kHz max.

 

I am using the rt1050 EVK and the following to set the clock (based on the SDK example):

 

/* Select USB1 PLL (480 MHz) as master lpi2c clock source */
#define LPI2C_CLOCK_SOURCE_SELECT (0U)
/* Clock divider for master lpi2c clock source */
#define LPI2C_CLOCK_SOURCE_DIVIDER (1U)
/* Get frequency of lpi2c clock */
#define LPI2C_CLOCK_FREQUENCY ((CLOCK_GetFreq(kCLOCK_Usb1PllClk) / 8) / (LPI2C_CLOCK_SOURCE_DIVIDER + 1U))



#define LPI2C_MASTER_CLOCK_FREQUENCY LPI2C_CLOCK_FREQUENCY



#define I2C_BAUDRATE 1000000U

...

LPI2C_MasterGetDefaultConfig(&masterConfig);
/* Change the default baudrate configuration */
masterConfig.baudRate_Hz = I2C_BAUDRATE;
LPI2C_MasterInit(EXAMPLE_LPI2C_MASTER_BASEADDR, &masterConfig, LPI2C_MASTER_CLOCK_FREQUENCY);

 

Am I doing something incorrectly?

 

Thanks

Outcomes