<?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: LPC54102 Deep sleep wake up on I2C slave in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-Deep-sleep-wake-up-on-I2C-slave/m-p/711291#M28692</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that's it: first packet wakes up the microcontroller but is lost, whereas the second one is received correctly. That may be due to implementation details or some timing issues, I don't know. Anyway I could sort that out by connecting a new line from I2C master which wakes slave mcu&lt;A href="mailto:I@C"&gt; &lt;/A&gt;a few milliseconds before the I2C address is sent. I have plenty of free pins so that's not a problem right now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Nov 2017 08:17:32 GMT</pubDate>
    <dc:creator>genisaguilar</dc:creator>
    <dc:date>2017-11-06T08:17:32Z</dc:date>
    <item>
      <title>LPC54102 Deep sleep wake up on I2C slave</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-Deep-sleep-wake-up-on-I2C-slave/m-p/711287#M28688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using a LPCXpresso54102 board and I'm trying to enter DEEP_SLEEP mode and wake up by I2C slave interrupt. I've followed the instructions in the manual (UM108050, section 25.4.3.2) and done all the steps in the required order. Anyway, no matter what order I try, I don't manage to wake up on I2C.&amp;nbsp; Code works well if I don't sleep.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ides of what I'm doing wrong. See the code below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE style="padding-left: 30px;"&gt;

#define MK_BRIDGE_I2C_PORT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;LPC_I2C2
#define MK_BRIDGE_I2C_INTHAND&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;I2C2_IRQHandler
#define MK_BRIDGE_IRQNUM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;I2C2_IRQn
#define MK_BRIDGE_WAKEUP_SRC&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;SYSCON_STARTER_I2C2
#define MK_BRIDGE_I2C_SCL_PIN&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;27
#define MK_BRIDGE_I2C_SDA_PIN&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;28
#define MK_BRIDGE_I2C_SCL_FN&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;IOCON_FUNC1
#define MK_BRIDGE_I2C_SDA_FN&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;IOCON_FUNC1
#define MK_BRIDGE_I2C_SLVADD&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;0x29
#define MK_BRIDGE_I2C_CLK_DIVIDER&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;(2)
#define MK_BRIDGE_I2C_SPEED&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NRF_TWI_FREQ_100K


