<?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: Interrupt S32K146</title>
    <link>https://community.nxp.com/t5/S32K/Interrupt-S32K146/m-p/1831267#M33181</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;yes I'm using an S32K146 NXP EVB Q-144&lt;/P&gt;&lt;P&gt;The sensor is connected to LPSPI0 the pins are PORTB 2, 3, 4, 5&lt;/P&gt;&lt;P&gt;Yes I can check&amp;nbsp;&lt;SPAN&gt;all the registers in the register view, I can also see that the IRQC is set to 0x9&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(Please check that the interrupt is enabled/pending in NVIC.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ISER_1[31] // Set-enable&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ISPR_1[31] // Set-pending)&lt;/P&gt;&lt;P&gt;So these 2 I should add to my NVIC function?&lt;BR /&gt;&lt;BR /&gt;I'll try again and answer you tomorrow, I don't have the hardware right now &lt;LI-EMOJI id="lia_disappointed-face" title=":disappointed_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Mar 2024 15:13:08 GMT</pubDate>
    <dc:creator>Khaledag</dc:creator>
    <dc:date>2024-03-19T15:13:08Z</dc:date>
    <item>
      <title>Interrupt S32K146</title>
      <link>https://community.nxp.com/t5/S32K/Interrupt-S32K146/m-p/1831141#M33167</link>
      <description>&lt;P&gt;I am trying to read the Interrupt of my Accelerometer Sensor.&amp;nbsp;&lt;BR /&gt;I found a code on the Forum here, and I tested it with the Buttons on the side of the board and worked.&amp;nbsp;&lt;BR /&gt;But when I try to check the Interrupt of my Sensor I see nothing, am I configuring the Pin right?&amp;nbsp;&lt;BR /&gt;Its pin PTE8&lt;BR /&gt;Here is the code:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;void S32_NVIC_EnableIRQ(IRQn_Type IRQn, int Priority)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/* enable interrupt */&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;S32_NVIC-&amp;gt;ISER[(uint32_t)((int32_t)IRQn) &amp;gt;&amp;gt; 5] = (uint32_t)(1 &amp;lt;&amp;lt; ((uint32_t)((int32_t)IRQn) &amp;amp; (uint32_t)0x1F));&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;S32_NVIC-&amp;gt;IP[IRQn] = Priority;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;void PORTC_IRQHandler(void)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;counter++;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;PORTE-&amp;gt;PCR[PTE8] |= PORT_PCR_ISF_MASK;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; PCC-&amp;gt; PCCn[PCC_PORTE_INDEX] = PCC_PCCn_CGC_MASK;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;/* Configure port E8 as GPIO input&amp;nbsp; */&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; PTE-&amp;gt;PDDR &amp;amp;= ~(1&amp;lt;&amp;lt;PTE8);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; PORTE-&amp;gt;PCR[8] = PORT_PCR_MUX(1)|PORT_PCR_PFE_MASK|PORT_PCR_IRQC(0x9); /* Port E8: MUX = GPIO, input filter enabled */&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; S32_NVIC_EnableIRQ(PORTE_IRQn,9);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;thanks in advance.&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 19 Mar 2024 11:51:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Interrupt-S32K146/m-p/1831141#M33167</guid>
      <dc:creator>Khaledag</dc:creator>
      <dc:date>2024-03-19T11:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt S32K146</title>
      <link>https://community.nxp.com/t5/S32K/Interrupt-S32K146/m-p/1831256#M33179</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/230606"&gt;@Khaledag&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Do you use an NXP EVB?&lt;/P&gt;
