<?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: Port Control Module and PORTx_PCMy  in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Port-Control-Module-and-PORTx-PCMy/m-p/832260#M50344</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Mark. It turns out that selecting the AsynchroSerial bean from ProcessorExpert is the better choice than the Init_UART bean; the former provides more integration and allows me to select the appropriate mux pins from the dropdown.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am&amp;nbsp;using the AsynchroSerial bean in a project for the "F" version of the dev board, and the same bean in a project for the "D" version. They both are configured through ProcessorExpert with the same set of parameters, and the D board is able to communicate over the serial line to a PC. The F board, however, has some weirdness with the clock generator - the baud rate is just enough off that a PC can't understand it. I'm not sure if this is a defect in my F board, or some subtle difference between them that ProcessorExpert hasn't accounted for. They appear to be using the same source clock, clock multipliers and dividers and parameters to all those devices. Of course with asynch comms, it's difficult to perfectly determine the clock rate since it's not explicit in any output signal. I have attempted to measure it with characters like 0x5As and so on.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 21 Oct 2018 14:53:14 GMT</pubDate>
    <dc:creator>flightyalrighty</dc:creator>
    <dc:date>2018-10-21T14:53:14Z</dc:date>
    <item>
      <title>Port Control Module and PORTx_PCMy</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Port-Control-Module-and-PORTx-PCMy/m-p/832258#M50342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;K60 Sub-Family Data Sheet, Rev. 3, 6/2013, section 8.1 provides a table with 10 different configurations for each pin, and states the PCM "is responsible for selecting which ALT functionality is available on each pin."&amp;nbsp; Simple enough, I want the ALT2 configuration according to that table. Is that one write to a PCM register or multiple writes? How do I decode what's in the table in 8.1 to lines of code? I see lots of examples in the forums where people suggest code snippets like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;PORTC_PCR16=PORT_PCR_MUX(3);&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;I am using KDS and ProcessorExpert. I find a file called MK60F12.h under ProcessorExpert/lib/Kinetis/iofiles which has a collection of these #defines,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;so we have basically a statement with three arguments:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PORTx_PCRy = PORT_PCR_MUX(n) ;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;"x" in PORTx (for my chip, x is from the set {A, B, C, D, E, F})&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;"y" in _PCRy (for my chip, y goes from 0-31)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f;"&gt;(n) in PORT_PCR_MUX(n) (PORT_PCR_MUX is a macro taking a 32-bit unsigned integer)&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f;"&gt;So it seems there might be a rather large number of possible combinations, but one would naturally assume there's some simple means of matching up Section 8.1 with the appropriate values of x, y and n for each ALT configuration? I don't find any further details in the K60 Sub-Family Data Sheet, nor in the User's Guide for the dev boards I'm using (&lt;SPAN style="color: #4a4a4d; font-size: 16px;"&gt;NXP TWR-K60F120M and&amp;nbsp;NXP TWR-K60D100M). Is there one "missing link" document that closes this gap?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Oct 2018 19:29:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Port-Control-Module-and-PORTx-PCMy/m-p/832258#M50342</guid>
      <dc:creator>flightyalrighty</dc:creator>
      <dc:date>2018-10-06T19:29:40Z</dc:date>
    </item>
    <item>
      <title>Re: Port Control Module and PORTx_PCMy</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Port-Control-Module-and-PORTx-PCMy/m-p/832259#M50343</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;To configure and use a port pin there are 3 things to do (if peripheral) or 4 if GPIO:&lt;BR /&gt;1. Enable the clocks to the port in question&lt;BR /&gt;2. Configure the peripheral/GPIO function&lt;BR /&gt;3. Configure the characteristics (pull-up/down/open-drain, driver strength, slew rate)&lt;BR /&gt;4. If GPIO, define the direction and state&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The macro you show is for step 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg. to set PTA13 for CAN0_RX function it would be&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/74158i223507FFF201BF4A/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;PORT&lt;SPAN style="color: #000080;"&gt;A&lt;/SPAN&gt;_PCR&lt;SPAN style="color: #ff0000;"&gt;13&lt;/SPAN&gt; = PORT_PCR_MUX(&lt;SPAN style="color: #003300;"&gt;2&lt;/SPAN&gt;);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This means that you need to look up the ALT function in the data sheet and plug it into the macro (it may or may not be portable between devices since sometimes the ALT number changes).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The uTasker project (see its macros at &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fforum%2Findex.php%3Ftopic%3D1875.0" rel="nofollow" target="_blank"&gt;http://www.utasker.com/forum/index.php?topic=1875.0&lt;/A&gt;&lt;SPAN&gt;) is more user friendly and portable since it does it with&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;_CONFIG_PERIPHERAL(A, 13, (PA_13_CAN0_RX | PORT_PS_UP_ENABLE));&lt;/STRONG&gt;&lt;BR /&gt;which handles &lt;SPAN style="text-decoration: underline;"&gt;all&lt;/SPAN&gt; steps and makes it more readable and reduces error possibilities.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the uTasker simulation the pin capabilities and actually programmed one are shown as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_9.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/74203i461695706B8706A5/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_9.png" alt="pastedImage_9.png" /&gt;&lt;/span&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kinetis: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;BR /&gt;Kinetis K60:&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FTWR-K60N512.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TWR-K60N512.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FTWR-K60D100M.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TWR-K60D100M.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FTWR-K60F120M.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/TWR-K60F120M.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FELZET80_NET-KBED.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/ELZET80_NET-KBED.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FELZET80_NET-K60.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/ELZET80_NET-K60.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;For less questions and faster, cheaper developments: try uTasker for Kinetis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2018 22:00:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Port-Control-Module-and-PORTx-PCMy/m-p/832259#M50343</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2018-10-08T22:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: Port Control Module and PORTx_PCMy</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Port-Control-Module-and-PORTx-PCMy/m-p/832260#M50344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Mark. It turns out that selecting the AsynchroSerial bean from ProcessorExpert is the better choice than the Init_UART bean; the former provides more integration and allows me to select the appropriate mux pins from the dropdown.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am&amp;nbsp;using the AsynchroSerial bean in a project for the "F" version of the dev board, and the same bean in a project for the "D" version. They both are configured through ProcessorExpert with the same set of parameters, and the D board is able to communicate over the serial line to a PC. The F board, however, has some weirdness with the clock generator - the baud rate is just enough off that a PC can't understand it. I'm not sure if this is a defect in my F board, or some subtle difference between them that ProcessorExpert hasn't accounted for. They appear to be using the same source clock, clock multipliers and dividers and parameters to all those devices. Of course with asynch comms, it's difficult to perfectly determine the clock rate since it's not explicit in any output signal. I have attempted to measure it with characters like 0x5As and so on.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 21 Oct 2018 14:53:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Port-Control-Module-and-PORTx-PCMy/m-p/832260#M50344</guid>
      <dc:creator>flightyalrighty</dc:creator>
      <dc:date>2018-10-21T14:53:14Z</dc:date>
    </item>
  </channel>
</rss>