int main(void)
{
&amp;nbsp;&amp;nbsp; &amp;nbsp;Board_Init();
&amp;nbsp;&amp;nbsp; &amp;nbsp;NVIC_EnableIRQ(MK_BRIDGE_IRQNUM);
&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_SYSCON_EnableWakeup(MK_BRIDGE_WAKEUP_SRC);

&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Enable the I2C controller */
&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_I2C_Init(MK_BRIDGE_I2C_PORT);

&amp;nbsp; &amp;nbsp;Chip_I2CS_Enable(MK_BRIDGE_I2C_PORT);


 &amp;nbsp; &amp;nbsp;/* Initialize I2C pins */
&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_IOCON_PinMuxSet(LPC_IOCON, MK_BRIDGE_I2C_SCL_PORT,
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;MK_BRIDGE_I2C_SCL_PIN,
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;(MK_BRIDGE_I2C_SCL_FN | IOCON_DIGITAL_EN));
&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_IOCON_PinMuxSet(LPC_IOCON,
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;MK_BRIDGE_I2C_SDA_PORT,
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;MK_BRIDGE_I2C_SDA_PIN, (MK_BRIDGE_I2C_SDA_FN | IOCON_DIGITAL_EN));

&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Setup clock rate for I2C */ //JH: check if we need that
&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_I2C_SetClockDiv(MK_BRIDGE_I2C_PORT, MK_BRIDGE_I2C_CLK_DIVIDER);

&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Slave address on index 0 */
&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_I2CS_SetSlaveAddr(MK_BRIDGE_I2C_PORT, 0, MK_BRIDGE_I2C_SLVADD);

&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Clear interrupt status and enable slave interrupts */
&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_I2CS_ClearStatus(MK_BRIDGE_I2C_PORT, I2C_STAT_SLVDESEL);
&amp;nbsp;&amp;nbsp; &amp;nbsp;Chip_I2C_EnableInt(MK_BRIDGE_I2C_PORT, I2C_INTENSET_SLVPENDING | I2C_INTENSET_SLVDESEL);

&amp;nbsp;&amp;nbsp; &amp;nbsp;while(1) {
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;for(int j = 0; j &amp;lt; 5; j ++) {
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;for (int i = 0; i &amp;lt; 100000;i++);
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Board_LED_Set(1, 1);
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;for (int i = 0; i &amp;lt; 100000;i++);
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Board_LED_Set(1, 0);
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}

&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Chip_POWER_EnterPowerMode(
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;POWER_DEEP_SLEEP,
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;SYSCON_PDRUNCFG_PD_WDT_OSC |
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;SYSCON_PDRUNCFG_PD_SRAM0A |
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;SYSCON_PDRUNCFG_PD_SRAM0B |
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;SYSCON_PDRUNCFG_PD_SRAM1 |
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;SYSCON_PDRUNCFG_PD_SRAM2 |
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;SYSCON_PDRUNCFG_PD_32K_OSC|
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;SYSCON_PDRUNCFG_PD_BOD_RST|
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;SYSCON_PDRUNCFG_PD_BOD_INTR);
&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/PRE&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Oct 2017 16:37:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-Deep-sleep-wake-up-on-I2C-slave/m-p/711287#M28688</guid>
      <dc:creator>genisaguilar</dc:creator>
      <dc:date>2017-10-20T16:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54102 Deep sleep wake up on I2C slave</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-Deep-sleep-wake-up-on-I2C-slave/m-p/711288#M28689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Genis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Before you enter deep sleep mode, did you change the clock to use the internal IRC as the the main clock?&lt;/P&gt;&lt;P&gt;&amp;nbsp; Please check this information from the user manual:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/2290iF808878B9F1283C7/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Please check it at first.&lt;/P&gt;&lt;P&gt;Any updated information, please let me know!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2017 02:53:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-Deep-sleep-wake-up-on-I2C-slave/m-p/711288#M28689</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2017-10-25T02:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54102 Deep sleep wake up on I2C slave</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-Deep-sleep-wake-up-on-I2C-slave/m-p/711289#M28690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Kerry, that was it. After changing to IRC clock now LPC wakes up on I2C. Still, I noticed that the first packet after waking up was always lost, I don't exactly know the reason why. I added a pin interrupt that awakes the micro some milliseconds before the master sends the I2C address.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Oct 2017 15:39:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-Deep-sleep-wake-up-on-I2C-slave/m-p/711289#M28690</guid>
      <dc:creator>genisaguilar</dc:creator>
      <dc:date>2017-10-27T15:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54102 Deep sleep wake up on I2C slave</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-Deep-sleep-wake-up-on-I2C-slave/m-p/711290#M28691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Genis Aguilar,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Thanks for your updated information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Please do the test in the I2C slave after it is waked up. After it is waked up, you can toggle the GPIO, just to check the MCU is really waked up. Then you can send some other I2C data to the slave.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Besides, you said:the first packet after waking up was always lost.&lt;/P&gt;&lt;P&gt;&amp;nbsp; Do you mean the second packet has no problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Nov 2017 07:05:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-Deep-sleep-wake-up-on-I2C-slave/m-p/711290#M28691</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2017-11-01T07:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54102 Deep sleep wake up on I2C slave</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-Deep-sleep-wake-up-on-I2C-slave/m-p/711291#M28692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that's it: first packet wakes up the microcontroller but is lost, whereas the second one is received correctly. That may be due to implementation details or some timing issues, I don't know. Anyway I could sort that out by connecting a new line from I2C master which wakes slave mcu&lt;A href="mailto:I@C"&gt; &lt;/A&gt;a few milliseconds before the I2C address is sent. I have plenty of free pins so that's not a problem right now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Nov 2017 08:17:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54102-Deep-sleep-wake-up-on-I2C-slave/m-p/711291#M28692</guid>
      <dc:creator>genisaguilar</dc:creator>
      <dc:date>2017-11-06T08:17:32Z</dc:date>
    </item>
  </channel>
</rss>

