<?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>LPC MicrocontrollersのトピックRe: LPC54xxx Output SCL is lost.</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54xxx-Output-SCL-is-lost/m-p/1761903#M54763</link>
    <description>&lt;P&gt;&lt;EM&gt;&amp;gt; This bus hung up was occurr with driving high current near i2c bus. So we reduced effect of its line. Then, its not occurred.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If that is true, than the issue is not related to clock stretching.&lt;BR /&gt;Rather the synchronisation and the ACK signal got lost.&lt;BR /&gt;Many I2C slave devices are simple state machines, and never re-synchronize without power cycle or other specific measures.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Nov 2023 11:34:56 GMT</pubDate>
    <dc:creator>frank_m</dc:creator>
    <dc:date>2023-11-22T11:34:56Z</dc:date>
    <item>
      <title>LPC54xxx Output SCL is lost.</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54xxx-Output-SCL-is-lost/m-p/1758228#M54714</link>
      <description>&lt;P&gt;Hi Them.&lt;/P&gt;&lt;P&gt;I am using LPC54605 MCU.&lt;BR /&gt;I encounted a problem that MCU output SCL is lost.(See below)&lt;BR /&gt;I want to know what is happons.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="i2c_signal" style="width: 519px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/250139iA40F3B9F1A7EDAA9/image-size/large?v=v2&amp;amp;px=999" role="button" title="i2c_signal.png" alt="i2c_signal" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;i2c_signal&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Additional informations.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;MCU LPC54605J256&lt;/LI&gt;&lt;LI&gt;MCUXpresso IDE v11.2.0&lt;/LI&gt;&lt;LI&gt;SDK version 2.8.2&lt;/LI&gt;&lt;LI&gt;I2C Master transfering via using&amp;nbsp;I2C_MasterTransferNonBlocking() function.&lt;/LI&gt;&lt;LI&gt;Baudrate is 100kbps&lt;/LI&gt;&lt;LI&gt;MCU clock is internal oscillator. (FRO oscillator 96MHz)&lt;/LI&gt;&lt;LI&gt;FlexComm source clock is fro_12m (12MHz)&lt;/LI&gt;&lt;LI&gt;Other using peripherals (USB, GPIO, ADC, CTIMER)&lt;/LI&gt;&lt;LI&gt;This problem often occurr with driving other device (It is heater controled by GPIO).&lt;BR /&gt;I think that this cause is depend on our system. But, why MCU lost output SCL?&lt;BR /&gt;Its signal is generated by FlexComm Peripheral.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="markup"&gt;static volatile status_t I2C1TransferStatus = -1;

