<?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>topic Re: Create an PIT Interrupt in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311511#M13435</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your post, however please consider moving it to the right community place (e.g. &lt;A _jive_internal="true" class="jivecontainerTT-hover-container jive-link-community-small" data-containerid="1" data-containertype="14" data-objectid="2019" data-objecttype="14" href="https://community.nxp.com/community/kinetis"&gt; Kinetis Microcontrollers&lt;/A&gt; ) to get it visible for active members.&lt;/P&gt;&lt;P&gt;For details please see general advice &lt;A _jive_internal="true" data-containerid="2001" data-containertype="14" data-objectid="99909" data-objecttype="102" href="https://community.nxp.com/docs/DOC-99909"&gt;Where to post a Discussion?&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for using Freescale Community. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Apr 2014 07:40:35 GMT</pubDate>
    <dc:creator>Wlodek_D_</dc:creator>
    <dc:date>2014-04-07T07:40:35Z</dc:date>
    <item>
      <title>Create an PIT Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311510#M13434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I hope anyone can help me....&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First of all my facts:&lt;/P&gt;&lt;P&gt;I'm using &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;CW V.1.4 (without PEX), to program a MK20DX128 (50MHz)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to know, how to create an Interrupt request for the PIT0 Module?!&lt;/P&gt;&lt;P&gt;I tried it like this:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Add the ISR Vectro table in kinetis.c with the PIT0_isr at position 46!&lt;/P&gt;&lt;P&gt;Add the prototype of PIT0_isr in kinetis.h&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Add the PIT0_init() where I enabled the Timer, the Interrupt function&lt;/P&gt;&lt;P&gt;and all Interrupts with the help of:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#define EnableInterrupts __asm(" CPSIE i");&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well in my opinion it should work... but it doesn't! Where is my fault?&lt;/P&gt;&lt;P&gt;Because there isn't any problem while compilation but although the&lt;/P&gt;&lt;P&gt;PIT Overflow Flag is set, the program doesn't jump into the isr -.-&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot and please excuse my poor pronunciation!&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pascal&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337659"&gt;CLOCK.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Apr 2014 11:46:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311510#M13434</guid>
      <dc:creator>pascalschröer</dc:creator>
      <dc:date>2014-04-06T11:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: Create an PIT Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311511#M13435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your post, however please consider moving it to the right community place (e.g. &lt;A _jive_internal="true" class="jivecontainerTT-hover-container jive-link-community-small" data-containerid="1" data-containertype="14" data-objectid="2019" data-objecttype="14" href="https://community.nxp.com/community/kinetis"&gt; Kinetis Microcontrollers&lt;/A&gt; ) to get it visible for active members.&lt;/P&gt;&lt;P&gt;For details please see general advice &lt;A _jive_internal="true" data-containerid="2001" data-containertype="14" data-objectid="99909" data-objecttype="102" href="https://community.nxp.com/docs/DOC-99909"&gt;Where to post a Discussion?&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for using Freescale Community. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 07:40:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311511#M13435</guid>
      <dc:creator>Wlodek_D_</dc:creator>
      <dc:date>2014-04-07T07:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: Create an PIT Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311512#M13436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You don't seem to be enabling the PIT0 interrupt to the Cortex M4 core.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To enable the PIT0 interrupt in the K20 (50MHz) you need&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IRQ0_31_SER = 0x80000000;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IRQ28_31_PRIORITY = 0xP00000000;&lt;/STRONG&gt; where P is the interrupt priority&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These registers are in the Cortex M4 NVIC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 18:51:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311512#M13436</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2014-04-07T18:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Create an PIT Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311513#M13437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank's a lot :smileyhappy:&amp;nbsp; :smileycheck:&lt;/P&gt;&lt;P&gt;If you have got some time, it would be very nice if you could look at my second question about the Clock generation and the use of PLL... Because my Interrupt works now, but it's just too fast...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 21:03:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311513#M13437</guid>
      <dc:creator>pascalschröer</dc:creator>
      <dc:date>2014-04-07T21:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Create an PIT Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311514#M13438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like your code is setting an 8MHz crystal input to 48MHz core speed (8/2*24).&lt;/P&gt;&lt;P&gt;The bus clock seems to be the same as the core clock (48MHz) so your PIT should be firing every (0x000752FF + 1) bus clocks. That is every 480000/48000000 s - or every 10ms.&lt;/P&gt;&lt;P&gt;What rate is it firing at and what rate were you expecting?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. Supposedly you noticed my mistake in the last post - I set the bits for PIT1 and not PIT0.&lt;/P&gt;&lt;P&gt;PIT0 is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IRQ0_31_SER = 0x40000000;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IRQ28_31_PRIORITY = 0x00P00000;&lt;/STRONG&gt; where P is the interrupt priority&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Apr 2014 22:03:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311514#M13438</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2014-04-07T22:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Create an PIT Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311515#M13439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;P.S. Supposedly you noticed my mistake in the last post - I set the bits for PIT1 and not PIT0.&lt;/P&gt;&lt;P&gt;PIT0 is&lt;/P&gt;&lt;P style="min-height: 8pt; height: 8pt; padding: 0px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IRQ0_31_SER = 0x40000000;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;IRQ28_31_PRIORITY = 0x00P00000;&lt;/STRONG&gt; where P is the interrupt priority&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes I noticed that, but it doesn't matter because with the help of these Registers, I could solve the problem :smileywink:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for answering my other question about the clock peroid...I calculated the same. But that doesen't work when I calculate a time&lt;/P&gt;&lt;P&gt;which I can measure...for example 10s&lt;/P&gt;&lt;P&gt;Well, I tried it like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 / 48MHz = 20.83ns =&amp;gt; 10s * 20.83ns = 480000000 cycles&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it should be like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PIT_LDVAL0 = PIT_LDVAL_TSV(0x1C9C3801);&amp;nbsp; //+1 cycle&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or is there a fault? Because my Interrupt is firing every 5 Seconds -.-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. In my other post about the Clock and the WDOG is the same fault...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Apr 2014 07:24:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311515#M13439</guid>
      <dc:creator>pascalschröer</dc:creator>
      <dc:date>2014-04-08T07:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Create an PIT Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311516#M13440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The PIT value looks good so it must be that your PLL is running at 100MHz and the bus clock too, although I don't read this in your configuration code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To run at 50MHz from an 8MHz crystal the following register settings are required (at the end of the initialisation) - please compare with yours:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MCG_C1 = 0x28&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MCG_C2 = 0x1c&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;MCG_C5 = 0x03&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MCG_C6 = 0x40&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Apr 2014 12:59:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311516#M13440</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2014-04-08T12:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Create an PIT Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311517#M13441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmmm&lt;/P&gt;&lt;P&gt;I have got exactly the same values after initialisation but the interrupt fires every 5 Seconds...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Apr 2014 14:37:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311517#M13441</guid>
      <dc:creator>pascalschröer</dc:creator>
      <dc:date>2014-04-08T14:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: Create an PIT Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311518#M13442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pascal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have the correct crystal attached - is it too fast?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which board are you using - a TWR-K20N50M or FRDM-K20D50M?&lt;/P&gt;&lt;P&gt;If so you can load binary to it that flashes the LED at a defined rate at &lt;A href="http://www.utasker.com/SW_Demos.html" title="http://www.utasker.com/SW_Demos.html"&gt;µTasker Test Software and Demos&lt;/A&gt; - if it works (eg. LED flashes at 5Hz the USB operates) there must be a code problem - else it must be a HW issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Apr 2014 14:50:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311518#M13442</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2014-04-08T14:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: Create an PIT Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311519#M13443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using the FRDM-K20D50M board with an external 8MHz Oszillator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the moment, I toggle PIN A13 and look at my oszilloscope. So I see,&lt;/P&gt;&lt;P&gt;that the PIN A13 toggles every 5 Seconds. I have also measured the output&lt;/P&gt;&lt;P&gt;frequency of the oszillator but there are 8MHz how expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Apr 2014 15:47:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311519#M13443</guid>
      <dc:creator>pascalschröer</dc:creator>
      <dc:date>2014-04-08T15:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Create an PIT Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311520#M13444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pascal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;If you load this to your board you can measure the speed that the LED toggles at - it should be 100ms ON/100ms OFF:&lt;A href="http://www.utasker.com/Demos/Kinetis/uTaskerFlexibleBootLoader_FRDM-K20D50M.zip"&gt;http://www.utasker.com/Demos/Kinetis/uTaskerFlexibleBootLoader_FRDM-K20D50M.zip&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It uses 48MHz PLL and 24 MHz bus clock - with the debugger stop the program running and compare the clock registers with yours to try to find a difference that could explain something. Connecting USB will enumerate as an external hard drive if the clocks are correct (USB requires an accurate 48MHz clock).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Apr 2014 15:56:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311520#M13444</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2014-04-08T15:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Create an PIT Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311521#M13445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pascal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To be sure, I have just configured a project that configures 48MHz PLL and 48MHz bus clock and then toggles an output each time PIT0 fires (set to 10s).&lt;/P&gt;&lt;P&gt;This is attached as SREC so that you can load it to your FRDM-K20D50M board. This time you can also inspect the PIT0 configuration to see whether there are any differences.&lt;/P&gt;&lt;P&gt;PIT0_LDVAL0 is set to 0x1c9c37ff.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The green LED flashes at 2.5Hz all the time and PIT0 controls the red led. Therefore you will see that the green LED blinks for 10s and then the red LED is lit for 10s, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Apr 2014 17:02:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311521#M13445</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2014-04-08T17:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create an PIT Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311522#M13446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, I have found the problem!! MCG_C2 must be 0x2C :smileyhappy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now it works very well :smileywink:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your support!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pascal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Apr 2014 17:33:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311522#M13446</guid>
      <dc:creator>pascalschröer</dc:creator>
      <dc:date>2014-04-08T17:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: Create an PIT Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311523#M13447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pascal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that there needs to be someone from Freescale who can confirm this since I always use the mid-frequency range with the 8MHz crystal and have never has a problem with it.&lt;/P&gt;&lt;P&gt;According to the K20M50 data sheet:&lt;/P&gt;&lt;P&gt;- the low range setting RANGE=00 is used only for a 32kHz crystal (from 30kHz to 40kHz).&lt;/P&gt;&lt;P&gt;- the mid range RANGE=01 is used for a high frequency range selection (from 3MHz to 8MHz)&lt;/P&gt;&lt;P&gt;- the very high frequency range RANGE = 1x is used for crystals from 8MHz to 32MHz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since 8MHz is on the boundary between RANGE 01 and 1x there shouldn't be any difference in the two. In fact the data sheet quotes most values with an 8MHz crystal and RANGE 01 (for start-up time,supply current) so this is certainly a valid setting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can influence the PIT speed (bus clock/core speed) you must have the crystal oscillating at twice the frequecy in one case, although you measured the frequency and said that you measured 8MHz. Could it have been that it was 8MHz when you measured and went to 16MHz (overtone) when you didn't - that would mean that the PIT timeout would be correct when you connect your probe to it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At the moment I am not convinced of the finding since it doesn't match with the data sheet or experience over three years with many Kinetis devices. Perhaps you have a starnge board where the oscillator is really not stable but it would be useful if Freescale could remark on the findings as a potential problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2014 01:37:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311523#M13447</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2014-04-09T01:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: Create an PIT Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311524#M13448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First of all thank you to spend so much time in my problem!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't now what to think about it... I have measured 8MHz all the time with the help of a professional Tectronix oszilloscope,&lt;/P&gt;&lt;P&gt;the schematics say's that there is a 8MHz oscillator and the value on top of the oscillator say's it too...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second point is, I have created a new project by using PEX and I saw that the PEX set the MCG_C2 register to0x2C like me!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I really don't know what to do -.- do you know anyone from freescale who can help me?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pascal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2014 05:34:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311524#M13448</guid>
      <dc:creator>pascalschröer</dc:creator>
      <dc:date>2014-04-09T05:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: Create an PIT Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311525#M13449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pascal&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There may be two issues here:&lt;/P&gt;&lt;P&gt;In MCG_C2 there are two settings that are important; the oscillator frequency range and the oscillator gain.&lt;/P&gt;&lt;P&gt;On a FRDM-K20D50M setting the RANGE to medium or high should be "equivalent" and I have confirmed this on my hardware&lt;/P&gt;&lt;P&gt;When I originally posted the value of MCG_C2 I didn't know whether you were using a FRDM or TWR board. The value 0x1c is what I use on a tower board. On the Freedom board I use 0x14 (or 0x24 since they are equivalent).&lt;/P&gt;&lt;P&gt;What I can't use on my FRDM board is neither 0x1c nor 0x2c since the oscillator will not start oscillating if I set the high gain mode. On your board it is oscillating but this could be critical.&lt;/P&gt;&lt;P&gt;Whether you need high gain mode or low gain oscillator mode depends on the hardware - if there is a feedback resistor and loading capacitors the high gain mode is necessary to start the oscillator.&lt;/P&gt;&lt;P&gt;If the crystal has no loading the high gain mode will often fail to start the oscillator and the low gain mode is required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that the FRDM boards are not always mounted with the same components and so you need to check the board in question.&lt;/P&gt;&lt;P&gt;If you search the forum you will find a number of posts concerning this "problem" - for example &lt;A href="https://community.nxp.com/message/312303"&gt;Re: Using external reference&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have found that setting the "incorrect" gain setting for a certain HW may work, may never work, or may work when the crystal is touched with a probe. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore I don't think that the issue involves the range setting but more the gain setting. I would recommend you try combinations of the gain setting and the two range settings. You should find that a certain gain setting is then stable for both range settings and then that is the one best suited to your HW.&lt;/P&gt;&lt;P&gt;As mentioned above I can't use high gain on my board - in fact I have all freedom boards and most of them won't start with the high gain setting (since they don't have crystal loading capacitors) so I certainly recomment the low gain setting as first one to try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2014 13:05:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311525#M13449</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2014-04-09T13:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Create an PIT Interrupt</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311526#M13450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I tried it! You are right, it depends on the gain register-value. If I use the low power operation of the oscillator&lt;/P&gt;&lt;P&gt;I can take the high frequency range and it works like it should! So I would say that the best kind of initialisation is&lt;/P&gt;&lt;P&gt;MCG_C2 = 0x14, for my device :smileyhappy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pascal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2014 15:30:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Create-an-PIT-Interrupt/m-p/311526#M13450</guid>
      <dc:creator>pascalschröer</dc:creator>
      <dc:date>2014-04-09T15:30:47Z</dc:date>
    </item>
  </channel>
</rss>

