I2C internal Freq (Multiplier Factor)

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

I2C internal Freq (Multiplier Factor)

Jump to solution
772 Views
jacewalton
Contributor III

Using MK22FX512VLK12 chip programming with P&E micro Multilink universal Programmer 

I am Trying to get the I2C bus working.

nothing is sent across the data or clock lines. I looked on my Oscilloscope and nothing happens. 

I am using the code from "typical usage section under "Help on Component"

Component documentation - Typical Usage

volatile bool DataReceivedFlg = FALSE; volatile bool DataTransmittedFlg = FALSE; uint8_t OutData[4] = {0x00U, 0x01U, 0x02U, 0x03U};                /* Initialization of output data buffer */ uint8_t InpData[16]; LDD_TError Error; LDD_TDeviceData *MyI2CPtr;  void main(void) {   . . .   MyI2CPtr = I2C2_Init(NULL);                                     /* Initialization of I2C2 component */   /* Configure I2C BUS device(e.g. RTC) - Write Operation */   Error = I2C2_MasterSendBlock(MyI2CPtr, OutData, 4U, LDD_I2C_SEND_STOP); /* Send OutData (4 bytes) on the I2C bus and generates a stop condition to end transmission */   while (!DataTransmittedFlg) {                                   /* Wait until OutData are transmitted */   }   DataTransmittedFlg = FALSE;    /* Read configuration of I2C BUS device(e.g. RTC) - Read Operation */   OutData[0] = 0x00U;                                             /* Initialization of OutData buffer */   Error = I2C2_MasterSendBlock(MyI2CPtr, OutData, 1U, LDD_I2C_NO_SEND_STOP); /* Send OutData (1 byte) on the I2C bus stop condition and will not generate the end of the transmission */   while (!DataTransmittedFlg) {                                   /* Wait until OutData are transmitted */   }   DataTransmittedFlg = FALSE;    Error = I2C2_MasterReceiveBlock(MyI2CPtr, InpData, 16U, LDD_I2C_SEND_STOP); /* Receive InpData (16 bytes) from the I2C bus and generates a stop condition to end transmission */   while (!DataReceivedFlg) {                                      /* Wait until InpData are received */   }   DataReceivedFlg = FALSE;    for(;;) {} }

In the Processor expert  under I2C channel 1 the interal frewquency is sent t 5.24288 Mhz this is the lowest frequency that I could select.  Here is a picture There is a warning that this device is designed to operate at 100k could this be my problem? 

 

175330_175330.pngpastedImage_6.png

This is the lowest frequency that I could choose

175337_175337.pngpastedImage_7.png

Labels (1)
0 Kudos
1 Solution
557 Views
jacewalton
Contributor III

Found the problem look above where I had circled in the original post you can select a clock divider 

View solution in original post

0 Kudos
3 Replies
557 Views
harshpatel
Contributor IV

Thats good...

0 Kudos
558 Views
jacewalton
Contributor III

Found the problem look above where I had circled in the original post you can select a clock divider 

0 Kudos
557 Views
harshpatel
Contributor IV

Hello Jace Walton

Can you share your full code/I2c part of your code? it may easy to fix issue.

Thanks & regards

Harsh

0 Kudos