<?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>8-bit MicrocontrollersのトピックCode for IR remote control emulator</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Code-for-IR-remote-control-emulator/m-p/193198#M14970</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;I am trying to emulate a remote control using a S08PT60, connected to a switching transistor and an IR LED. However, my algorithm is not working. I have sliced the code into 500us slices, because all "on" and "off" times are multiples of 500us. Then I have a boolean vector which indicates whether the LED should be oscillating or not during that 500us period. The microcontroller enters a periodic interrupt every 500us to enable or disable the PWM oscillator, which controls the transistor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using an IR receiver, I have confirmed that the oscillator is being switched on and off. However, all timing seems to be wrong. Times are bigger than they should be.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anybody have a hint on how I can switch the PWM oscillator with correct timing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Aug 2012 21:06:42 GMT</pubDate>
    <dc:creator>quevedo</dc:creator>
    <dc:date>2012-08-30T21:06:42Z</dc:date>
    <item>
      <title>Code for IR remote control emulator</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Code-for-IR-remote-control-emulator/m-p/193198#M14970</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;I am trying to emulate a remote control using a S08PT60, connected to a switching transistor and an IR LED. However, my algorithm is not working. I have sliced the code into 500us slices, because all "on" and "off" times are multiples of 500us. Then I have a boolean vector which indicates whether the LED should be oscillating or not during that 500us period. The microcontroller enters a periodic interrupt every 500us to enable or disable the PWM oscillator, which controls the transistor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using an IR receiver, I have confirmed that the oscillator is being switched on and off. However, all timing seems to be wrong. Times are bigger than they should be.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anybody have a hint on how I can switch the PWM oscillator with correct timing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2012 21:06:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Code-for-IR-remote-control-emulator/m-p/193198#M14970</guid>
      <dc:creator>quevedo</dc:creator>
      <dc:date>2012-08-30T21:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Code for IR remote control emulator</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Code-for-IR-remote-control-emulator/m-p/193199#M14971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class="lia-message-body-content"&gt;Hello,&lt;/P&gt;&lt;P class="lia-message-body-content"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-message-body-content"&gt;Without seeing the actual code, I can only guess at the cause of the problem.&lt;/P&gt;&lt;P class="lia-message-body-content"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-message-body-content"&gt;I assume that you are attempting to generate the 38 kHz, or thereabouts, carrier waveform using the channel output of a FTM module operating with edge-aligned PWM mode?&amp;nbsp; You have not disclosed the method you are using to enable or disable this waveform in accordance with the modulation state.&amp;nbsp; The possibilities would seem to be to enable and disable the FTM channel, to alternate between 0 percent and 50 percent duty, or possibly to make use of the new output mask feature.&amp;nbsp; The coherency delays may differ&amp;nbsp;for each method.&lt;/P&gt;&lt;P class="lia-message-body-content"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-message-body-content"&gt;Using any of these software methods will produce timing errors due to interrupt latency for the timer associated with the modulation waveform.&amp;nbsp; The latency period will be unpredictable should any other ISR be executing when the timer interrupt becomes pending,&amp;nbsp;which may be further extended should another higher priority interrupt also become pending prior to completion of the ISR code.&amp;nbsp; Within the timer ISR, your coding will need to ensure that the latency cycles remain constant, and are the same for both turn on and turn off processes.&lt;/P&gt;&lt;P class="lia-message-body-content"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-message-body-content"&gt;You have not said which timer module you are using to generate the modulation timing.&amp;nbsp; I might suggest using a channel from another FTM module (free-running mode), and using output compare interrupts.&amp;nbsp; Since you would already know the amount of time required to the next change of state, the channel register is easily updated for the next compare event.&amp;nbsp; This will reduce the number of interrupts, and may increase flexibility, over interrupting at 500us fixed intervals.&lt;/P&gt;&lt;P class="lia-message-body-content"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-message-body-content"&gt;The timing errors due to the ISR latency could be eliminated if you were to separately generate the modulation waveform at the output pin&amp;nbsp;of the&amp;nbsp;timer channel,&amp;nbsp;in addition to&amp;nbsp;providing a constant PWM output.&amp;nbsp; However, additional external gating circuitry would be required to combine the PWM and modulation signals.&amp;nbsp; The additional circuitry might consist of as little as a MOSFET transistor, or a bipolar transistor and one or two resistors.&amp;nbsp; The configuration will depend on your existing arrangement to drive the IRED, and the peak current through the device.&lt;/P&gt;&lt;P class="lia-message-body-content"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Sep 2012 14:53:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Code-for-IR-remote-control-emulator/m-p/193199#M14971</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2012-09-02T14:53:53Z</dc:date>
    </item>
  </channel>
</rss>

