<?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>S32KのトピックRe: print function in s32k144</title>
    <link>https://community.nxp.com/t5/S32K/print-function-in-s32k144/m-p/1510887#M17296</link>
    <description>&lt;P&gt;Please click "Generate Processor Expert Code" and then Build the project.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Generate Processor Expert Code.png" style="width: 757px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/191132i055734207715FF99/image-size/large?v=v2&amp;amp;px=999" role="button" title="Generate Processor Expert Code.png" alt="Generate Processor Expert Code.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Aug 2022 11:36:58 GMT</pubDate>
    <dc:creator>Robin_Shen</dc:creator>
    <dc:date>2022-08-24T11:36:58Z</dc:date>
    <item>
      <title>print function in s32k144</title>
      <link>https://community.nxp.com/t5/S32K/print-function-in-s32k144/m-p/1509540#M17243</link>
      <description>&lt;P&gt;hello all,&lt;/P&gt;&lt;DIV&gt;the one below is the example code for ADC. You can notice, in the code that the output of this code is red, blue and green lights switching on based on the onboard Potentiometer input.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;My Question is : How can I read the exact potentiometer value. How can I print that value. How can I use print function here. So that whenever the potentiometer changes, I can see the value of ADC result in mV (0-5000mv) and also see the change of lights based on the value according to code.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#include "S32K144.h" /* include peripheral declarations S32K144 */
#include "clocks_and_modes.h"
#include "ADC.h"
#define PTD15 15 /* RED LED*/
#define PTD16 16 /* GREEN LED*/
#define PTD0 0   /* BLUE LED */

void PORT_init (void) {
  PCC-&amp;gt;PCCn[PCC_PORTD_INDEX ]|=PCC_PCCn_CGC_MASK;   /* Enable clock for PORTD */
  PORTD-&amp;gt;PCR[PTD0]  =  0x00000100;  /* Port D0: MUX = GPIO */
  PORTD-&amp;gt;PCR[PTD15] =  0x00000100;  /* Port D15: MUX = GPIO */
  PORTD-&amp;gt;PCR[PTD16] =  0x00000100;  /* Port D16: MUX = GPIO */

  PTD-&amp;gt;PDDR |= 1&amp;lt;&amp;lt;PTD0;           /* Port D0:  Data Direction= output */
  PTD-&amp;gt;PDDR |= 1&amp;lt;&amp;lt;PTD15;          /* Port D15: Data Direction= output */
  PTD-&amp;gt;PDDR |= 1&amp;lt;&amp;lt;PTD16;          /* Port D16: Data Direction= output */
}

void WDOG_disable (void){
  WDOG-&amp;gt;CNT=0xD928C520;     /* Unlock watchdog */
  WDOG-&amp;gt;TOVAL=0x0000FFFF;   /* Maximum timeout value */
  WDOG-&amp;gt;CS = 0x00002100;    /* Disable watchdog */
}

