<?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: getting a PWM going on ColdFire in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/getting-a-PWM-going-on-ColdFire/m-p/130193#M730</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;well, i finally got it working. the problem was mainly the header had the wrong address for the period and duty cycle registers!!!! also, i aws misusing the dty() and per() macros (they do not do what i thought they did), so i just used the hex values for the assignment, and it works fine!&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Mar 2006 02:34:58 GMT</pubDate>
    <dc:creator>airswit</dc:creator>
    <dc:date>2006-03-30T02:34:58Z</dc:date>
    <item>
      <title>getting a PWM going on ColdFire</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/getting-a-PWM-going-on-ColdFire/m-p/130192#M729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to get my PWM to work on my eval board for the CF5213. I have entered the code below, and called it from the main function. I want a really long period (about 3 seconds), which is why I am using a 16 bit channel. I have the output (PWM1) hooked up to an LED through a transistor. When i reset the board, and start sending the code, the led is lit (meaning it is a GPIO, i guess). Once the code starts running, the LED turns off...and stays off. any suggestions?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;void pwm_setup(void)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// MCF_GPIO_DDRTD = MCF_GPIO_DDRTD_DDRTD0 | MCF_GPIO_DDRTD_DDRTD1; //set data direction register&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_GPIO_PTDPAR = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| MCF_GPIO_PTDPAR_PTDPAR0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| MCF_GPIO_PTDPAR_PTDPAR1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| MCF_GPIO_PTDPAR_PTDPAR2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| MCF_GPIO_PTDPAR_PTDPAR3; //set for primary function&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_PWM_PWMCLK = 0 | MCF_PWM_PWMCLK_PCLK1; //set scaled clock input&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_PWM_PWMPRCLK = MCF_PWM_PWMPRCLK_PCKA(7); //set prescale to 2^7&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_PWM_PWMCTL = 0 | MCF_PWM_PWMCTL_CON01; //make PWM1 16 bits wide&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_PWM_PWMSCLA = MCF_PWM_PWMSCLA_SCALEA(0x7); //divide prescale by 256&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_PWM_PWMPER0 = MCF_PWM_PWMPER(0x0E); //high order period divider&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_PWM_PWMPER1 = MCF_PWM_PWMPER(0x4E); //low order period divider&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_PWM_PWMDTY0 = MCF_PWM_PWMDTY(0x07); //high order duty cycle&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_PWM_PWMDTY1 = MCF_PWM_PWMDTY(0x27); //low order duty cycle&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MCF_PWM_PWME = 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| MCF_PWM_PWME_PWME1; //enable PWM channel 1 &amp;amp; 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;p.s. the PWM seems to be set up correctly, because if I change the polarity of the PWM1 channel, the led is opposite (on). it seems as though it is just not starting to count.&lt;/SPAN&gt;&lt;P&gt;Message Edited by airswit on &lt;SPAN class="date_text"&gt;03-25-2006&lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;07:17 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Mar 2006 08:04:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/getting-a-PWM-going-on-ColdFire/m-p/130192#M729</guid>
      <dc:creator>airswit</dc:creator>
      <dc:date>2006-03-26T08:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: getting a PWM going on ColdFire</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/getting-a-PWM-going-on-ColdFire/m-p/130193#M730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;well, i finally got it working. the problem was mainly the header had the wrong address for the period and duty cycle registers!!!! also, i aws misusing the dty() and per() macros (they do not do what i thought they did), so i just used the hex values for the assignment, and it works fine!&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Mar 2006 02:34:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/getting-a-PWM-going-on-ColdFire/m-p/130193#M730</guid>
      <dc:creator>airswit</dc:creator>
      <dc:date>2006-03-30T02:34:58Z</dc:date>
    </item>
  </channel>
</rss>

