<?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>LPC MicrocontrollersのトピックRe: LPC54608 WWDT Timeout Value</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-WWDT-Timeout-Value/m-p/812804#M32608</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kerry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the response. I have been trying to measure the frequency. Here is the code I used.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; INPUTMUX_Type *input_mux = INPUTMUX;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;input_mux-&amp;gt;FREQMEAS_REF&lt;/STRONG&gt; = INPUTMUX_FREQMEAS_REF_CLKIN(2);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // reference = fro_hf&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;input_mux-&amp;gt;FREQMEAS_TARGET&lt;/STRONG&gt; = INPUTMUX_FREQMEAS_TARGET_CLKIN(3); // target = wdt_clk&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // start measuring&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SYSCON_Type *syscon = SYSCON;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; syscon-&amp;gt;FREQMECTRL = SYSCON_FREQMECTRL_PROG(1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while ((syscon-&amp;gt;FREQMECTRL &amp;amp; SYSCON_FREQMECTRL_PROG_MASK) == SYSCON_FREQMECTRL_PROG_MASK);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t capval = SYSCON_FREQMECTRL_CAPVAL(syscon-&amp;gt;FREQMECTRL);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Ftarget = (CAPVAL - 2) x Fref /2^14&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t target_freq = ((capval - 2) * SystemCoreClock) &amp;gt;&amp;gt; 14;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("capval=%d,target freq=%d\r\n", capval, target_freq);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After setting input_mux-&amp;gt;FREQMEAS_REF and input_mux-&amp;gt;FREQMEAS_TARGET, these registers still show a value of 0xF. Do I need to initialize anything else to use the frequency measure function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Aug 2018 22:44:19 GMT</pubDate>
    <dc:creator>rex_lam</dc:creator>
    <dc:date>2018-08-23T22:44:19Z</dc:date>
    <item>
      <title>LPC54608 WWDT Timeout Value</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-WWDT-Timeout-Value/m-p/812802#M32606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have been using the OM13092 board to test the LPC54608 WWDT feature. Here is an excerpt from the WWDT example program:&lt;/P&gt;&lt;P&gt;#define WDT_CLK_FREQ CLOCK_GetFreq(kCLOCK_WdtOsc)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#if !defined (FSL_FEATURE_WWDT_HAS_NO_PDCFG) || (!FSL_FEATURE_WWDT_HAS_NO_PDCFG)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; POWER_DisablePD(kPDRUNCFG_PD_WDT_OSC);&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* The WDT divides the input frequency into it by 4 */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; wdtFreq = WDT_CLK_FREQ / 4;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NVIC_EnableIRQ(APP_WDT_IRQn);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WWDT_GetDefaultConfig(&amp;amp;config);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Set watchdog feed time constant to approximately 2s&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Set watchdog warning time to 512 ticks after feed time constant&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Set watchdog window time to 1s&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; config.timeoutValue = wdtFreq * 2;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //config.warningValue = 512;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //config.windowValue = wdtFreq * 1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Configure WWDT to reset on timeout */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //config.enableWatchdogReset = true;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; WWDT_Init(WWDT, &amp;amp;config);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to the comments, wdtFreq*2 should be approximately 2s. In my tests, it came out to about 1.56s, which is much less than 2. The return value of CLOCK_GetFreq(kCLOCK_WdtOsc) is 500000, and thus wdtFreq is 125000. The value of SystemCoreClock is 48000000. I used the SysTick timer to measure the watchdog time:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SysTick_Config(CLOCK_GetFreq(kCLOCK_BusClk)/1000);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From WDTOSCCTRL, DIVSEL=0 (divide by 2), and FREQSEL=5 (1.0MHz). This explains why WDT_CLK_FREQ = 500000 but it doesn't explain why the actual timeout is off by a factor of 1.28. I changed wdtFreq to 160000 (125000x1.28), and then the expected timeout is correct, i.e. the watchdog times out accurately for 1s, 2s, 5s, etc. with wdtFreq=160000. Can anyone explain why that is so?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2018 16:31:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-WWDT-Timeout-Value/m-p/812802#M32606</guid>
      <dc:creator>rex_lam</dc:creator>
      <dc:date>2018-08-21T16:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54608 WWDT Timeout Value</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-WWDT-Timeout-Value/m-p/812803#M32607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rex Lam,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Please check the user manual description:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/68908i34A474F65FD1DED5/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So, actually, the watchdog clock have the accuracy, it is +/-40%, this is very larger, as you know, even you get 1.56s, the accuracy is about 22%, it still meet the watchdog demand.&lt;/P&gt;&lt;P&gt;If you don't believe it, you can use the clock out to check the watchdog clk, this clock should already have the accuracy problem, this is the root problem caused the 1.56S time out problem.&lt;/P&gt;&lt;P&gt;Actually, it is not the issue, it is just the chip feature.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kerry&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Aug 2018 08:57:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-WWDT-Timeout-Value/m-p/812803#M32607</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2018-08-22T08:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: LPC54608 WWDT Timeout Value</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-WWDT-Timeout-Value/m-p/812804#M32608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kerry,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the response. I have been trying to measure the frequency. Here is the code I used.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; INPUTMUX_Type *input_mux = INPUTMUX;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;input_mux-&amp;gt;FREQMEAS_REF&lt;/STRONG&gt; = INPUTMUX_FREQMEAS_REF_CLKIN(2);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // reference = fro_hf&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;input_mux-&amp;gt;FREQMEAS_TARGET&lt;/STRONG&gt; = INPUTMUX_FREQMEAS_TARGET_CLKIN(3); // target = wdt_clk&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // start measuring&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SYSCON_Type *syscon = SYSCON;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; syscon-&amp;gt;FREQMECTRL = SYSCON_FREQMECTRL_PROG(1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while ((syscon-&amp;gt;FREQMECTRL &amp;amp; SYSCON_FREQMECTRL_PROG_MASK) == SYSCON_FREQMECTRL_PROG_MASK);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t capval = SYSCON_FREQMECTRL_CAPVAL(syscon-&amp;gt;FREQMECTRL);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Ftarget = (CAPVAL - 2) x Fref /2^14&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint32_t target_freq = ((capval - 2) * SystemCoreClock) &amp;gt;&amp;gt; 14;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PRINTF("capval=%d,target freq=%d\r\n", capval, target_freq);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After setting input_mux-&amp;gt;FREQMEAS_REF and input_mux-&amp;gt;FREQMEAS_TARGET, these registers still show a value of 0xF. Do I need to initialize anything else to use the frequency measure function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2018 22:44:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC54608-WWDT-Timeout-Value/m-p/812804#M32608</guid>
      <dc:creator>rex_lam</dc:creator>
      <dc:date>2018-08-23T22:44:19Z</dc:date>
    </item>
  </channel>
</rss>

