<?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中的主题 Re: HC08 Using PWM and RTIshared</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HC08-Using-PWM-and-RTIshared/m-p/141868#M6065</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;What you require to do would certainly seem feasible, but the PE beans provided might not be suitable - I do not use them personally.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;To keep the code uncomplicated, I would assume use of unbuffered PWM. &amp;nbsp;You will need to set up the TIM module&amp;nbsp;so that overflow occurs every 10 ms, or perhaps a sub-multiple of this period for a higher PWM frequency.&amp;nbsp; The PWM period will be the same as the timer overflow period.&amp;nbsp; Set this by adjusting&amp;nbsp;prescale&amp;nbsp;and modulus values, and also taking into account&amp;nbsp;the crystal frequency.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;The PWM channel would normally be set up to "toggle on overflow", and for&amp;nbsp;each output compare event to clear the PWM output.&amp;nbsp; The channel register would contain the current pulse width value.&amp;nbsp; Once set up,&amp;nbsp;unbuffered PWM output will continue without the need for any interrupts - output compare interrupts are required only when the pulse width setting needs to alter, and would be disabled at other times.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;The timer overflow interrupt would need to be remain enabled&amp;nbsp;to time&amp;nbsp;your periodic processing requirements.&amp;nbsp; This ISR should remain as short as possible.&amp;nbsp; If the display and keyboard routines are lengthy, it is better to do these outside of the ISR code - simply set a "flag" within the ISR, and poll the flag from within main().&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Jan 2007 11:24:30 GMT</pubDate>
    <dc:creator>bigmac</dc:creator>
    <dc:date>2007-01-05T11:24:30Z</dc:date>
    <item>
      <title>HC08 Using PWM and RTIshared</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HC08-Using-PWM-and-RTIshared/m-p/141867#M6064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;I am having trouble using the PWM and the RTI shared beans at the same time. I am programming an HC908JL3 with CW5.1.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I am using the PWM with TIM0 to generate a PWM signal to control a small dc motor. This I have working ok. I also need a shared interrupt to generate an interrupt every 10ms to handle some display and Keyboard routines. I have each of these routines working seperatly. When&amp;nbsp;I try to enable the PWM and the RTIshared beans at the same time I get&amp;nbsp;"Error: Peripheral is already being used by the Bean PWM1". I have the&amp;nbsp;'bean uses entire timer' set to no for both beans. I have tried many different variations and have not got it to work.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I have searched the manual on the JL3 and found no reference that you can not use the timer module for the PWM and RTI at the same time.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Does anyone have any ideas? I have been working on this problem for several weeks now and can not figure it out.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks!&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Jan 2007 15:05:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HC08-Using-PWM-and-RTIshared/m-p/141867#M6064</guid>
      <dc:creator>bespenschied</dc:creator>
      <dc:date>2007-01-04T15:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: HC08 Using PWM and RTIshared</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HC08-Using-PWM-and-RTIshared/m-p/141868#M6065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;What you require to do would certainly seem feasible, but the PE beans provided might not be suitable - I do not use them personally.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;To keep the code uncomplicated, I would assume use of unbuffered PWM. &amp;nbsp;You will need to set up the TIM module&amp;nbsp;so that overflow occurs every 10 ms, or perhaps a sub-multiple of this period for a higher PWM frequency.&amp;nbsp; The PWM period will be the same as the timer overflow period.&amp;nbsp; Set this by adjusting&amp;nbsp;prescale&amp;nbsp;and modulus values, and also taking into account&amp;nbsp;the crystal frequency.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;The PWM channel would normally be set up to "toggle on overflow", and for&amp;nbsp;each output compare event to clear the PWM output.&amp;nbsp; The channel register would contain the current pulse width value.&amp;nbsp; Once set up,&amp;nbsp;unbuffered PWM output will continue without the need for any interrupts - output compare interrupts are required only when the pulse width setting needs to alter, and would be disabled at other times.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;The timer overflow interrupt would need to be remain enabled&amp;nbsp;to time&amp;nbsp;your periodic processing requirements.&amp;nbsp; This ISR should remain as short as possible.&amp;nbsp; If the display and keyboard routines are lengthy, it is better to do these outside of the ISR code - simply set a "flag" within the ISR, and poll the flag from within main().&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jan 2007 11:24:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HC08-Using-PWM-and-RTIshared/m-p/141868#M6065</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-01-05T11:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: HC08 Using PWM and RTIshared</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HC08-Using-PWM-and-RTIshared/m-p/141869#M6066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Thanks Mac,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I have pretty much done what you suggested. I use the beans because It takes less time to get routines working unless something like this happens. It appears that I will have to write my own routines instead of using the Beans. Even though the bean is set to share the resources, it appears that they are stingy and don't like to share.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;brian&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jan 2007 15:10:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HC08-Using-PWM-and-RTIshared/m-p/141869#M6066</guid>
      <dc:creator>bespenschied</dc:creator>
      <dc:date>2007-01-05T15:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: HC08 Using PWM and RTIshared</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HC08-Using-PWM-and-RTIshared/m-p/141870#M6067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;You probably use buffered signal generation, please try to switch it to Unbuffered value. After switching the timer module for the PWM (TIM0 in PWM bean) and RTI (TIM1 in RTIshared bean)&amp;nbsp;at the same time should work correctly as you need.&lt;/DIV&gt;&lt;DIV&gt;Best Regards,&lt;/DIV&gt;&lt;DIV&gt;Jan Pospisilik, Processor Expert Support&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jan 2007 20:27:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HC08-Using-PWM-and-RTIshared/m-p/141870#M6067</guid>
      <dc:creator>ProcessorExpert</dc:creator>
      <dc:date>2007-01-05T20:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: HC08 Using PWM and RTIshared</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HC08-Using-PWM-and-RTIshared/m-p/141871#M6068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;I am using unbuffered mode because I never change the PWM values. I have the PWM using TCH0/PTD4 to run the motor circuit. I am using&amp;nbsp;TIM0 for the PWM.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I have the PWM set to 10ms Period and 7ms Pulse Width. With the RTIs disabled I get no errors.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I have the RTIs set to use&amp;nbsp;TIM1, Resolution set to 10ms. When I enable the RTIs I get the error:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Timing setting failed because of another&amp;nbsp;timing settings in High Speed mode.&lt;/DIV&gt;&lt;DIV&gt;No matter what I set the Resolution to I keep getting the same error in the bean. I have tried timing values from 1ms all the way up to 1000ms with no luck.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;When I go back and check the PWM bean It only allows me to select&amp;nbsp;a value for the Period that is a multiple of&amp;nbsp;13.333ms. (13, 26, 53...)&amp;nbsp;Again no matter what value I put into the RTIs resolution field.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Jan 2007 03:17:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HC08-Using-PWM-and-RTIshared/m-p/141871#M6068</guid>
      <dc:creator>bespenschied</dc:creator>
      <dc:date>2007-01-06T03:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: HC08 Using PWM and RTIshared</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/HC08-Using-PWM-and-RTIshared/m-p/141872#M6069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;In my opinion, if period&amp;nbsp;10ms&amp;nbsp;is the same for both devices control, you can use the PWM bean to generate output signal to control a small motor with period 10ms.&amp;nbsp;&lt;BR /&gt;And then use PWM's OnEnd event to generate an interrupt every 10ms to handle some display and keyboard.&lt;/DIV&gt;&lt;DIV&gt;I hope this help you.&lt;/DIV&gt;&lt;DIV&gt;Best Regards,&lt;/DIV&gt;&lt;DIV&gt;Jan Pospisilik, Processor Expert Support&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jan 2007 22:04:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/HC08-Using-PWM-and-RTIshared/m-p/141872#M6069</guid>
      <dc:creator>ProcessorExpert</dc:creator>
      <dc:date>2007-01-09T22:04:51Z</dc:date>
    </item>
  </channel>
</rss>

