<?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: KL25Z Keil: Determine Memory Address of Ports in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25Z-Keil-Determine-Memory-Address-of-Ports/m-p/365752#M18835</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi James,&lt;/P&gt;&lt;P&gt;Yes It's necessary to check the address of registers careful before you handle them.&lt;/P&gt;&lt;P&gt;Any way, if you have some questions about the Kinetis MCU, please just feel free to create a thread in the community and we will follow it.&lt;BR /&gt;Have a great day.&lt;/P&gt;&lt;P&gt;Ping&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>Fri, 13 Feb 2015 07:34:58 GMT</pubDate>
    <dc:creator>jeremyzhou</dc:creator>
    <dc:date>2015-02-13T07:34:58Z</dc:date>
    <item>
      <title>KL25Z Keil: Determine Memory Address of Ports</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25Z-Keil-Determine-Memory-Address-of-Ports/m-p/365746#M18829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I am very new to the platform and taking a class with the Microcontroler listed above. Please forgive my simple questions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking to control the on-board LED's with a pushbutton wired into a solder less breadboard. I know I must enable the clock on a pin, set it as input or output, then write to it. Yet not sure how.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In some sample code I see:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;SIM_SCGC5&amp;nbsp;&amp;nbsp; EQU&amp;nbsp; 0x40048038 &lt;/TD&gt;&lt;TD&gt;;SIM_SCGC5 address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;The control for each ports Clock Gate &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I belive this controls the clocks for all pins...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;PORTB_PCR18 EQU&amp;nbsp; 0x4004A000 + 4 * 18 ;PORTB_PCR18 address &lt;/TD&gt;&lt;TD&gt;LED Pin for RED&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;And this should enable B18 to be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to enable other ports such as PORTB_PCR19 and PORTD_PCR1 but not sure where the address is in memory.&lt;/P&gt;&lt;P&gt;I am assuming PORTx_PCRn is the naming convention for the register at the location 0x4004A000 + 4*18 and the code EQU equated the name with the location.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yet I can not figure out where to find the memory locations of the other pins. Any advice?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where can I find this information?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 05:08:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25Z-Keil-Determine-Memory-Address-of-Ports/m-p/365746#M18829</guid>
      <dc:creator>jameshayek</dc:creator>
      <dc:date>2015-02-11T05:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: KL25Z Keil: Determine Memory Address of Ports</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25Z-Keil-Determine-Memory-Address-of-Ports/m-p/365747#M18830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi James,&lt;/P&gt;&lt;P&gt;Thank you very much for your focus on Freescale Kinetis product. I'm glad to provide service for you.&lt;/P&gt;&lt;P&gt;You can find the address of all the PORT registers in the section &lt;STRONG&gt;Memory map and register definition&lt;/STRONG&gt; in the KL25's reference manual.&lt;/P&gt;&lt;P&gt;Wish it helps.&lt;BR /&gt;Have a great day,&lt;BR /&gt;Ping&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>Thu, 12 Feb 2015 06:58:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25Z-Keil-Determine-Memory-Address-of-Ports/m-p/365747#M18830</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2015-02-12T06:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: KL25Z Keil: Determine Memory Address of Ports</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25Z-Keil-Determine-Memory-Address-of-Ports/m-p/365748#M18831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for helping me locate the information.&lt;/P&gt;&lt;P&gt;This was found in the document: KL25P80M48SF0RM in section 11.5 Like you said, in the section titled &lt;STRONG&gt;Memory map and register definition.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For others that may read this. You must call the memory address to the pin like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;PORTB_PCR19 EQU&amp;nbsp; 0x4004A04C &lt;/TD&gt;&lt;TD&gt;;PORTB_PCR19 address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;&lt;P&gt;LED Pin for GREEN&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice the manual shows: 4004_A04C Pin Control Register n (PORTB_PCR19)&lt;/P&gt;&lt;P&gt;You must remove the underscore when writing the above code equating the PORT to the memory address.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I may ask, why is the underscore shown in the manual and why must we remove it in the code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Feb 2015 15:36:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25Z-Keil-Determine-Memory-Address-of-Ports/m-p/365748#M18831</guid>
      <dc:creator>jameshayek</dc:creator>
      <dc:date>2015-02-12T15:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: KL25Z Keil: Determine Memory Address of Ports</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25Z-Keil-Determine-Memory-Address-of-Ports/m-p/365749#M18832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take a look at &lt;A href="http://www.utasker.com/kinetis/FRDM-KL25Z.html" title="http://www.utasker.com/kinetis/FRDM-KL25Z.html"&gt;http://www.utasker.com/kinetis/FRDM-KL25Z.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To configure a port as input it uses&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;_CONFIG_PORT_INPUT(B, PORTB_BIT10, PORT_PS_UP_ENABLE);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;or as output&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;_CONFIG_PORT_OUTPUT(B, PORTB_BIT10, (PORT_SRE_SLOW | PORT_DSE_HIGH));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(all details of the clocking etc. are automated)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It includes a &lt;STRONG&gt;KL25 Keil configuration&lt;/STRONG&gt; and allows you to simulate the device and the board - this allows you to study the registers and operation for learning purposes and later develop projects much more efficiently than using traditional techniques (of course checking the register details in the user's manual helps too).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To change a bit to '1' or '0' you can then use&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;_SETBITS(B, PORTB_BIT10);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;_CLEARBITS(B, PORTB_BIT10);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;To toggle ths state:&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;_TOGGLE_PORT(B, PORTB_BIT10);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and various other variations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To read the state of an input pin:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;_READ_PORT_MASK(B, PORTB_BIT10);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kinetis: &lt;A class="jive-link-external-small" data-content-finding="Community" href="http://www.utasker.com/kinetis.html" target="_blank"&gt;µTasker Kinetis support&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;K25: &lt;A class="jive-link-external-small" data-content-finding="Community" href="http://www.utasker.com/kinetis/FRDM-KL25Z.html" target="_blank"&gt;µTasker Kinetis FRDM-KL25Z support&lt;/A&gt;&amp;nbsp; / &lt;A class="jive-link-external-small" data-content-finding="Community" href="http://www.utasker.com/kinetis/TWR-KL25Z48M.html" target="_blank"&gt;µTasker Kinetis TWR-KL25Z48M support&lt;/A&gt; &lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;For the complete "out-of-the-box" Kinetis experience and faster time to market&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Feb 2015 16:06:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25Z-Keil-Determine-Memory-Address-of-Ports/m-p/365749#M18832</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2015-02-12T16:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: KL25Z Keil: Determine Memory Address of Ports</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25Z-Keil-Determine-Memory-Address-of-Ports/m-p/365750#M18833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi James,&lt;/P&gt;&lt;P&gt;In fact, I'm also not very clear why the address contain a underscore in the reference manual.&lt;/P&gt;&lt;P&gt;I think it's just a kind of write format and I hope you will not feel confused any more.&lt;/P&gt;&lt;P&gt;Actually, when you create a project for KL25, you needn't to know the address if you want to handle the specific register, just calls the name of the register.&lt;/P&gt;&lt;P&gt;So I highly recommend you to download the sample code of the FRDM-KL25Z and you'll learn the way to handle the specific register. &lt;BR /&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;The link of the KL25's sample code package:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-KL25Z&amp;amp;fpsp=1&amp;amp;tab=Design_Tools_Tab" title="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-KL25Z&amp;amp;fpsp=1&amp;amp;tab=Design_Tools_Tab"&gt;http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-KL25Z&amp;amp;fpsp=1&amp;amp;tab=Design_Tools_Tab&lt;/A&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Ping&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>Fri, 13 Feb 2015 01:45:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25Z-Keil-Determine-Memory-Address-of-Ports/m-p/365750#M18833</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2015-02-13T01:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: KL25Z Keil: Determine Memory Address of Ports</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25Z-Keil-Determine-Memory-Address-of-Ports/m-p/365751#M18834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I downloaded the file &lt;A href="http://cache.freescale.com/files/32bit/software/KL25_SC.exe?fr=gtl" title="FRDM-KL25Z and TWRKL25Z48M Sample Code Package"&gt;&lt;SPAN style="color: #0066cc; text-decoration: underline;"&gt;FRDM-KL25Z and TWRKL25Z48M Sample Code Package&lt;/SPAN&gt;&lt;/A&gt; and unpacked it using WinRAR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I only see coding in C. I should of mentioned this before, the class is programming with assembly. We're not allowed to program in C. Not yet at least.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 06:56:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25Z-Keil-Determine-Memory-Address-of-Ports/m-p/365751#M18834</guid>
      <dc:creator>jameshayek</dc:creator>
      <dc:date>2015-02-13T06:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: KL25Z Keil: Determine Memory Address of Ports</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25Z-Keil-Determine-Memory-Address-of-Ports/m-p/365752#M18835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi James,&lt;/P&gt;&lt;P&gt;Yes It's necessary to check the address of registers careful before you handle them.&lt;/P&gt;&lt;P&gt;Any way, if you have some questions about the Kinetis MCU, please just feel free to create a thread in the community and we will follow it.&lt;BR /&gt;Have a great day.&lt;/P&gt;&lt;P&gt;Ping&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>Fri, 13 Feb 2015 07:34:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL25Z-Keil-Determine-Memory-Address-of-Ports/m-p/365752#M18835</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2015-02-13T07:34:58Z</dc:date>
    </item>
  </channel>
</rss>

