<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: KL05 as I2C slave in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL05-as-I2C-slave/m-p/1448837#M62976</link>
    <description>&lt;P&gt;Thanks for your reply, but I'm not sure how it helps me?&lt;/P&gt;&lt;P&gt;The KL05 that I'm having trouble with does not have double-buffered I2C.&lt;BR /&gt;It also does not have a start condition interrupt event/flag.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Apr 2022 02:40:31 GMT</pubDate>
    <dc:creator>mwp_nxp</dc:creator>
    <dc:date>2022-04-26T02:40:31Z</dc:date>
    <item>
      <title>KL05 as I2C slave</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL05-as-I2C-slave/m-p/1447806#M62943</link>
      <description>&lt;P&gt;Greetings all,&lt;/P&gt;&lt;P&gt;I've been battling this for a while and not getting too far.&lt;/P&gt;&lt;P&gt;The problem is the KL05 receives the correct address from the master, ACKs it, then something very odd happens to the following byte. I have not been able to work out why.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;A KL03 used to work perfectly in the KL05's place (using the KL05 now due to parts shortages).&lt;/P&gt;&lt;P&gt;The KL05 is running off the internal clock at 20Mhz, the bus clock div is 1 (also 20Mhz).&lt;/P&gt;&lt;P&gt;Attached is a image of the I2C signals. The address byte, and then the odd first data byte.&lt;/P&gt;&lt;P&gt;The pins and I2C peripheral are setup as following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;	//i2c pin setup
	PORTA-&amp;gt;PCR[4] = PORT_PCR_MUX(0x02);
	PORTA-&amp;gt;PCR[3]  = PORT_PCR_MUX(0x02);
	//setup i2c hardware slave
	CLOCK_EnableClock(kCLOCK_I2c0);
	//set slave addr, no ranage
	I2C0-&amp;gt;A1 = 0x38 &amp;lt;&amp;lt; 1U;
	I2C0-&amp;gt;RA = 0;
	I2C0-&amp;gt;C2 = 0;
	//speed (I2C speed of master is ~315kHz)
	I2C0-&amp;gt;F = I2C_F_MULT(0) | I2C_F_ICR(6);
	//glitch filter value, stop hold enable, and stop int
	I2C0-&amp;gt;FLT = I2C_FLT_FLT(0) | I2C_FLT_STOPF_MASK | I2C_FLT_STOPIE_MASK;
    //reset all flags
	I2C0-&amp;gt;S = 0xFFU;
    //enable slave, and slave int
	I2C0-&amp;gt;C1 = I2C_C1_IICEN_MASK | I2C_C1_IICIE_MASK;
    //enable
    NVIC_SetPriority(I2C0_IRQn, 1);
    EnableIRQ(I2C0_IRQn);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The interrupt handler looks like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void I2C0_IRQHandler(void)
{
	//I2C IRQ handler
	volatile uint8_t data = 0;
	volatile uint8_t status;
	bool doTransmit = false;
	static bool isBusy = false;

	//read flags
	status = I2C_SlaveGetStatusFlags(I2C0);

	//clear interrupt service flag
	I2C0-&amp;gt;S = I2C_S_IICIF_MASK;

	//arbitration lost?
	if (status &amp;amp; I2C_S_ARBL_MASK)
	{
		//clear ARBL
		I2C0-&amp;gt;S = I2C_S_ARBL_MASK;
		//set receive mode
		I2C0-&amp;gt;C1 &amp;amp;= ~(I2C_C1_TX_MASK | I2C_C1_TXAK_MASK);
		//nothing more to do
		return;
	}

	//check NAK
	if (status &amp;amp; I2C_S_RXAK_MASK)
	{
		//set receive mode
		I2C0-&amp;gt;C1 &amp;amp;= ~(I2C_C1_TX_MASK | I2C_C1_TXAK_MASK);
		//read dummy
		data = I2C0-&amp;gt;D;
		//do something?
	}
	else
		//Check address match
		if (status &amp;amp; I2C_S_IAAS_MASK)
		{
			//slave transmit, master reading from slave
			isBusy = true;
			if (status &amp;amp; I2C_S_SRW_MASK)
			{
				//change direction to send data
				I2C0-&amp;gt;C1 |= I2C_C1_TX_MASK;
				doTransmit = true;
			}
			else
			{
				//slave receive, master writing to us
				//send ack
				I2C0-&amp;gt;C1 &amp;amp;= ~(I2C_C1_TXAK_MASK);
				//read dummy to release the bus
				data = I2C0-&amp;gt;D;
				//reset inbuf
				indatac = 0;
			}
			//do something here?
		}
		else
			//check transfer complete flag
			if (status &amp;amp; I2C_S_TCF_MASK)
			{
				if (status &amp;amp; I2C_S_SRW_MASK)
				{
					//slave transmit, master reading from slave
					doTransmit = true;
				}
				else
				{
					//slave receive, master writing to slave
					//ack
					I2C0-&amp;gt;C1 &amp;amp;= ~I2C_C1_TXAK_MASK;
					//get data
					data = I2C0-&amp;gt;D;
					indata[indatac++] = data;
				}
			}
			else
			{
				//read dummy to release bus
				data = I2C0-&amp;gt;D;
			}

	//send data if there is the need
	if (doTransmit)
	{
		//send data
		if (!sendComplete)
		{
			I2C0-&amp;gt;D = outdata[outdatac++];
		}
		else
		{
			//switch to receive mode
			I2C0-&amp;gt;C1 &amp;amp;= ~(I2C_C1_TX_MASK | I2C_C1_TXAK_MASK);
			//read dummy to release bus
			data = I2C0-&amp;gt;D;
		}
	}
	//done
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Capture.JPG" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/177730i05CB842F5397B066/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone have any ideas what's going on here?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 11:20:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL05-as-I2C-slave/m-p/1447806#M62943</guid>
      <dc:creator>mwp_nxp</dc:creator>
      <dc:date>2022-04-22T11:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: KL05 as I2C slave</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL05-as-I2C-slave/m-p/1447930#M62949</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;&lt;BR /&gt;See appendix A of &lt;A href="https://www.utasker.com/docs/uTasker/uTasker_I2C.pdf" target="_blank"&gt;https://www.utasker.com/docs/uTasker/uTasker_I2C.pdf&lt;/A&gt; for details of behavioral differences of the I2C controllers in those two parts.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 15:57:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL05-as-I2C-slave/m-p/1447930#M62949</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2022-04-22T15:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: KL05 as I2C slave</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL05-as-I2C-slave/m-p/1448837#M62976</link>
      <description>&lt;P&gt;Thanks for your reply, but I'm not sure how it helps me?&lt;/P&gt;&lt;P&gt;The KL05 that I'm having trouble with does not have double-buffered I2C.&lt;BR /&gt;It also does not have a start condition interrupt event/flag.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 02:40:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL05-as-I2C-slave/m-p/1448837#M62976</guid>
      <dc:creator>mwp_nxp</dc:creator>
      <dc:date>2022-04-26T02:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: KL05 as I2C slave</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL05-as-I2C-slave/m-p/1448873#M62977</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;But your correctly working KL03 &lt;U&gt;does&lt;/U&gt; have double-buffered I2C so you need to see how the two types differ in order to possibly detected what your problem is in the KL05 case.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 03:10:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL05-as-I2C-slave/m-p/1448873#M62977</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2022-04-26T03:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: KL05 as I2C slave</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL05-as-I2C-slave/m-p/1448881#M62978</link>
      <description>&lt;P&gt;Mark, yes the KL03 does.&lt;/P&gt;&lt;P&gt;I gave up attempting to use the KL03 code (old FSL libs) some time ago.&lt;/P&gt;&lt;P&gt;I'm now handling the KL05's interrupt handling myself (as in the above code).&lt;BR /&gt;I cant work out why the KL05 isnt ACK'ing or triggering an interrupt after the first byte after the address is sent.&amp;nbsp; After the address is handled correctly (as far as i can tell), C1/S are correctly set.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 03:23:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL05-as-I2C-slave/m-p/1448881#M62978</guid>
      <dc:creator>mwp_nxp</dc:creator>
      <dc:date>2022-04-26T03:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: KL05 as I2C slave</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL05-as-I2C-slave/m-p/1448920#M62979</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;This is the basic slave driver from the uTasker project (when running on a non-double buffered KL part) - maybe you can find something that explains your difficulty (I just show handling a master write)&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;Initialisation code:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;POWER_UP_ATOMIC(4, I2C0);                                    // enable clock to module
fnEnterInterrupt(irq_I2C0_ID, PRIORITY_I2C0, _I2C_Interrupt_0); // enter I2C0 interrupt handler
ptrI2C-&amp;gt;I2C_A1 = pars-&amp;gt;ucSlaveAddress;                       // program the slave's address
_CONFIG_PERIPHERAL(A, 4,  (PA_4_I2C0_SDA | PORT_ODE | PORT_PS_UP_ENABLE)); // I2C0_SDA on PA4 (alt. function 2)
_CONFIG_PERIPHERAL(A, 3,  (PA_3_I2C0_SCL | PORT_ODE | PORT_PS_UP_ENABLE)); // I2C0_SCL on PA3 (alt. function 2)
ptrI2C-&amp;gt;I2C_F = 0;                                           // slave doesn't have a specific speed programmed
ptrI2C-&amp;gt;I2C_C1 = (I2C_IEN);                                  // enable I2C controller
ptrI2C-&amp;gt;I2C_C1 |= I2C_IIEN;                                  // immediately enable interrupts if operating as a slave
ptrI2C-&amp;gt;I2C_FLT = I2C_FLT_FLT_STOPIE;                        // enable stop condition interrupt&lt;/LI-CODE&gt;&lt;P&gt;Interrupt handling code:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;if ((ptrI2C-&amp;gt;I2C_FLT &amp;amp; I2C_FLT_FLT_INT) != 0) {              // if the slave has enabled start/stop condition interrupt(s)
    if ((ptrI2C-&amp;gt;I2C_FLT &amp;amp; I2C_FLT_FLT_STOPF) != 0) {        // if a stop condition has been detected
        WRITE_ONE_TO_CLEAR(ptrI2C-&amp;gt;I2C_FLT, I2C_FLT_FLT_STOPF); // clear the stop flag (write '1' to clear) [note that if the start flag is also set, it is also cleared by this action]
        WRITE_ONE_TO_CLEAR(ptrI2C-&amp;gt;I2C_S, I2C_IIF);          // clear the interrupt flag (write '1' to clear)
        if ((ptrI2C-&amp;gt;I2C_S &amp;amp; (I2C_IAAS | I2C_TCF)) != (I2C_IAAS | I2C_TCF)) { // if the slave is already addressed we allow the reception handling to continue since we will have cleared the reception interrupt
            return;
        }
    }
}
WRITE_ONE_TO_CLEAR_INTERRUPT(ptrI2C-&amp;gt;I2C_S, I2C_IIF, irq_I2C0_ID); // clear the interrupt flag (write '1' to clear)
if (ptrI2C-&amp;gt;I2C_F == 0) {                                    // if we are slave
    if ((ptrI2C-&amp;gt;I2C_S &amp;amp; I2C_IAAS) != 0) {                   // if being addressed as a slave
        if ((ptrI2C-&amp;gt;I2C_S &amp;amp; I2C_SRW) != 0) {                // if the master is addressing for a read
            ....
        }
        else {                                               // addressed for write
            unsigned char ucAddress;
            ptrI2C-&amp;gt;I2C_C1 = (I2C_IEN | I2C_IIEN);           // write to C1 in order to clear the IAAS flag - remain in receive mode (a write to I2C_C1 clears IAAS)
            ucAddress = ptrI2C-&amp;gt;I2C_D;                       // dummy read (this reads out address as addressed)
        }
    }
    else {                                                   // data being received from master
        unsigned char ucRxData = ptrI2C-&amp;gt;I2C_D;              // read data byte
        return;
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 04:50:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL05-as-I2C-slave/m-p/1448920#M62979</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2022-04-26T04:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: KL05 as I2C slave</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL05-as-I2C-slave/m-p/1448961#M62980</link>
      <description>&lt;P&gt;Mark,&lt;/P&gt;&lt;P&gt;Thanks a lot for providing the snippet Mark.&lt;BR /&gt;Unfortunately implementing a very similar i2c handling int changes nothing. I still end up with the same lack of int/ack after the sent data byte.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;	//i2c pin setup
	BOARD_INITPINS_EVE_CTP_SDA_PORT-&amp;gt;PCR[BOARD_INITPINS_EVE_CTP_SDA_PIN] = PORT_PCR_MUX(0x02);
	BOARD_INITPINS_EVE_CTP_SCL_PORT-&amp;gt;PCR[BOARD_INITPINS_EVE_CTP_SCL_PIN] = PORT_PCR_MUX(0x02);
    //i2c NVIC setup
    NVIC_SetPriority(I2C0_IRQn, 1);		//set i2c0 int priority
    EnableIRQ(I2C0_IRQn);				//enable int
	//setup i2c hardware slave
	CLOCK_EnableClock(kCLOCK_I2c0);		//enable i2c clock
	I2C0-&amp;gt;A1 = 0x38 &amp;lt;&amp;lt; 1U;				//set our slave address
	I2C0-&amp;gt;RA = 0;						//no addr range
	I2C0-&amp;gt;C2 = 0;
	I2C0-&amp;gt;SMB = 0;						//no smbus use
	//speed (I2C speed of master is ~315kHz)
	I2C0-&amp;gt;F = 0;						//set speed
    I2C0-&amp;gt;S = 0xFFU;					//reset all flags
	I2C0-&amp;gt;C1 = I2C_C1_IICEN_MASK;		//enable i2c peripheral
	I2C0-&amp;gt;C1 |= I2C_C1_IICIE_MASK;		//enable ints
	I2C0-&amp;gt;FLT = I2C_FLT_STOPIE_MASK;	//enable stop cond int&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;int:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;void I2C0_IRQHandler(void)
{
	//I2C IRQ handler
	volatile uint8_t data = 0;
	volatile uint8_t status;
	bool doTransmit = false;

	//arbitration lost?
	if (I2C0-&amp;gt;S &amp;amp; I2C_S_ARBL_MASK)
	{
		//clear ARBL
		I2C0-&amp;gt;S = I2C_S_ARBL_MASK;
		ARBLostCount++;
	}

	//check for stop flag
	if (I2C0-&amp;gt;FLT &amp;amp; I2C_FLT_STOPF_MASK)
	{
		//stop condition has been detected
		I2C0-&amp;gt;FLT = I2C_FLT_STOPF_MASK;		//clear flag
		I2C0-&amp;gt;S = I2C_S_IICIF_MASK;			//clear interrupt service flag
		if ((I2C0-&amp;gt;S &amp;amp; (I2C_S_IAAS_MASK | I2C_S_TCF_MASK)) != (I2C_S_IAAS_MASK | I2C_S_TCF_MASK))
		{
			//if the slave is already addressed we allow the reception handling to continue since we will have cleared the reception interrupt
			return;
		}
	}

	//clear interrupt service flag
	I2C0-&amp;gt;S = I2C_S_IICIF_MASK;

	//check address match
	if (I2C0-&amp;gt;S &amp;amp; I2C_S_IAAS_MASK)
	{
		//address matched
		isBusy = true;
		if (I2C0-&amp;gt;S &amp;amp; I2C_S_SRW_MASK)
		{
			//slave transmit, master reading from us
			//change direction to send data
			I2C0-&amp;gt;C1 |= I2C_C1_TX_MASK;
			//clear interrupt service flag
			I2C0-&amp;gt;S = I2C_S_IICIF_MASK;
			//flag transmit
			doTransmit = true;
		}
		else
		{
			//slave receive, master writing to us
			//send ack, recv mode
			//I2C0-&amp;gt;C1 &amp;amp;= ~(I2C_C1_TX_MASK | I2C_C1_TXAK_MASK);
			I2C0-&amp;gt;C1 = I2C_C1_IICEN_MASK | I2C_C1_IICIE_MASK;
			//read dummy to release the bus
			data = I2C0-&amp;gt;D;
			//reset inbuf count
			indatac = 0;
		}
	}
	else
	{
		//check transfer complete flag
		if (I2C0-&amp;gt;S &amp;amp; I2C_S_TCF_MASK)
		{
			if (I2C0-&amp;gt;S &amp;amp; I2C_S_SRW_MASK)
			{
				//slave transmit, master reading from slave
				doTransmit = true;
			}
			else
			{
				//slave receive, master writing to slave
				//clear interrupt service flag
				I2C0-&amp;gt;S = I2C_S_IICIF_MASK;
				//ack
				I2C0-&amp;gt;C1 &amp;amp;= ~I2C_C1_TXAK_MASK;
				//get data
				data = I2C0-&amp;gt;D;
				indata[indatac++] = data;
			}
		}
		else
		{
			//clear interrupt service flag
			I2C0-&amp;gt;S = I2C_S_IICIF_MASK;
			//read dummy to release bus
			data = I2C0-&amp;gt;D;
		}
	}

	//send data if there is the need
	if (doTransmit)
	{
		//send data
	}
	
	//done
	(void)data;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/177967i594AD5F92F2E9010/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;At the location of the B cursor, the INT is called with IAAS and !SRW (as it should).&lt;/P&gt;&lt;P&gt;The INT is never triggered again after that. Nothing ever happens after the B cursor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 06:25:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL05-as-I2C-slave/m-p/1448961#M62980</guid>
      <dc:creator>mwp_nxp</dc:creator>
      <dc:date>2022-04-26T06:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: KL05 as I2C slave</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL05-as-I2C-slave/m-p/1449000#M62981</link>
      <description>&lt;P&gt;I've found something else interesting...&lt;/P&gt;&lt;P&gt;I have a variation of the fw that using blocking (non INT driven) handling of I2C0.&lt;BR /&gt;&lt;BR /&gt;With I2C0-&amp;gt;F=0, it does not work. It gives the same immediate result as the INT handling code.&lt;BR /&gt;With I2C0-&amp;gt;F=69 (MULT=2 ICR=5), it does work for 4-5 I2C transactions before failing.&lt;/P&gt;&lt;P&gt;This is a capture of the blocking i2c handling code, with F=69.&lt;BR /&gt;Note the very short SDA pulses which i have circled in red (i have no idea what they are or are caused by).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/177973i5D0236C5EE238D23/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 07:18:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL05-as-I2C-slave/m-p/1449000#M62981</guid>
      <dc:creator>mwp_nxp</dc:creator>
      <dc:date>2022-04-26T07:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: KL05 as I2C slave</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL05-as-I2C-slave/m-p/1449080#M62982</link>
      <description>&lt;P&gt;Finally solved!&lt;/P&gt;&lt;P&gt;The KL05 clocks were running in FEI mode at 21Mhz (Sys &amp;amp; Bus).&lt;BR /&gt;Running in FEI mode at 48Mhz (BUS at 24Mhz), now has it working.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 08:52:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL05-as-I2C-slave/m-p/1449080#M62982</guid>
      <dc:creator>mwp_nxp</dc:creator>
      <dc:date>2022-04-26T08:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: KL05 as I2C slave</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL05-as-I2C-slave/m-p/1449268#M62983</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am surprised that core speed has an effect - are you sure there are not race states that are avoided when the processor is running slightly faster?&lt;/P&gt;&lt;P&gt;When I get some time I may try testing the slowest core and bus clocks for reliable operation at a certain I2C master rate to see whether there is something specifically limiting it. I do have a KL02 slave (same I2C controller as in KL05) in operation at the moment that is clocked at 20.97MHz core and 10.485MHz bus/flash which hasn't shown any problems. The same application running on a KL03 (similar issue as you in that I need to use both chips due to shortages, but both are footprint compatible) at 8MHz core and 4MHz bus/flash behaves equivalently.&lt;/P&gt;&lt;P&gt;In both cases the I2C master is using a 50kHz I2C clock.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 14:03:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL05-as-I2C-slave/m-p/1449268#M62983</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2022-04-26T14:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: KL05 as I2C slave</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL05-as-I2C-slave/m-p/1449439#M62988</link>
      <description>&lt;P&gt;I'm surprised too.&amp;nbsp;&lt;BR /&gt;I'm quite certain there is nothing else going on that an increase in clock rate would change... the firmware just isn't that complicated or large.&lt;BR /&gt;In this case the master I2C clock is approx 350khz.&lt;/P&gt;&lt;P&gt;Thanks again for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 23:13:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL05-as-I2C-slave/m-p/1449439#M62988</guid>
      <dc:creator>mwp_nxp</dc:creator>
      <dc:date>2022-04-26T23:13:07Z</dc:date>
    </item>
  </channel>
</rss>

