<?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中的主题 RTC vs. TPM</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/RTC-vs-TPM/m-p/320687#M20939</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, what i try to accomplish is to read one particular ADC channel let's say every second or two. I'm using the 9S08QE32 uC and it has a few options for timing,I can either use the RTC or TPM. What are the pros and cons of using one over the other ? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Jul 2014 22:22:33 GMT</pubDate>
    <dc:creator>Designer11</dc:creator>
    <dc:date>2014-07-15T22:22:33Z</dc:date>
    <item>
      <title>RTC vs. TPM</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/RTC-vs-TPM/m-p/320687#M20939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, what i try to accomplish is to read one particular ADC channel let's say every second or two. I'm using the 9S08QE32 uC and it has a few options for timing,I can either use the RTC or TPM. What are the pros and cons of using one over the other ? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jul 2014 22:22:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/RTC-vs-TPM/m-p/320687#M20939</guid>
      <dc:creator>Designer11</dc:creator>
      <dc:date>2014-07-15T22:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: RTC vs. TPM</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/RTC-vs-TPM/m-p/320688#M20940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Designer11,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;Basically, RTC and TPM use different clock source. TPM is more powerful and multifunctional.&amp;nbsp; TPM is more accurate. For detail, see:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif'; background: yellow;"&gt;Features of the RTC module include:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;• 8-bit up-counter&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;— 8-bit modulo match limit&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;— Software controllable periodic interrupt on match&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;• Three software selectable clock sources for input to prescaler with selectable binary-based and&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;decimal-based divider values&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;— 1-kHz internal low-power oscillator (LPO)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;— External clock (ERCLK)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;— 32-kHz internal clock (IRCLK)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif'; background: yellow;"&gt;The TPM includes these distinctive features:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;• One to eight channels:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;— Each channel is input capture, output compare, or edge-aligned PWM&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;— Rising-edge, falling-edge, or any-edge input capture trigger&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;— Set, clear, or toggle output compare action&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;— Selectable polarity on PWM outputs&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;• Module is configured for buffered, center-aligned pulse-width-modulation (CPWM) on all&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;channels&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;• Timer clock source selectable as bus clock, fixed frequency clock, or an external clock&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;— Prescale taps for divide-by 1, 2, 4, 8, 16, 32, 64, or 128 used for any clock input selection&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;— Fixed frequency clock is an additional clock input to allow the selection of an on chip clock&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;source other than bus clock&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;— Selecting external clock connects TPM clock to a chip level input pin therefore allowing to&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;synchronize the TPM counter with an off chip clock source&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;• 16-bit free-running or modulus count with up/down selection&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;• One interrupt per channel and one interrupt for TPM counter overflow&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;----------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;this answer is for you. if it helps, please click on "correct answer" button. thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;Zhang Jun&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'TimesNewRomanPSMT','serif';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 02:54:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/RTC-vs-TPM/m-p/320688#M20940</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2014-07-16T02:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: RTC vs. TPM</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/RTC-vs-TPM/m-p/320689#M20941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Hello Designer11, it sounds like you are not very worried about accuracy ... you need a sample every one or two seconds. &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;9S08QE32&lt;/SPAN&gt; has ***lots*** of timing sources. A simple one: take any free TPM module and take the bus clock as clock source for the counter. If your CPU bus clock is for example 10.000 MHz, set the the MODULO of the TPM to 10000. This will produce an overflow of the counter every 1 ms. Enable the Timer Overflow interface to trap this event every 1 ms. Now, write an interrupt function or routine related to the Timer Overflow event of this TPM, don't forget to clear the TOF flag on every interrupt first thing to do before your interrupt handler code. Then, use an int or 16 bit variable to decrement from 10000 to zero, and reload this cell when this happens every one second. You must initialize this variable with 10000 before enabling interrupts. Once you have this one second event ready, write the code to access the ADC result and store it in a variable. Now trigger an ADC convertion that you will read on the next second with this same procedure.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define ONESECOND 10000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;unsigned int adresult;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* here every 1 ms timer overflow event */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void&lt;/P&gt;&lt;P&gt;timer_tick(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static unsigned int div = ONESECOND;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( --div == 0 )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; div = ONESECOND;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; adresult = get_ad_result();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Good luck !&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Roberto&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Jul 2014 02:24:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/RTC-vs-TPM/m-p/320689#M20941</guid>
      <dc:creator>BooleanBob</dc:creator>
      <dc:date>2014-07-26T02:24:53Z</dc:date>
    </item>
  </channel>
</rss>

