<?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 PWM - play music in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-play-music/m-p/219797#M9211</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to convert songs such as "wav" and play it on s12x. How I do that?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any program that converts the music in any format, so I just need to load the values on the accumulators and store them on the registers of the PWM?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank's for your attention!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 28 Aug 2010 08:30:23 GMT</pubDate>
    <dc:creator>z2Bmnj</dc:creator>
    <dc:date>2010-08-28T08:30:23Z</dc:date>
    <item>
      <title>PWM - play music</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-play-music/m-p/219797#M9211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to convert songs such as "wav" and play it on s12x. How I do that?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any program that converts the music in any format, so I just need to load the values on the accumulators and store them on the registers of the PWM?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank's for your attention!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Aug 2010 08:30:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-play-music/m-p/219797#M9211</guid>
      <dc:creator>z2Bmnj</dc:creator>
      <dc:date>2010-08-28T08:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: PWM - play music</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-play-music/m-p/219798#M9212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess you didn't read this application note yet:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://cache.freescale.com/files/product/doc/AN2250.pdf?fpsp=1&amp;amp;WT_TYPE=Application%20Notes&amp;amp;WT_VENDOR=FREESCALE&amp;amp;WT_FILE_FORMAT=pdf&amp;amp;WT_ASSET=Documentation" rel="nofollow" target="_blank"&gt;AN2250&lt;/A&gt;&amp;nbsp;&lt;SPAN&gt;Audio Reproduction on HCS12 Microcontrollers&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some zip files with souce code&amp;nbsp;are available here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=S12D&amp;amp;fpsp=1&amp;amp;tab=Documentation_Tab" rel="nofollow" target="_blank"&gt;http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=S12D&amp;amp;fpsp=1&amp;amp;tab=Documentation_Tab&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Aug 2010 00:00:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-play-music/m-p/219798#M9212</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2010-08-29T00:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: PWM - play music</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-play-music/m-p/219799#M9213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is also a Perl script that converts WAV files into ASM tables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://github.com/hotwolf/HSW12/blob/master/Perl/wav2asm.pl" rel="nofollow" target="_blank"&gt;http://github.com/hotwolf/HSW12/blob/master/Perl/wav2asm.pl&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is based on AN2250. The input format is WAV 11.025kHz 8-bit mono. The output is a set of ASM tables containing 8-bit values to be passed on to the PWM. Each table fits into a 16k flash page.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Aug 2010 14:58:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-play-music/m-p/219799#M9213</guid>
      <dc:creator>hotwolf</dc:creator>
      <dc:date>2010-08-30T14:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: PWM - play music</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-play-music/m-p/219800#M9214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Thanks for the answers!&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;I managed to convert a small music to asm file by the perl script. (with&amp;nbsp;the aid of GoldWave)&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;But I had another problem now ...&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ebeff9;"&gt;I configured the period of the PWM at 11.05 KHz.&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;And I used a PTI interrupt to store the values of the asm file on the Duty Cycle of PWM.&lt;BR /&gt;(The time used was 11,111KHz)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Using an oscilloscope, the period found was: 2.75 kHz ...&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;What is my mistake?&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;PS: the microcontroller clock frequency is 8 KHz.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Thanks again for your attention!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Sep 2010 07:27:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-play-music/m-p/219800#M9214</guid>
      <dc:creator>z2Bmnj</dc:creator>
      <dc:date>2010-09-10T07:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: PWM - play music</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-play-music/m-p/219801#M9215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You meant 8&lt;FONT color="#ff0000"&gt;&lt;STRONG&gt;M&lt;/STRONG&gt;&lt;/FONT&gt;Hz bus clock, I think?&lt;/P&gt;&lt;P&gt;How did you configure PWM period? Is oscilator running?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Sep 2010 11:48:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-play-music/m-p/219801#M9215</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2010-09-10T11:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: PWM - play music</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-play-music/m-p/219802#M9216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ops...&lt;/P&gt;&lt;P&gt;Yes, is 8 MHz...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code is in Attachment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Sep 2010 06:30:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-play-music/m-p/219802#M9216</guid>
      <dc:creator>z2Bmnj</dc:creator>
      <dc:date>2010-09-11T06:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: PWM - play music</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-play-music/m-p/219803#M9217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;8MHz of what? Bus clock? Oscilator clock?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have PMPRCLK=0 (1:1 prescaler), PWMCAE=$80 (center aligned), PWMCLK=$80 (clock SB),&amp;nbsp;PWMSCLB=0 (SB clock is&amp;nbsp;clock B&amp;nbsp;/512), PWMPER=$FF (PWM period = $FF=255 SB clocks). I think ith these settings and 8MHz bus clock you should get 8MHz / 2 / 512 / 255 = 30.6Hz PWM period. Where first /2 divider is due to center aligned mode.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know why do you get 2.75kHz. Setting PWMSCLKB=0 (clock SB = clock B /2) and PWMPER=181 you should get&lt;/P&gt;&lt;P&gt;quite close to 11.05kHz PWM period, of course if your bus clock is really 8MHz. In this case you get less than 8bits PM resolution, duty cycle setting (PWMDTY) is limited from 0 to 181. To get the best resolution use edge aligned mode, no prescaler and concatenated (16bits) mode. PWMDTY67 = 8MHz / 11.05kHz&amp;nbsp; = 724&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Sep 2010 14:34:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-play-music/m-p/219803#M9217</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2010-09-11T14:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: PWM - play music</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-play-music/m-p/219804#M9218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank's for the answers!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's working here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I had the wrong settings of the period.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;I used the 'device initialization'.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Sep 2010 04:01:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-play-music/m-p/219804#M9218</guid>
      <dc:creator>z2Bmnj</dc:creator>
      <dc:date>2010-09-19T04:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: PWM - play music</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-play-music/m-p/219805#M9219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have developed a voice recording and play back system on AVR microcontroller...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It&amp;nbsp; records speech data through mic on Multimedia card and then after recording is done for a certain pres-set period of time.when a button for playback is pressed by the user, it plays back the recorded sound using PWM and analog filters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data is stored on the MMC in binary format with 8-bits per sample resolution and 8KHz Sampling frequency and 0.5Watt loud speaker is used for this purpose...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The sound quality is reasonably good...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;m.yasir&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Oct 2010 16:32:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-play-music/m-p/219805#M9219</guid>
      <dc:creator>m_yasir</dc:creator>
      <dc:date>2010-10-13T16:32:17Z</dc:date>
    </item>
  </channel>
</rss>