&lt;P&gt;If so, which revision, and where did you connect the sensor?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you measured the signal at PTE8?&lt;/P&gt;
&lt;P&gt;The voltage must be at least 0.65 x VDD.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you check the all the registers in the register view?&lt;/P&gt;
&lt;P&gt;If the port detects a rising edge, PCR_ISF of PTE8 must be set.&lt;/P&gt;
&lt;P&gt;Please check that the interrupt is enabled/pending in NVIC.&lt;/P&gt;
&lt;P&gt;ISER_1[31] // Set-enable&lt;/P&gt;
&lt;P&gt;ISPR_1[31] // Set-pending&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 15:00:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Interrupt-S32K146/m-p/1831256#M33179</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2024-03-19T15:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt S32K146</title>
      <link>https://community.nxp.com/t5/S32K/Interrupt-S32K146/m-p/1831267#M33181</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;yes I'm using an S32K146 NXP EVB Q-144&lt;/P&gt;&lt;P&gt;The sensor is connected to LPSPI0 the pins are PORTB 2, 3, 4, 5&lt;/P&gt;&lt;P&gt;Yes I can check&amp;nbsp;&lt;SPAN&gt;all the registers in the register view, I can also see that the IRQC is set to 0x9&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(Please check that the interrupt is enabled/pending in NVIC.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ISER_1[31] // Set-enable&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ISPR_1[31] // Set-pending)&lt;/P&gt;&lt;P&gt;So these 2 I should add to my NVIC function?&lt;BR /&gt;&lt;BR /&gt;I'll try again and answer you tomorrow, I don't have the hardware right now &lt;LI-EMOJI id="lia_disappointed-face" title=":disappointed_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 15:13:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Interrupt-S32K146/m-p/1831267#M33181</guid>
      <dc:creator>Khaledag</dc:creator>
      <dc:date>2024-03-19T15:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt S32K146</title>
      <link>https://community.nxp.com/t5/S32K/Interrupt-S32K146/m-p/1832751#M33278</link>
      <description>&lt;P&gt;Hey,&amp;nbsp;&lt;BR /&gt;Thanks again for you answer.&amp;nbsp;&lt;BR /&gt;But could you tell me where I should add these 2 lines?&lt;/P&gt;&lt;P&gt;&amp;nbsp; ISER_1[31] // Set-enable&lt;/P&gt;&lt;P&gt;&amp;nbsp; ISPR_1[31] // Set-pending&lt;/P&gt;&lt;P&gt;and other than that I believe the sensor has a flaw and can't trigger the interrupt and probably the initialization of the pin is successful.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I'm still looking into it, but any other tips regarding the pin initialization and Flag set etc. would be very appreciated.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 08:20:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Interrupt-S32K146/m-p/1832751#M33278</guid>
      <dc:creator>Khaledag</dc:creator>
      <dc:date>2024-03-21T08:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt S32K146</title>
      <link>https://community.nxp.com/t5/S32K/Interrupt-S32K146/m-p/1832826#M33284</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/230606"&gt;@Khaledag&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;You need to debug it from the source.&lt;/P&gt;
&lt;P&gt;1. Check the input signal at the PTE8 port, check the connection between PTE8 header and PTE8 pin of the MCU on the EVB. Does it reach the Vih level.&lt;/P&gt;
&lt;P&gt;2. Does the active edge set the PORT ISF flag&lt;/P&gt;
&lt;P&gt;3. If so, is the interrupt enabled in NVIC. You already set ISER_1[31], but since the interrupt is not active, is it pending in ISPR_1[31]?&lt;/P&gt;
&lt;P&gt;4. If so, is the interrups masked globally, or is there a higher priority interrupt active?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 09:17:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Interrupt-S32K146/m-p/1832826#M33284</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2024-03-21T09:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt S32K146</title>
      <link>https://community.nxp.com/t5/S32K/Interrupt-S32K146/m-p/1837117#M33566</link>
      <description>&lt;P&gt;Thank you for you answer and please excuse my late response.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;this is the code being used now:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;#include "device_registers.h"
#include &amp;lt;stdio.h&amp;gt;

/*! Port PTD0, bit 0: FRDM EVB output to blue LED
 */
#define PTD0  0

/*! Port PTC12, bit 12: FRDM EVB input from BTN0 [SW2]
 */
#define PTC12 12

int counter = 0;

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 		*/
}

void S32_NVIC_EnableIRQ(IRQn_Type IRQn, int Priority)
{
	/* enable interrupt */
	S32_NVIC-&amp;gt;ISER[(uint32_t)((int32_t)IRQn) &amp;gt;&amp;gt; 5] = (uint32_t)(1 &amp;lt;&amp;lt; ((uint32_t)((int32_t)IRQn) &amp;amp; (uint32_t)0x1F));
	S32_NVIC-&amp;gt;ISPR[(uint32_t)((int32_t)IRQn) &amp;gt;&amp;gt; 5] = (uint32_t)(1 &amp;lt;&amp;lt; ((uint32_t)((int32_t)IRQn) &amp;amp; (uint32_t)0x1F));
	S32_NVIC-&amp;gt;IP[IRQn] = Priority;
}


void PORTC_IRQHandler(void)
{
	counter++;
	PORTC-&amp;gt;PCR[PTC12] |= PORT_PCR_ISF_MASK;
}



