<?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>i.MX ProcessorsのトピックRe: PWM Missing interrupts on 5121 GPT peripherical</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/PWM-Missing-interrupts-on-5121-GPT-peripherical/m-p/1167584#M163476</link>
    <description>&lt;P&gt;As far as i understand.&lt;/P&gt;&lt;P&gt;My post is related with that i am fully unable to trigger this feature:&lt;STRONG&gt; A CPU interrupt can be generated at the beginning of each PWM Period&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This interrupt is a MUST to reload the new duty value on the carrier if the PWM is a wave generator case of use.&lt;/P&gt;&lt;P&gt;The example labeled as GPT_IRQ.zip use the timer under mode &lt;STRONG&gt;0b100&lt;/STRONG&gt; which is a "typical" timer where the full IO activity is software driven aka on the ISR time which is exactly what we would like to avoid. The idea behind this usual stuff is that the software has one cycle off period out of pressure, so the real time behaviour is extended one period at least.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks for your support..&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>Wed, 14 Oct 2020 16:18:52 GMT</pubDate>
    <dc:creator>juanba</dc:creator>
    <dc:date>2020-10-14T16:18:52Z</dc:date>
    <item>
      <title>PWM Missing interrupts on 5121 GPT peripherical</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/PWM-Missing-interrupts-on-5121-GPT-peripherical/m-p/1165418#M163243</link>
      <description>&lt;DIV class="s-prose js-post-body"&gt;&lt;P&gt;I am trying to operate a custom Linux driver for the MCP5121 GPT peripherical unit working as a PWM. The driver settles an interrupt service with the intention to reload a new duty cycle with every hit.&lt;/P&gt;&lt;P&gt;I have checked that the GPT interrupt vector is properly installed and serviced using the IPIC force interrupt register &lt;STRONG&gt;SIFCR&lt;/STRONG&gt;(0x50).&lt;/P&gt;&lt;P&gt;I run a relatively old Linux kernel and the pwm device driver model is not available. So, the pwm software usability interface is assembled with &lt;STRONG&gt;write&lt;/STRONG&gt; system calls. A parameter of 32 bits encodes the window time, the period and the duty cycle/1000.&lt;/P&gt;&lt;P&gt;With below testing values, the driver settles the involved registers as the following, we run with the IPS clocking to 66Mhz(15ns):&lt;/P&gt;&lt;PRE&gt;# echo 0xff0fffff &amp;gt;/dev/mpc5121-pwm
mpc5121-pwm( pwm_open)
mpc5121-pwm( pwm_write)
Mode (0x010) : 0x00000103( 0b0000000100000011 )
pwm.command 0xff0fffff vs 0xff0fffff : Scheduling(4)
Single Shot of 6200(msec) 65104(Hz) duty 783/1000, 15 nsec/tick
PWMOffset (0x018) : duty/1000 783 encoded as 0x03210000: 12015(nsec)
Counter (0x014) : Freq 65104(Hz) encoded as 0x00010400: 15360(nsec)&lt;/PRE&gt;&lt;P&gt;The &lt;STRONG&gt;Mode&lt;/STRONG&gt;(0x010) GPT register valued like this, &lt;EM&gt;should&lt;/EM&gt; enable the interrupt generation with the bit &lt;STRONG&gt;INTEN&lt;/STRONG&gt; toggled and the &lt;EM&gt;TIMER_MS&lt;/EM&gt; field valued as &lt;STRONG&gt;PWM&lt;/STRONG&gt;(0x03) operation valued&lt;/P&gt;&lt;P&gt;After some ticks on the the Linux shell through the &lt;STRONG&gt;read&lt;/STRONG&gt; driver call I see the following:&lt;/P&gt;&lt;PRE&gt;# cat /dev/mpc5121-pwm
mpc5121-pwm( pwm_open)
mpc5121-pwm( pwm_read)
Deadline of 6200 msec vs measurement of 0 -&amp;gt; missed (overrun 0)
Mode (0x010) : 0x00000103( 0b0000000100000011 )
Counter (0x014) : 0x00010400
PWM (0x018) : 0x03210000
Status (0x01c) : 0x00006004

IPIC
SIPNR_H (0x008) : 0x00000000
SIMSR_H (0x020) : 0x008011f9
SIPRR_D (0x1ca) : 0x00000000

