<?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 S32K144 GPIO register in S32K</title>
    <link>https://community.nxp.com/t5/S32K/S32K144-GPIO-register/m-p/1787019#M30518</link>
    <description>&lt;P&gt;I'm using the S32K144 EVB board.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm learning about &amp;lt;2.1 Hello world&amp;gt; in AN5413 document. It works well for the relevant part.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Additionally, I wanted to know about the Port Data Output Register (PDOR), so I programmed it as follows.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The LED lights up only when the Reset button is pressed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please explain the &lt;EM&gt;Port Data Output Register (PDOR).&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// ****************************************************&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;for (;;)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; if (PTC-&amp;gt;PDIR &amp;amp; (1&amp;lt;&amp;lt;PTC12)) { /* If Pad Data Input = 1 (BTN0 [SW2] pushed) */&lt;BR /&gt;&amp;nbsp; // PTD-&amp;gt; PCOR |= 1&amp;lt;&amp;lt;PTD0; /* Clear Output on port D0 (LED on) */&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;PTD-&amp;gt;PDOR|= 0&amp;lt;&amp;lt;PTD0;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; else { /* If BTN0 was not pushed */&lt;BR /&gt;&amp;nbsp; // PTD-&amp;gt; PSOR |= 1&amp;lt;&amp;lt;PTD0; /* Set Output on port D0 (LED off) */&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;PTD-&amp;gt;PDOR|= 1&amp;lt;&amp;lt;PTD0;}&lt;BR /&gt;&lt;BR /&gt;}&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Jan 2024 08:31:05 GMT</pubDate>
    <dc:creator>autics</dc:creator>
    <dc:date>2024-01-11T08:31:05Z</dc:date>
    <item>
      <title>S32K144 GPIO register</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-GPIO-register/m-p/1787019#M30518</link>
      <description>&lt;P&gt;I'm using the S32K144 EVB board.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm learning about &amp;lt;2.1 Hello world&amp;gt; in AN5413 document. It works well for the relevant part.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Additionally, I wanted to know about the Port Data Output Register (PDOR), so I programmed it as follows.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The LED lights up only when the Reset button is pressed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please explain the &lt;EM&gt;Port Data Output Register (PDOR).&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// ****************************************************&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;for (;;)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; if (PTC-&amp;gt;PDIR &amp;amp; (1&amp;lt;&amp;lt;PTC12)) { /* If Pad Data Input = 1 (BTN0 [SW2] pushed) */&lt;BR /&gt;&amp;nbsp; // PTD-&amp;gt; PCOR |= 1&amp;lt;&amp;lt;PTD0; /* Clear Output on port D0 (LED on) */&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;PTD-&amp;gt;PDOR|= 0&amp;lt;&amp;lt;PTD0;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; else { /* If BTN0 was not pushed */&lt;BR /&gt;&amp;nbsp; // PTD-&amp;gt; PSOR |= 1&amp;lt;&amp;lt;PTD0; /* Set Output on port D0 (LED off) */&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;PTD-&amp;gt;PDOR|= 1&amp;lt;&amp;lt;PTD0;}&lt;BR /&gt;&lt;BR /&gt;}&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 08:31:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-GPIO-register/m-p/1787019#M30518</guid>
      <dc:creator>autics</dc:creator>
      <dc:date>2024-01-11T08:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144 GPIO register</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-GPIO-register/m-p/1788259#M30615</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/153026"&gt;@autics&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Each port pin is mapped to the following 32-bit GPIO registers, each bit represents a pin in the port x:&lt;/P&gt;
&lt;UL style="direction: ltr; unicode-bidi: embed; margin-top: 0in; margin-bottom: 0in;" type="disc"&gt;
&lt;LI lang="es-MX" style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"&gt;&lt;SPAN&gt;GPIOx-&amp;gt;PDOR. Data Output&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI lang="es-MX" style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"&gt;&lt;SPAN&gt;GPIOx-&amp;gt;PSOR. Set Output&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI lang="es-MX" style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"&gt;&lt;SPAN&gt;GPIOx-&amp;gt;PCOR. Clear Output.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI lang="es-MX" style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"&gt;&lt;SPAN&gt;GPIOx-&amp;gt;PTOR. Toggle Output&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI lang="es-MX" style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"&gt;&lt;SPAN&gt;GPIOx-&amp;gt;PDIR. Input register&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI lang="es-MX" style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"&gt;&lt;SPAN&gt;GPIOx-&amp;gt;PIDR. Input disable register&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI lang="es-MX" style="margin-top: 0; margin-bottom: 0; vertical-align: middle;"&gt;&lt;SPAN&gt;GPIOx-&amp;gt; PDDR. Data Direction register&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;If the PDIR of a pin is cleared, then it is configured as an input. If the PDIR of a pin is set, it&amp;nbsp;is configured as output, which means that the logic state is controlled via &lt;STRONG&gt;PDOR&lt;/STRONG&gt; or PCOR, PSOR and PTOR.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In your code modification, you are trying to clear the output for PTD0 with "PTD-&amp;gt;PDOR|= 0&amp;lt;&amp;lt;PTD0". To clear a bit, it should be instead done with the AND operator, for example: "&lt;/SPAN&gt;&lt;SPAN&gt;PTD-&amp;gt;PDOR&amp;amp;= ~(1&amp;lt;&amp;lt;PTD0)"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Clearing the bit could be done this way, or (as the example includes) with the PCOR register. This is the same as setting the bit with PDOR or with PSOR (as the example includes).&lt;/P&gt;
&lt;P&gt;I hope you find this helpful.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Julián.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2024 23:24:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-GPIO-register/m-p/1788259#M30615</guid>
      <dc:creator>Julián_AragónM</dc:creator>
      <dc:date>2024-01-12T23:24:34Z</dc:date>
    </item>
  </channel>
</rss>