int main(void)
{

	int counters = 0;

	/*!
	 * Pins definitions
	 * ===================================================
	 *
	 * Pin number        | Function
	 * ----------------- |------------------
	 * PTD0              | GPIO [BLUE LED]
	 * PTC12             | GPIO [SW2]
	 *
	 */


	/*!
	 * Initialization
	 * ===================================================
	 */

	WDOG_disable();/* Disable Watchdog in case it is not done in startup code */
  	PCC-&amp;gt; PCCn[PCC_PORTC_INDEX] = PCC_PCCn_CGC_MASK;

	/* Configure port E8 as GPIO input  */
  	PTC-&amp;gt;PDDR &amp;amp;= ~(1&amp;lt;&amp;lt;PTC12);
  	PORTC-&amp;gt;PCR[12] = PORT_PCR_MUX(1)|PORT_PCR_PFE_MASK|PORT_PCR_IRQC(0x9); /* Port E8: MUX = GPIO, input filter enabled */

  	S32_NVIC_EnableIRQ(PORTC_IRQn,9);

	/*!
	 * Infinite for:
	 * ========================
	 */
		for(;;)
		{
			if (counter &amp;gt; 0) {
				printf("Interrupt occurred! Counter value: %d\n", counter);
				counter = 0; // Reset counter after printing
			  	}

		}
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;I can see that the PCR12 IRQC is set correctly but you're right the NVICIP31 is set to 0x00 the whole time.&amp;nbsp;&lt;BR /&gt;What does that mean?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 08:34:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Interrupt-S32K146/m-p/1837117#M33566</guid>
      <dc:creator>Khaledag</dc:creator>
      <dc:date>2024-03-28T08:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt S32K146</title>
      <link>https://community.nxp.com/t5/S32K/Interrupt-S32K146/m-p/1837156#M33574</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/230606"&gt;@Khaledag&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;You need to write the priority value in the 4 MSB of the IP register:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="danielmartynek_0-1711616941113.png" style="width: 535px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/270936iDDA70B00A63FFBF6/image-dimensions/535x139?v=v2" width="535" height="139" role="button" title="danielmartynek_0-1711616941113.png" alt="danielmartynek_0-1711616941113.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;But the IP register is not the culprit here, because by default the priority is 0, which is the highest priority.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead of writing S32_NVIC-&amp;gt;ISPR, just monitor it.&lt;/P&gt;
&lt;P&gt;Setting this bit makes the interrupt either pending or active.&lt;/P&gt;
&lt;P&gt;The interrupt signal from the PORT module should set the register.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 09:13:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Interrupt-S32K146/m-p/1837156#M33574</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2024-03-28T09:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt S32K146</title>
      <link>https://community.nxp.com/t5/S32K/Interrupt-S32K146/m-p/1837170#M33575</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Khaledag_0-1711618079015.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/270940iB6BDFCE2C7C8CA5B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Khaledag_0-1711618079015.png" alt="Khaledag_0-1711618079015.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I am monitoring the wrong ones here, right?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 09:29:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Interrupt-S32K146/m-p/1837170#M33575</guid>
      <dc:creator>Khaledag</dc:creator>
      <dc:date>2024-03-28T09:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt S32K146</title>
      <link>https://community.nxp.com/t5/S32K/Interrupt-S32K146/m-p/1837242#M33583</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Khaledag_0-1711623278047.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/270962i611B06C8CD4745F9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Khaledag_0-1711623278047.png" alt="Khaledag_0-1711623278047.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;31 is also the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 10:54:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Interrupt-S32K146/m-p/1837242#M33583</guid>
      <dc:creator>Khaledag</dc:creator>
      <dc:date>2024-03-28T10:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt S32K146</title>
      <link>https://community.nxp.com/t5/S32K/Interrupt-S32K146/m-p/1839057#M33704</link>
      <description>&lt;P&gt;Sorry to bother again,&amp;nbsp;&lt;BR /&gt;but could you see a fault in the code? Maybe I'm not understanding correctly what you mean, sorry!&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 07:26:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Interrupt-S32K146/m-p/1839057#M33704</guid>
      <dc:creator>Khaledag</dc:creator>
      <dc:date>2024-04-02T07:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt S32K146</title>
      <link>https://community.nxp.com/t5/S32K/Interrupt-S32K146/m-p/1839274#M33714</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;S32_NVIC-&amp;gt;IP[IRQn] = (Priority &amp;lt;&amp;lt; 4);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 10:48:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Interrupt-S32K146/m-p/1839274#M33714</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2024-04-02T10:48:13Z</dc:date>
    </item>
  </channel>
</rss>