int main(void)
{
  uint32_t adcResultInMv=0;

  WDOG_disable();        /* Disable WDOG*/
  SOSC_init_8MHz();      /* Initialize system oscillator for 8 MHz xtal */
  SPLL_init_160MHz();    /* Initialize SPLL to 160 MHz with 8 MHz SOSC */
  NormalRUNmode_80MHz(); /* Init clocks: 80 MHz sysclk &amp;amp; core, 40 MHz bus, 20 MHz flash */
  PORT_init();                  /* Init  port clocks and gpio outputs */
  ADC_init();            /* Init ADC resolution 12 bit*/

  for(;;) {
    convertAdcChan(12);                   /* Convert Channel AD12 to pot on EVB */
    while(adc_complete()==0){}            /* Wait for conversion complete flag */
    adcResultInMv = read_adc_chx();       /* Get channel's conversion results in mv */

    if (adcResultInMv &amp;gt; 3750) {           /* If result &amp;gt; 3.75V */
      PTD-&amp;gt;PSOR |= 1&amp;lt;&amp;lt;PTD0 | 1&amp;lt;&amp;lt;PTD16;    /* turn off blue, green LEDs */
      PTD-&amp;gt;PCOR |= 1&amp;lt;&amp;lt;PTD15;              /* turn on red LED */
    }
    else if (adcResultInMv &amp;gt; 2500) {      /* If result &amp;gt; 2.5V */
      PTD-&amp;gt;PSOR |= 1&amp;lt;&amp;lt;PTD0 | 1&amp;lt;&amp;lt;PTD15;    /* turn off blue, red LEDs */
      PTD-&amp;gt;PCOR |= 1&amp;lt;&amp;lt;PTD16;                /* turn on green LED */
    }
    else if (adcResultInMv &amp;gt;1250) {       /* If result &amp;gt; 1.25V */
      PTD-&amp;gt;PSOR |= 1&amp;lt;&amp;lt;PTD15 | 1&amp;lt;&amp;lt;PTD16;   /* turn off red, green LEDs */
      PTD-&amp;gt;PCOR |= 1&amp;lt;&amp;lt;PTD0;            /* turn on blue LED */
    }
    else {
      PTD-&amp;gt;PSOR |= 1&amp;lt;&amp;lt;PTD0 | 1&amp;lt;&amp;lt; PTD15 | 1&amp;lt;&amp;lt;PTD16; /* Turn off all LEDs */
    }

    convertAdcChan(29);                   /* Convert chan 29, Vrefsh */
    while(adc_complete()==0){}            /* Wait for conversion complete flag */
    adcResultInMv = read_adc_chx();       /* Get channel's conversion results in mv */
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope, you understood my question. Please help me out how ever possiblle. Thank You&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 12:35:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/print-function-in-s32k144/m-p/1509540#M17243</guid>
      <dc:creator>akhilranga</dc:creator>
      <dc:date>2022-08-22T12:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: print function in s32k144</title>
      <link>https://community.nxp.com/t5/S32K/print-function-in-s32k144/m-p/1509910#M17261</link>
      <description>&lt;P&gt;Hi &lt;A id="link_6" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://community.nxp.com/t5/user/viewprofilepage/user-id/203425" target="_self" aria-label="View Profile of akhilranga"&gt;&lt;SPAN class=""&gt;akhilranga&lt;/SPAN&gt;&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;Please refer to &lt;STRONG&gt;adc_hwtrigger_s32k144&lt;/STRONG&gt; in &lt;STRONG&gt;S32SDK S32K1xx RTM&lt;/STRONG&gt;:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="adc_hwtrigger_s32k144.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/190956iA089916C23D7B7B3/image-size/large?v=v2&amp;amp;px=999" role="button" title="adc_hwtrigger_s32k144.png" alt="adc_hwtrigger_s32k144.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I don't know what version of S32DS you are using. Here are the two latest SDK versions in S32DS ARM2.2 and S32DS 3.4:&lt;BR /&gt;&lt;A href="https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/S32-Design-Studio-for-ARM-2-2-Update-1-available/ta-p/1107002" target="_self"&gt;S32 Design Studio for ARM 2.2 - Update 1 available&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/S32-Design-Studio-v3-4-S32K1-Service-Pack-1-released/ta-p/1299799" target="_self"&gt;S32 Design Studio v3.4 S32K1 Service Pack 1 released!&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Robin&lt;BR /&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 05:56:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/print-function-in-s32k144/m-p/1509910#M17261</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2022-08-23T05:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: print function in s32k144</title>
      <link>https://community.nxp.com/t5/S32K/print-function-in-s32k144/m-p/1510686#M17285</link>
      <description>&lt;P&gt;Hello there i am using S32kDS for ARM v1.3.&amp;nbsp;&lt;/P&gt;&lt;P&gt;And i dont have this SDK&amp;nbsp;&lt;STRONG&gt;S32SDK S32K1xx RTM&lt;/STRONG&gt;&lt;SPAN&gt;:.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How can i get this.Please asssit me.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank You&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 07:13:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/print-function-in-s32k144/m-p/1510686#M17285</guid>
      <dc:creator>akhilranga</dc:creator>
      <dc:date>2022-08-24T07:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: print function in s32k144</title>
      <link>https://community.nxp.com/t5/S32K/print-function-in-s32k144/m-p/1510714#M17289</link>
      <description>&lt;P&gt;The version of S32DS you are using is too old, it is recommended to use a new version for development.&lt;/P&gt;
&lt;P&gt;Anyway, please install S32K1 SDK by refer to:&amp;nbsp;&lt;A href="https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/S32-Design-Studio-for-Arm-v1-3-Update-3-4-available/ta-p/1112371" target="_self"&gt;S32 Design Studio for Arm v1.3 - Update 3 &amp;amp; 4 available&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 07:34:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/print-function-in-s32k144/m-p/1510714#M17289</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2022-08-24T07:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: print function in s32k144</title>
      <link>https://community.nxp.com/t5/S32K/print-function-in-s32k144/m-p/1510836#M17294</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/57959"&gt;@Robin_Shen&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for the advice about the version 1.3&lt;/P&gt;&lt;P&gt;I tried the adc_hwtrigger, but got lots of errors. can you please help me resolve it. Attaching the screen shot down below.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot (139).png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/191122iE63F6DCF79413395/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot (139).png" alt="Screenshot (139).png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; Thank You&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 10:04:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/print-function-in-s32k144/m-p/1510836#M17294</guid>
      <dc:creator>akhilranga</dc:creator>
      <dc:date>2022-08-24T10:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: print function in s32k144</title>
      <link>https://community.nxp.com/t5/S32K/print-function-in-s32k144/m-p/1510887#M17296</link>
      <description>&lt;P&gt;Please click "Generate Processor Expert Code" and then Build the project.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Generate Processor Expert Code.png" style="width: 757px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/191132i055734207715FF99/image-size/large?v=v2&amp;amp;px=999" role="button" title="Generate Processor Expert Code.png" alt="Generate Processor Expert Code.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 11:36:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/print-function-in-s32k144/m-p/1510887#M17296</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2022-08-24T11:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: print function in s32k144</title>
      <link>https://community.nxp.com/t5/S32K/print-function-in-s32k144/m-p/1512328#M17337</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/57959"&gt;@Robin_Shen&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, I was able to do build the code without erorr. I jsut had one last doubt . Where can i acess that print function. I mean where can i see the ADC&amp;nbsp; valuse which were being printed by the function.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 11:20:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/print-function-in-s32k144/m-p/1512328#M17337</guid>
      <dc:creator>akhilranga</dc:creator>
      <dc:date>2022-08-26T11:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: print function in s32k144</title>
      <link>https://community.nxp.com/t5/S32K/print-function-in-s32k144/m-p/1512652#M17343</link>
      <description>&lt;P&gt;The example documentation can be found in the S32 SDK documentation at Examples and Demos section. (&amp;lt;SDK_PATH&amp;gt;/doc/Start_Here.html) Please read the manual of &lt;STRONG&gt;&lt;EM&gt;ADC Hardware Trigger&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ADC Hardware Trigger.png" style="width: 573px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/191498i5605756937C5ACE5/image-size/large?v=v2&amp;amp;px=999" role="button" title="ADC Hardware Trigger.png" alt="ADC Hardware Trigger.png" /&gt;&lt;/span&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Aug 2022 01:33:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/print-function-in-s32k144/m-p/1512652#M17343</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2022-08-27T01:33:59Z</dc:date>
    </item>
  </channel>
</rss>