void init_i2c(void) {
    CLOCK_AttachClk(kFRO12M_to_FLEXCOMM8); // Set clock source to fro_12MHz
    RESET_PeripheralReset(kFC8_RST_SHIFT_RSTn); // Reset FlexComm

    i2c_master_config_t masterConfig;
    I2C_MasterGetDefaultConfig(&amp;amp;masterConfig);
    masterConfig.baudRate_Bps = 100000; // 100kHz
    masterConfig.enableTimeout = true;
    I2C_MasterInit(I2C8, &amp;amp;masterConfig, 12000000);
    I2C_MasterTransferCreateHandle(I2C8, &amp;amp;I2C1MasterTransferHandle,
            i2c_request_done, NULL);
    return ;
}
static void i2c_request_done(I2C_Type *base, i2c_master_handle_t *handle,
        status_t status, void *userData) {
    /* Signal transfer success when received success status. */
    I2C1TransferStatus = status;
}
bool transfer(i2c_master_transfer_t *masterXfer) {
    status_t stat = kStatus_Fail;
    I2C1TransferStatus = -1;
    stat = I2C_MasterTransferNonBlocking(I2C8, &amp;amp;I2C1MasterTransferHandle, masterXfer);
    if (stat != kStatus_Success) {
        return false;
    }
    while (I2C1TransferStatus == -1) { // Is transferring?
        // do nothing.
    }
    return I2C1TransferStatus == kStatus_Success;
}
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 08:51:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54xxx-Output-SCL-is-lost/m-p/1758228#M54714</guid>
      <dc:creator>t-umetsu</dc:creator>
      <dc:date>2023-11-16T08:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54xxx Output SCL is lost.</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54xxx-Output-SCL-is-lost/m-p/1758669#M54722</link>
      <description>&lt;P&gt;&lt;SPAN&gt;There are situations where an I2C slave is not able to co-operate with the clock speed given by the master and needs to slow down a little. This is done by a mechanism referred to as&amp;nbsp;&lt;/SPAN&gt;&lt;I&gt;clock stretching.&amp;nbsp;&lt;BR /&gt;&lt;/I&gt;This clock stretching might be the reason why SCL is held.&amp;nbsp;&lt;BR /&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;To test this, you might slow down the I2C bus baudrate to confirm this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Omar&lt;/P&gt;</description>
      <pubDate>Fri, 17 Nov 2023 00:36:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54xxx-Output-SCL-is-lost/m-p/1758669#M54722</guid>
      <dc:creator>Omar_Anguiano</dc:creator>
      <dc:date>2023-11-17T00:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54xxx Output SCL is lost.</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54xxx-Output-SCL-is-lost/m-p/1760552#M54757</link>
      <description>&lt;P&gt;Thank you for reply.&lt;/P&gt;&lt;P&gt;We tried with slow baudrate. For example, 10kbps.&lt;BR /&gt;We seen same phenomenon. So we think that the cause is not baudrate.&lt;/P&gt;&lt;P&gt;We approach other method and resolved this problem.&amp;nbsp;&lt;BR /&gt;This bus hung up was occurr with driving high current near i2c bus. So we reduced effect of its line. Then, its not occurred.&lt;/P&gt;&lt;P&gt;What I'm wondering is SCL is generated by MCU peripheral on master transfer, but one pulse lost.&lt;BR /&gt;It's hard to explain in words, so take a look below.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="i2c_signal2.png" style="width: 640px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/250805iAF3DC3B04B9B925C/image-size/large?v=v2&amp;amp;px=999" role="button" title="i2c_signal2.png" alt="i2c_signal2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;We imagine one of the following.(This is just our imagination.)&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Driving clock of FlexComm was disordered by external noise.&lt;/LI&gt;&lt;LI&gt;SCL change to L by external noise, clock is lost. Same time, clock stretch is occurred. One pulse of SCL was lost.&lt;/LI&gt;&lt;LI&gt;If FlexComm is inteligently watch SCL line.&lt;BR /&gt;FlexComm peripheral judged SCL high state is end because detected L of SCL just after release SCL.&lt;BR /&gt;Peripheral change to next state (SCL to L). Therefore SCL is lost.&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Tue, 21 Nov 2023 08:27:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54xxx-Output-SCL-is-lost/m-p/1760552#M54757</guid>
      <dc:creator>t-umetsu</dc:creator>
      <dc:date>2023-11-21T08:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54xxx Output SCL is lost.</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54xxx-Output-SCL-is-lost/m-p/1761903#M54763</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt; This bus hung up was occurr with driving high current near i2c bus. So we reduced effect of its line. Then, its not occurred.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If that is true, than the issue is not related to clock stretching.&lt;BR /&gt;Rather the synchronisation and the ACK signal got lost.&lt;BR /&gt;Many I2C slave devices are simple state machines, and never re-synchronize without power cycle or other specific measures.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 11:34:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54xxx-Output-SCL-is-lost/m-p/1761903#M54763</guid>
      <dc:creator>frank_m</dc:creator>
      <dc:date>2023-11-22T11:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54xxx Output SCL is lost.</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54xxx-Output-SCL-is-lost/m-p/1762948#M54784</link>
      <description>&lt;P&gt;Thanks for explanation.&lt;BR /&gt;I was misunderstand about clock stretch.&amp;nbsp;I understood that the cause of this behavior is due to the slave device.&lt;BR /&gt;I don't understand that it is possible for a slave device to shorten the cycle of one sequence (9bits=Addr+RW+ACK)..Because I don't think the duration of the sequence will change even if the slave device keeps SCL low.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2023 22:24:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54xxx-Output-SCL-is-lost/m-p/1762948#M54784</guid>
      <dc:creator>t-umetsu</dc:creator>
      <dc:date>2023-11-23T22:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54xxx Output SCL is lost.</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54xxx-Output-SCL-is-lost/m-p/1763099#M54786</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt; I don't understand that it is possible for a slave device to shorten the cycle of one sequence (9bits=Addr+RW+ACK)..Because I don't think the duration of the sequence will change even if the slave device keeps SCL low.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Your understanding is correct so far.&lt;BR /&gt;The number of transferred bits does not change, as this is crucial for the functionality of the bus.&lt;BR /&gt;If only 8 cycles are visible, it is likely that the master catched and interpreted a noise spike as clock pulse.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For clock stretching, the slave keeps SCL low when he detects clocking issues. This protracts the transfer, but does not change the sequence of logic levels.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you have EMV issues due to switching of high currents nearby, perhaps you can reduce the I2C clock frequency further, and/or add some RC lowpass filters to increase robustness.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Nov 2023 06:26:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54xxx-Output-SCL-is-lost/m-p/1763099#M54786</guid>
      <dc:creator>frank_m</dc:creator>
      <dc:date>2023-11-24T06:26:46Z</dc:date>
    </item>
  </channel>
</rss>

