<?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>CodeWarrior for MCUのトピックRe: PWM HCS08 starter kit, prototype LED light.</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/PWM-HCS08-starter-kit-prototype-LED-light/m-p/196028#M7239</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Whenever a TPM channel has PWM mode enabled (TPMCnSC register setting), the pin associated with the particular channel will become an output, and this will over-ride any setting that the pin may have for general purpose use.&amp;nbsp; Each channel uses a&amp;nbsp;designated pin.&amp;nbsp; Refer to the datasheet for the device you are using.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards,&lt;/DIV&gt;&lt;DIV&gt;Mac&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Nov 2008 01:05:09 GMT</pubDate>
    <dc:creator>bigmac</dc:creator>
    <dc:date>2008-11-04T01:05:09Z</dc:date>
    <item>
      <title>PWM HCS08 starter kit, prototype LED light.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/PWM-HCS08-starter-kit-prototype-LED-light/m-p/196023#M7234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, I just thought I'd ask some questions regarding a project I am doing at University. I have been asked to build a prototype LED light. 25 one colour and 25 another. Both will look white but will have different spectra properties due to the type of LED. This is for a filming project in my Audio and Video Engineering course.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have been told I need to program a microcontroller using PWM to alter the light intensity of each set of LED's. My supervisor told me to get PWM generated and displayed on an oscilloscope. This is where I am confused. How would I test with an oscilloscope? I wasn't really taught PWM properly last year(if anyone knows any good tutorials that would be great). What kind of frequency would I be looking at just to get started and having a successful PWM sub routine working?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;These are general questions and I am not looking for complete answers, just some pointers from the more experienced programmers out there. Thank you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ps I have downloaded all the data sheets, and do know what registers need using...just not sure how to get started.&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2008 04:41:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/PWM-HCS08-starter-kit-prototype-LED-light/m-p/196023#M7234</guid>
      <dc:creator>karmabobby</dc:creator>
      <dc:date>2008-10-22T04:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: PWM HCS08 starter kit, prototype LED light.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/PWM-HCS08-starter-kit-prototype-LED-light/m-p/196024#M7235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I don't know what frequency you need, but you can easily experiment with that. A plain TV has an update frequency of 25Hz and the human eye never notices it.&lt;BR /&gt;&lt;BR /&gt;PWM is real easy to use. You just set the period and the duty cycle and it takes care of everything in the hardware. You could for example have a period of 100Hz and change the duty cycle.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2008 22:09:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/PWM-HCS08-starter-kit-prototype-LED-light/m-p/196024#M7235</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2008-10-22T22:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: PWM HCS08 starter kit, prototype LED light.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/PWM-HCS08-starter-kit-prototype-LED-light/m-p/196025#M7236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Yeah it doesn't seem to bad from what I have been reading. A few basic calculations and setting correct values in a few registers. Ill post back with what I have come up with. Thanks anyway&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2008 23:58:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/PWM-HCS08-starter-kit-prototype-LED-light/m-p/196025#M7236</guid>
      <dc:creator>karmabobby</dc:creator>
      <dc:date>2008-10-22T23:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: PWM HCS08 starter kit, prototype LED light.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/PWM-HCS08-starter-kit-prototype-LED-light/m-p/196026#M7237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;You will need to use two channels associated with a TPM module, one channel for each group of LEDs.&amp;nbsp; Each TPM channel has an associated pin used to output the PWM signal in this case.&amp;nbsp; To minimize strobe effects, I would suspect that the PWM frequency would need to be much greater than the frame rate of the film or video, i.e. many on/off cycles&amp;nbsp;during the exposure time for each&amp;nbsp;frame.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;With reference to the TPM section of the datasheet -&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;1)&amp;nbsp; Setup the TPMSC register for the required clock source and pre-scale value.&amp;nbsp; Maybe use edge aligned PWM.&lt;/DIV&gt;&lt;DIV&gt;2)&amp;nbsp; Set TPMMOD register to produce the required PWM frequency (in conjunction with clock source and prescale value).&lt;/DIV&gt;&lt;DIV&gt;3)&amp;nbsp; Setup each of the TPMCnSC registers for PWM mode, and with the polarity that you require.&lt;/DIV&gt;&lt;DIV&gt;4)&amp;nbsp; Set each TPMCnV register for the duty cyle required for each channel.&amp;nbsp; If the value should exceed the TPMMOD setting, this will give a duty cycle of 100 percent.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;You should then be able to observe the PWM waveform at each output pin.&amp;nbsp; Of course you will need additional hardware in order to drive the multiple LEDs on each channel.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards,&lt;/DIV&gt;&lt;DIV&gt;Mac&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2008 00:28:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/PWM-HCS08-starter-kit-prototype-LED-light/m-p/196026#M7237</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2008-10-23T00:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: PWM HCS08 starter kit, prototype LED light.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/PWM-HCS08-starter-kit-prototype-LED-light/m-p/196027#M7238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I am not looking to drive any LED's just yet. I just need to get some form of PWM generated and displayed on an oscilloscope. Im not sure how to do this, do I just drive a couple of pins as outputs and connect them to the oscilloscope. I will also need to later on be able to adjust the duty cycle so I can control the intensity of the light. I will have my first draft of code posted up later on. It probably wont be much more than some register configurations. How would I set an LED on the board to be a test output? Do I just set the required PTAD and It will drive itself? Probably not, so if someone could give us a clue I would be very grateful&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2008 23:12:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/PWM-HCS08-starter-kit-prototype-LED-light/m-p/196027#M7238</guid>
      <dc:creator>karmabobby</dc:creator>
      <dc:date>2008-11-03T23:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: PWM HCS08 starter kit, prototype LED light.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/PWM-HCS08-starter-kit-prototype-LED-light/m-p/196028#M7239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Whenever a TPM channel has PWM mode enabled (TPMCnSC register setting), the pin associated with the particular channel will become an output, and this will over-ride any setting that the pin may have for general purpose use.&amp;nbsp; Each channel uses a&amp;nbsp;designated pin.&amp;nbsp; Refer to the datasheet for the device you are using.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards,&lt;/DIV&gt;&lt;DIV&gt;Mac&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 01:05:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/PWM-HCS08-starter-kit-prototype-LED-light/m-p/196028#M7239</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2008-11-04T01:05:09Z</dc:date>
    </item>
    <item>
      <title>Re: PWM HCS08 starter kit, prototype LED light.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/PWM-HCS08-starter-kit-prototype-LED-light/m-p/196029#M7240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Firstly thank you for your pointers. I have had a look over the data sheet and come up with the following register values.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;TPMSC&amp;nbsp; = 0x0C;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This is set to use edge aligned PWM with the bus clock and a prescale divisor of 64.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;TPMC1SC = 0x74;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;No Interrupts (software polling), with high true pulses.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;TPMMOD = 0x00FA;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;TPMC1V = 0x0032;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The output pin for this channel is PTB5.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;PTBDD = 0x20; to drive PTB5 as an output(may not be needed, not sure)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Ok so with these settings I am hoping to get a PWM signal at 500Hz which is true for 10%(50Hz) of the signal. This will be just to get a basic PWM sub routine going in the lab to show PWM generation on an oscilloscope. If theres any problems with the above settings then let me know.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The board I am using is the MC9S08QG4 demo board.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Nov 2008 03:54:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/PWM-HCS08-starter-kit-prototype-LED-light/m-p/196029#M7240</guid>
      <dc:creator>karmabobby</dc:creator>
      <dc:date>2008-11-06T03:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: PWM HCS08 starter kit, prototype LED light.</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/PWM-HCS08-starter-kit-prototype-LED-light/m-p/196030#M7241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;karmabobby wrote:&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;TPMSC&amp;nbsp; = 0x0C;&lt;/DIV&gt;&lt;DIV&gt;This is set to use edge aligned PWM with the bus clock and a prescale divisor of 64.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;TPMC1SC = 0x74;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;No Interrupts (software polling), with high true pulses.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;TPMMOD = 0x00FA;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;TPMC1V = 0x0032;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The output pin for this channel is PTB5.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;PTBDD = 0x20; to drive PTB5 as an output(may not be needed, not sure)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Ok so with these settings I am hoping to get a PWM signal at 500Hz which is true for 10%(50Hz) of the signal. This will be just to get a basic PWM sub routine going in the lab to show PWM generation on an oscilloscope. If theres any problems with the above settings then let me know.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The board I am using is the MC9S08QG4 demo board.&lt;/DIV&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;For PWM mode with high true pulses, and no interrupt, I might have expected the TPM1SC value to be 0x28.&amp;nbsp; Also, when PWM mode is selected, the PTB5 pin will become an output independent of the PTBDD setting.&lt;BR /&gt;&lt;BR /&gt;The settings for TPMC1V and TPMMOD will produce a duty cycle of approximately 20 percent, rather than 10 percent.&amp;nbsp; An alternative would be to use a prescale setting of 1, and increase the values within both registers by a factor of 16.&amp;nbsp; This would provide improved resolution for the same PWM frequency.&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="Courier New"&gt;TPMSC = 0x08;&lt;BR /&gt;TPMMOD = 3999;&lt;BR /&gt;TPMC1V = 800;&amp;nbsp; // 20% duty&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Mac&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2008 00:14:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/PWM-HCS08-starter-kit-prototype-LED-light/m-p/196030#M7241</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2008-11-12T00:14:34Z</dc:date>
    </item>
  </channel>
</rss>

