<?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中的主题 LPC1769 confusing timer settings (clockrate, matchregister)</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-confusing-timer-settings-clockrate-matchregister/m-p/520327#M3582</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by suckiden on Mon Dec 01 04:52:40 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi everybody,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;currently I am playing with the timer of the lpc. I want to generate an interrupt every 2us. As a starting point I used the periph_timer example.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It already has the following line of code in it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;timerFreq = Chip_Clock_GetSystemClockRate();&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;it returns 96 000 000 so I know my processor and timer are both running at 96MHz&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Than I tried a bit of math: 1/96 000 000 = 10,416...ns&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(desired value) 2000ns / 10,416.. ns = ~192 so I set the Prescaler to this value and Match value to 1 so every 2us an interrupt should occur.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I measured the output of the board LED0 and got a value of 16us not really what I expected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I played a bit with the Prescale values an figured out that with 24 I get the right result. Could it be that the real timer clock is 12MHz (96MHz/8) ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When yes, where can I find this settings?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;best regards Suckiden&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 17:43:59 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T17:43:59Z</dc:date>
    <item>
      <title>LPC1769 confusing timer settings (clockrate, matchregister)</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-confusing-timer-settings-clockrate-matchregister/m-p/520327#M3582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by suckiden on Mon Dec 01 04:52:40 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi everybody,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;currently I am playing with the timer of the lpc. I want to generate an interrupt every 2us. As a starting point I used the periph_timer example.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It already has the following line of code in it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;timerFreq = Chip_Clock_GetSystemClockRate();&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;it returns 96 000 000 so I know my processor and timer are both running at 96MHz&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Than I tried a bit of math: 1/96 000 000 = 10,416...ns&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(desired value) 2000ns / 10,416.. ns = ~192 so I set the Prescaler to this value and Match value to 1 so every 2us an interrupt should occur.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I measured the output of the board LED0 and got a value of 16us not really what I expected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I played a bit with the Prescale values an figured out that with 24 I get the right result. Could it be that the real timer clock is 12MHz (96MHz/8) ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When yes, where can I find this settings?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;best regards Suckiden&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:43:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1769-confusing-timer-settings-clockrate-matchregister/m-p/520327#M3582</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:43:59Z</dc:date>
    </item>
  </channel>
</rss>

