<?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 Cannot write in I2C register FRDM-MKL43Z in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Cannot-write-in-I2C-register-FRDM-MKL43Z/m-p/817915#M49531</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Hello, I am trying to make a small driver for the I2C communication for better undersanding how everything works here and to get used to working with the registers. All I am trying to do by now is to enable the ports for the I2C comm, enable the clock and enable I2C module operation and I2C Interrupt enable in &lt;A href="mailto:I@C"&gt;I&lt;/A&gt;2C Control Register 1. My code is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;I2C_Type* i2c[] = I2C_BASE_PTRS;//defined in MKL43Z4.h as 2 pointers who point at the corresponding addresses&lt;/P&gt;&lt;P&gt;&amp;nbsp; CLOCK_EnableClock(kCLOCK_PortE);//using PORTE PINS 24, 25 for I2C0&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORT_SetPinMux(PORTE, 24U, kPORT_MuxAlt5);&lt;BR /&gt;&amp;nbsp; PORT_SetPinMux(PORTE, 25U, kPORT_MuxAlt5);&lt;BR /&gt;&amp;nbsp; SIM-&amp;gt;SCGC4 |= 1u &amp;lt;&amp;lt; 6u;//enable the clock gate to the I2C0 module&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;i2c[0]-&amp;gt;C1 = 1u &amp;lt;&amp;lt; 7u | 1u &amp;lt;&amp;lt; 6u;//I2C0 Control Register&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;When I debug this code, it goes past the writing in SIM-&amp;gt;SCGC4 register, but when I arrive at the last line, it takes me at "startup_MKL43Z4.S" file at line 209, where is the following code:&lt;/P&gt;&lt;P&gt;HardFault_Handler:&lt;/P&gt;&lt;P&gt;ldr r0,=HardFault_Handler&lt;BR /&gt; bx r0&lt;BR /&gt; .size HardFault_Handler, . - HardFault_Handler&lt;/P&gt;&lt;P&gt;.align 1&lt;BR /&gt; .thumb_func&lt;BR /&gt; .weak SVC_Handler&lt;BR /&gt; .type SVC_Handler, %function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Codewise I don't think that I do something wrong, I believe that probably it's some settings or initializations that I didn't take in considerations. Thanks in advance and have a nice day everyone!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Jul 2018 08:36:30 GMT</pubDate>
    <dc:creator>grec_mihai96</dc:creator>
    <dc:date>2018-07-17T08:36:30Z</dc:date>
    <item>
      <title>Cannot write in I2C register FRDM-MKL43Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Cannot-write-in-I2C-register-FRDM-MKL43Z/m-p/817915#M49531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Hello, I am trying to make a small driver for the I2C communication for better undersanding how everything works here and to get used to working with the registers. All I am trying to do by now is to enable the ports for the I2C comm, enable the clock and enable I2C module operation and I2C Interrupt enable in &lt;A href="mailto:I@C"&gt;I&lt;/A&gt;2C Control Register 1. My code is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;I2C_Type* i2c[] = I2C_BASE_PTRS;//defined in MKL43Z4.h as 2 pointers who point at the corresponding addresses&lt;/P&gt;&lt;P&gt;&amp;nbsp; CLOCK_EnableClock(kCLOCK_PortE);//using PORTE PINS 24, 25 for I2C0&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORT_SetPinMux(PORTE, 24U, kPORT_MuxAlt5);&lt;BR /&gt;&amp;nbsp; PORT_SetPinMux(PORTE, 25U, kPORT_MuxAlt5);&lt;BR /&gt;&amp;nbsp; SIM-&amp;gt;SCGC4 |= 1u &amp;lt;&amp;lt; 6u;//enable the clock gate to the I2C0 module&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;i2c[0]-&amp;gt;C1 = 1u &amp;lt;&amp;lt; 7u | 1u &amp;lt;&amp;lt; 6u;//I2C0 Control Register&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;When I debug this code, it goes past the writing in SIM-&amp;gt;SCGC4 register, but when I arrive at the last line, it takes me at "startup_MKL43Z4.S" file at line 209, where is the following code:&lt;/P&gt;&lt;P&gt;HardFault_Handler:&lt;/P&gt;&lt;P&gt;ldr r0,=HardFault_Handler&lt;BR /&gt; bx r0&lt;BR /&gt; .size HardFault_Handler, . - HardFault_Handler&lt;/P&gt;&lt;P&gt;.align 1&lt;BR /&gt; .thumb_func&lt;BR /&gt; .weak SVC_Handler&lt;BR /&gt; .type SVC_Handler, %function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Codewise I don't think that I do something wrong, I believe that probably it's some settings or initializations that I didn't take in considerations. Thanks in advance and have a nice day everyone!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jul 2018 08:36:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Cannot-write-in-I2C-register-FRDM-MKL43Z/m-p/817915#M49531</guid>
      <dc:creator>grec_mihai96</dc:creator>
      <dc:date>2018-07-17T08:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot write in I2C register FRDM-MKL43Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Cannot-write-in-I2C-register-FRDM-MKL43Z/m-p/817916#M49532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please try the code show below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I2C0-&amp;gt;C1 |= I2C_C1_IICEN_MASK|I2C_C1_IICIE_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&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>Thu, 19 Jul 2018 06:50:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Cannot-write-in-I2C-register-FRDM-MKL43Z/m-p/817916#M49532</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2018-07-19T06:50:12Z</dc:date>
    </item>
  </channel>
</rss>

