<?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>Kinetis Software Development KitのトピックWhy am I getting an interrupt when I try to set the Open Drain Enable bit for Port C bit 10 (address 0x4004b028 bit 5)?</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Why-am-I-getting-an-interrupt-when-I-try-to-set-the-Open-Drain/m-p/412577#M1898</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am new to KSDK and Kinetis processors, but I have I2C working except that the Processor Expert code is not properly setting the Open Drain Enable bit for the SDA and SCL pins. When I try to set the bit in my code, an interrupt occurs. This is in a "bare metal" system. I'm trying to set the bit like this:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;volatile uint32_t *portc10 = (void *)0x4004b028;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*portc10 |= (1 &amp;lt;&amp;lt; 5);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The interrupt occurs when portc10 is dereferenced.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have no idea why this is happening unless there is memory protection being turned on by something, but that should be the case in a bare metal (standalone) platform. If so, how do I turn it off so I can set this bit?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aric.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Sep 2015 13:23:20 GMT</pubDate>
    <dc:creator>aricblumer</dc:creator>
    <dc:date>2015-09-25T13:23:20Z</dc:date>
    <item>
      <title>Why am I getting an interrupt when I try to set the Open Drain Enable bit for Port C bit 10 (address 0x4004b028 bit 5)?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Why-am-I-getting-an-interrupt-when-I-try-to-set-the-Open-Drain/m-p/412577#M1898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am new to KSDK and Kinetis processors, but I have I2C working except that the Processor Expert code is not properly setting the Open Drain Enable bit for the SDA and SCL pins. When I try to set the bit in my code, an interrupt occurs. This is in a "bare metal" system. I'm trying to set the bit like this:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;volatile uint32_t *portc10 = (void *)0x4004b028;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*portc10 |= (1 &amp;lt;&amp;lt; 5);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The interrupt occurs when portc10 is dereferenced.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have no idea why this is happening unless there is memory protection being turned on by something, but that should be the case in a bare metal (standalone) platform. If so, how do I turn it off so I can set this bit?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aric.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Sep 2015 13:23:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Why-am-I-getting-an-interrupt-when-I-try-to-set-the-Open-Drain/m-p/412577#M1898</guid>
      <dc:creator>aricblumer</dc:creator>
      <dc:date>2015-09-25T13:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting an interrupt when I try to set the Open Drain Enable bit for Port C bit 10 (address 0x4004b028 bit 5)?</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Why-am-I-getting-an-interrupt-when-I-try-to-set-the-Open-Drain/m-p/412578#M1899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I learned that if I hacked the code above into the pin_mux.c code that is generated by Processor Expert, the setting of the Open Drain Enable works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So further debugging showed that the culprit is this line in the Common_Init() funciton of Cpu.c in the generated code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SIM_SCGC5 &amp;amp;= (uint32_t)~(uint32_t)(SIM_SCGC5_PORTC_MASK);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which apparently turns the clock off to the GPIO Port C controller. So accesses to registers in that space must hang causing a watchdog reset or a bus exception.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my own code, I am able to turn that clock back on and then set the Open Drain Enable as needed to get I2C to work properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aric.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Sep 2015 13:45:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/Why-am-I-getting-an-interrupt-when-I-try-to-set-the-Open-Drain/m-p/412578#M1899</guid>
      <dc:creator>aricblumer</dc:creator>
      <dc:date>2015-09-25T13:45:42Z</dc:date>
    </item>
  </channel>
</rss>