# cat /dev/mpc5121-pwm
mpc5121-pwm( pwm_open)
mpc5121-pwm( pwm_read)
Deadline of 6200 msec vs measurement of 0 -&amp;gt; missed (overrun 0)
Mode (0x010) : 0x00000103( 0b0000000100000011 )
Counter (0x014) : 0x00010400
PWM (0x018) : 0x03210000
Status (0x01c) : 0x00002004

IPIC
SIPNR_H (0x008) : 0x00000000
SIMSR_H (0x020) : 0x008011f9
SIPRR_D (0x1ca) : 0x00000000

# cat /dev/mpc5121-pwm
mpc5121-pwm( pwm_open)
mpc5121-pwm( pwm_read)
Deadline of 6200 msec vs measurement of 0 -&amp;gt; missed (overrun 0)
Mode (0x010) : 0x00000103( 0b0000000100000011 )
Counter (0x014) : 0x00010400
PWM (0x018) : 0x03210000
Status (0x01c) : 0x00001004

IPIC
SIPNR_H (0x008) : 0x00000000
SIMSR_H (0x020) : 0x008011f9
SIPRR_D (0x1ca) : 0x00000000&lt;/PRE&gt;&lt;P&gt;The registers value seem stable on the PWM specifications and the timer operative. However, the weird thing is that the GPT unit is not interrupting the CPU and obviously the ISR is not threaded under the PWM behaviour.&lt;/P&gt;&lt;P&gt;I have checked as well the interrupt flow using the pure Timer operation with not IO hardware involved &lt;STRONG&gt;TIMER_MS&lt;/STRONG&gt;(0b1xx). The PWM modality seems on going, the overflow fields on the &lt;STRONG&gt;Status&lt;/STRONG&gt;(0x01c) are moving over its dynamic range of 0 to 7 (3bits).&lt;/P&gt;&lt;P&gt;Should I check other SOC parts? Where can I view some real example code about this particular operation mode?&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 09 Oct 2020 20:48:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/PWM-Missing-interrupts-on-5121-GPT-peripherical/m-p/1165418#M163243</guid>
      <dc:creator>juanba</dc:creator>
      <dc:date>2020-10-09T20:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: PWM Missing interrupts on 5121 GPT peripherical</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/PWM-Missing-interrupts-on-5121-GPT-peripherical/m-p/1166427#M163370</link>
      <description>&lt;P&gt;See the Section 17.1.1.3 of the MPC5121 Reference Manual:&lt;/P&gt;
&lt;P&gt;In PWM mode, the I/O pin is an Output. The user can program period and width values to create an adjustable, repeating output waveform on the I/O pin. A CPU interrupt can be generated at the beginning of each PWM Period, at which time a new Width value can be loaded. The new Width value, which represents ON time, is automatically applied at the beginning of the next period. There is no interrupt at the beginning of the first PWM Period. This mode is suitable for PWM audio encoding.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Attached file contains simple GPT examples. PWM example does not use interrupts, and the second example is example for interrupt using.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 02:53:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/PWM-Missing-interrupts-on-5121-GPT-peripherical/m-p/1166427#M163370</guid>
      <dc:creator>Pavel</dc:creator>
      <dc:date>2020-10-13T02:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: PWM Missing interrupts on 5121 GPT peripherical</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/PWM-Missing-interrupts-on-5121-GPT-peripherical/m-p/1167584#M163476</link>
      <description>&lt;P&gt;As far as i understand.&lt;/P&gt;&lt;P&gt;My post is related with that i am fully unable to trigger this feature:&lt;STRONG&gt; A CPU interrupt can be generated at the beginning of each PWM Period&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This interrupt is a MUST to reload the new duty value on the carrier if the PWM is a wave generator case of use.&lt;/P&gt;&lt;P&gt;The example labeled as GPT_IRQ.zip use the timer under mode &lt;STRONG&gt;0b100&lt;/STRONG&gt; which is a "typical" timer where the full IO activity is software driven aka on the ISR time which is exactly what we would like to avoid. The idea behind this usual stuff is that the software has one cycle off period out of pressure, so the real time behaviour is extended one period at least.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks for your support..&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>Wed, 14 Oct 2020 16:18:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/PWM-Missing-interrupts-on-5121-GPT-peripherical/m-p/1167584#M163476</guid>
      <dc:creator>juanba</dc:creator>
      <dc:date>2020-10-14T16:18:52Z</dc:date>
    </item>
  </channel>
</rss>

