<?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: Problems with sets of inputs and outputs with SCTimer in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problems-with-sets-of-inputs-and-outputs-with-SCTimer/m-p/1313167#M45965</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I understand where is the problem.&lt;BR /&gt;I hadn't seen that&amp;nbsp;the "SCTIMER_SetupPwm" function creates 2 events for each configured output.&lt;BR /&gt;So I having 4 outputs and 3 inputs I reach the 11 events created instead the maximum number of events is:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* @brief Number of events */&lt;BR /&gt;&lt;STRONG&gt;#define FSL_FEATURE_SCT_NUMBER_OF_EVENTS (10)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Can I increase this define?Is there any problem with changing its value?&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;</description>
    <pubDate>Mon, 26 Jul 2021 10:14:35 GMT</pubDate>
    <dc:creator>Rainbow73</dc:creator>
    <dc:date>2021-07-26T10:14:35Z</dc:date>
    <item>
      <title>Problems with sets of inputs and outputs with SCTimer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problems-with-sets-of-inputs-and-outputs-with-SCTimer/m-p/1313014#M45959</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;I configured 4 outputs from the MCUXpresso&lt;BR /&gt;tool as shown by the function SCTimer_1_int generated automatically by the tool (see below).&lt;/P&gt;&lt;P&gt;I added the LookSpeedCtrl function that I need to see if the pulse value changes on the inputs to understand if there has been a block of the connected devices.&lt;BR /&gt;What I see is that if I activate the code as shown under the command of the fourth output it no longer works. Instead if I remove the LookSpeedCtrl function it starts working again. Where is the problem in your opinion? What am I doing wrong?&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void &lt;STRONG&gt;LookSpeedCtrl&lt;/STRONG&gt;(void)&lt;BR /&gt;{&lt;BR /&gt;/* Schedule an event to look for a rising edge on input 1 */&lt;BR /&gt;if (SCTIMER_CreateAndScheduleEvent(SCTIMER_1_PERIPHERAL,&lt;BR /&gt;kSCTIMER_InputRiseEvent,&lt;BR /&gt;0,&lt;BR /&gt;kSCTIMER_Input_1,&lt;BR /&gt;kSCTIMER_Counter_L,&lt;BR /&gt;&amp;amp;initialRisingEdgeInput1) == kStatus_Fail)&lt;BR /&gt;{&lt;BR /&gt;PRINTF(" SCTIMER_CreateAndScheduleEvent1 ERROR \r\n");&lt;BR /&gt;return(-1);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if (SCTIMER_SetupCaptureAction(SCTIMER_1_PERIPHERAL,&lt;BR /&gt;kSCTIMER_Counter_L,&lt;BR /&gt;&amp;amp;CaptureReg1,&lt;BR /&gt;initialRisingEdgeInput1) == kStatus_Fail)&lt;BR /&gt;{&lt;BR /&gt;PRINTF(" SCTIMER_SetupCaptureAction1 ERROR \r\n");&lt;BR /&gt;return(-1);&lt;BR /&gt;}&lt;BR /&gt;/* Schedule an event to look for a rising edge on input 2 */&lt;BR /&gt;if (SCTIMER_CreateAndScheduleEvent(SCTIMER_1_PERIPHERAL,&lt;BR /&gt;kSCTIMER_InputRiseEvent,&lt;BR /&gt;0,&lt;BR /&gt;kSCTIMER_Input_2,&lt;BR /&gt;kSCTIMER_Counter_L,&lt;BR /&gt;&amp;amp;initialRisingEdgeInput2) == kStatus_Fail)&lt;BR /&gt;{&lt;BR /&gt;PRINTF(" SCTIMER_CreateAndScheduleEvent2 ERROR \r\n");&lt;BR /&gt;return(-1);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if (SCTIMER_SetupCaptureAction(SCTIMER_1_PERIPHERAL,&lt;BR /&gt;kSCTIMER_Counter_L,&lt;BR /&gt;&amp;amp;CaptureReg2,&lt;BR /&gt;initialRisingEdgeInput2) == kStatus_Fail)&lt;BR /&gt;{&lt;BR /&gt;PRINTF(" SCTIMER_SetupCaptureAction2 ERROR \r\n");&lt;BR /&gt;return(-1);&lt;BR /&gt;}&lt;BR /&gt;/* Schedule an event to look for a rising edge on input 3 */&lt;BR /&gt;if (SCTIMER_CreateAndScheduleEvent(SCTIMER_1_PERIPHERAL,&lt;BR /&gt;kSCTIMER_InputRiseEvent,&lt;BR /&gt;0,&lt;BR /&gt;kSCTIMER_Input_3,&lt;BR /&gt;kSCTIMER_Counter_L,&lt;BR /&gt;&amp;amp;initialRisingEdgeInput3) == kStatus_Fail)&lt;BR /&gt;{&lt;BR /&gt;PRINTF(" SCTIMER_CreateAndScheduleEvent3 ERROR \r\n");&lt;BR /&gt;return(-1);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;if (SCTIMER_SetupCaptureAction(SCTIMER_1_PERIPHERAL,&lt;BR /&gt;kSCTIMER_Counter_L,&lt;BR /&gt;&amp;amp;CaptureReg3,&lt;BR /&gt;initialRisingEdgeInput3) == kStatus_Fail)&lt;BR /&gt;{&lt;BR /&gt;PRINTF(" SCTIMER_SetupCaptureAction3 ERROR \r\n");&lt;BR /&gt;return(-1);&lt;BR /&gt;}&lt;BR /&gt;/* Set the callback funcitons */&lt;BR /&gt;SCTIMER_SetCallback(SCTIMER_1_PERIPHERAL, SCT_Initial_Detection_Callback1, initialRisingEdgeInput1);&lt;BR /&gt;SCTIMER_SetCallback(SCTIMER_1_PERIPHERAL, SCT_Initial_Detection_Callback2, initialRisingEdgeInput2);&lt;BR /&gt;SCTIMER_SetCallback(SCTIMER_1_PERIPHERAL, SCT_Initial_Detection_Callback3, initialRisingEdgeInput3);&lt;/P&gt;&lt;P&gt;/* Enable interrupts for both events */&lt;BR /&gt;SCTIMER_EnableInterrupts(SCTIMER_1_PERIPHERAL, 1 &amp;lt;&amp;lt; initialRisingEdgeInput1);&lt;BR /&gt;SCTIMER_EnableInterrupts(SCTIMER_1_PERIPHERAL, 1 &amp;lt;&amp;lt; initialRisingEdgeInput2);&lt;BR /&gt;SCTIMER_EnableInterrupts(SCTIMER_1_PERIPHERAL, 1 &amp;lt;&amp;lt; initialRisingEdgeInput3);&lt;/P&gt;&lt;P&gt;NVIC_EnableIRQ(SCTIMER_1_IRQN);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;const sctimer_config_t &lt;STRONG&gt;SCTimer_1_initConfig&lt;/STRONG&gt; = {&lt;BR /&gt;.enableCounterUnify = true,&lt;BR /&gt;.clockMode = kSCTIMER_System_ClockMode,&lt;BR /&gt;.clockSelect = kSCTIMER_Clock_On_Rise_Input_0,&lt;BR /&gt;.enableBidirection_l = false,&lt;BR /&gt;.enableBidirection_h = false,&lt;BR /&gt;.prescale_l = 0,&lt;BR /&gt;.prescale_h = 0,&lt;BR /&gt;.outInitState = (uint8_t)(0)&lt;BR /&gt;};&lt;BR /&gt;void &lt;STRONG&gt;SCTimer_1_init&lt;/STRONG&gt;(void) {&lt;BR /&gt;SCTIMER_Init(SCTIMER_1_PERIPHERAL, &amp;amp;SCTimer_1_initConfig);&lt;BR /&gt;/* Initialization of state 0 */&lt;BR /&gt;SCTIMER_SetupPwm(SCTIMER_1_PERIPHERAL, &amp;amp;SCTimer_1_pwmSignalsConfig[0], kSCTIMER_EdgeAlignedPwm, 24000U, SCTIMER_1_CLOCK_FREQ, &amp;amp;SCTimer_1_pwmEvent[0]);&lt;BR /&gt;SCTIMER_SetupPwm(SCTIMER_1_PERIPHERAL, &amp;amp;SCTimer_1_pwmSignalsConfig[1], kSCTIMER_EdgeAlignedPwm, 24000U, SCTIMER_1_CLOCK_FREQ, &amp;amp;SCTimer_1_pwmEvent[1]);&lt;BR /&gt;SCTIMER_SetupPwm(SCTIMER_1_PERIPHERAL, &amp;amp;SCTimer_1_pwmSignalsConfig[2], kSCTIMER_EdgeAlignedPwm, 24000U, SCTIMER_1_CLOCK_FREQ, &amp;amp;SCTimer_1_pwmEvent[2]);&lt;BR /&gt;SCTIMER_SetupPwm(SCTIMER_1_PERIPHERAL, &amp;amp;SCTimer_1_pwmSignalsConfig[3], kSCTIMER_EdgeAlignedPwm, 24000U, SCTIMER_1_CLOCK_FREQ, &amp;amp;SCTimer_1_pwmEvent[3]);&lt;/P&gt;&lt;P&gt;LookSpeedCtrl();&lt;/P&gt;&lt;P&gt;SCTIMER_StartTimer(SCTIMER_1_PERIPHERAL, kSCTIMER_Counter_L);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 06:07:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problems-with-sets-of-inputs-and-outputs-with-SCTimer/m-p/1313014#M45959</guid>
      <dc:creator>Rainbow73</dc:creator>
      <dc:date>2021-07-26T06:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with sets of inputs and outputs with SCTimer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problems-with-sets-of-inputs-and-outputs-with-SCTimer/m-p/1313167#M45965</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I understand where is the problem.&lt;BR /&gt;I hadn't seen that&amp;nbsp;the "SCTIMER_SetupPwm" function creates 2 events for each configured output.&lt;BR /&gt;So I having 4 outputs and 3 inputs I reach the 11 events created instead the maximum number of events is:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* @brief Number of events */&lt;BR /&gt;&lt;STRONG&gt;#define FSL_FEATURE_SCT_NUMBER_OF_EVENTS (10)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Can I increase this define?Is there any problem with changing its value?&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 10:14:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problems-with-sets-of-inputs-and-outputs-with-SCTimer/m-p/1313167#M45965</guid>
      <dc:creator>Rainbow73</dc:creator>
      <dc:date>2021-07-26T10:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with sets of inputs and outputs with SCTimer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problems-with-sets-of-inputs-and-outputs-with-SCTimer/m-p/1314144#M45981</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;Hope you are well. Which part number are you using?&lt;BR /&gt;Each device has a limited number of events and that macro tells us the events available in the module. I do not suggest you change it.&lt;BR /&gt;You may consider using the CTimer for the PWM and not exceed the number of events available.&lt;BR /&gt;&lt;BR /&gt;If you have more questions do not hesitate to ask me.&lt;BR /&gt;Best regards,&lt;BR /&gt;Omar&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 00:38:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problems-with-sets-of-inputs-and-outputs-with-SCTimer/m-p/1314144#M45981</guid>
      <dc:creator>Omar_Anguiano</dc:creator>
      <dc:date>2021-07-28T00:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with sets of inputs and outputs with SCTimer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problems-with-sets-of-inputs-and-outputs-with-SCTimer/m-p/1314292#M45982</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;I am using an LPC54606.&lt;/P&gt;&lt;P&gt;For now we have solved it&amp;nbsp; managing two fans with the same pwm output. Are there any examples of PWM management with Ctimer instead of SCTimer? They might be useful to me.&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 06:01:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problems-with-sets-of-inputs-and-outputs-with-SCTimer/m-p/1314292#M45982</guid>
      <dc:creator>Rainbow73</dc:creator>
      <dc:date>2021-07-28T06:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with sets of inputs and outputs with SCTimer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problems-with-sets-of-inputs-and-outputs-with-SCTimer/m-p/1314749#M45993</link>
      <description>&lt;P&gt;Thank you for letting me know your part number.&lt;/P&gt;
&lt;P&gt;The SCTimer of the LPC546xx family is limited to 10 events.&lt;BR /&gt;We have PWM examples with the CTimer at the SDK, I suggest you use it as a reference.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Omar_Anguiano_0-1627495669001.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/151132i903D0C3A45076D60/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Omar_Anguiano_0-1627495669001.png" alt="Omar_Anguiano_0-1627495669001.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If you have more questions do not hesitate to ask me.&lt;BR /&gt;Best regards,&lt;BR /&gt;Omar&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 18:07:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problems-with-sets-of-inputs-and-outputs-with-SCTimer/m-p/1314749#M45993</guid>
      <dc:creator>Omar_Anguiano</dc:creator>
      <dc:date>2021-07-28T18:07:59Z</dc:date>
    </item>
  </channel>
</rss>

