<?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: problems with rtc interrupt in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/problems-with-rtc-interrupt/m-p/158976#M9407</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;added following entry in prm file:&lt;/P&gt;&lt;PRE&gt;RTC_ISR  =  READ_WRITE    0xFFC4 TO 0xFFC5;&lt;/PRE&gt;&lt;PRE&gt;void interrupt 29 RTC_ISR(void){ RTCSC = RTCSC | 0x80; Tick = TRUE;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Faileed writing target adressffc4.&lt;/P&gt;&lt;P&gt;Expected value: 0x1a7d4f00&lt;/P&gt;&lt;P&gt;&amp;nbsp;Actual value: 0xfff2900&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am i doing wrong?&amp;nbsp;&lt;IMG alt=":smileyindifferent:" class="emoticon emoticon-smileyindifferent" id="smileyindifferent" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-indifferent.gif" title="Smiley Indifferent" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2020 09:04:17 GMT</pubDate>
    <dc:creator>milchshake</dc:creator>
    <dc:date>2020-10-29T09:04:17Z</dc:date>
    <item>
      <title>problems with rtc interrupt</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/problems-with-rtc-interrupt/m-p/158974#M9405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello, have problems with my rtc interrupt. i want to test the code in debug mode , but the interrupt service routine is never called..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;controller:&amp;nbsp;mc9s08JM60&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please can anyone view my code and say if there is something wrong&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#include &amp;lt;hidef.h&amp;gt; /* for EnableInterrupts macro */#include "derivative.h" /* include peripheral declarations */#include "MCUinit.h"#ifdef __cplusplusextern "C"#endifvoid MCU_init(void); /* Device initialization function declaration */Bool Tick = FALSE;void main(void) {&amp;nbsp; MCU_init(); /* call Device Initialization */&amp;nbsp; EnableInterrupts;&amp;nbsp;&amp;nbsp;&amp;nbsp; RTCMOD= 0x00;&amp;nbsp; RTCSC = 0x1F | 0x80;&amp;nbsp; for(;;){&amp;nbsp;&amp;nbsp; if (Tick == TRUE)&amp;nbsp;&amp;nbsp; {&amp;nbsp; RTCMOD = 0x00;//Re-setting the counter value&amp;nbsp; RTCSC = 0x1F; //Re-enabling the interrupt re-configuring the clock source&amp;nbsp; Tick = FALSE;&amp;nbsp;&amp;nbsp; }&amp;nbsp; }}__interrupt void RTC_ISR(void){ RTCSC = RTCSC | 0x80; Tick = TRUE;}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:04:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/problems-with-rtc-interrupt/m-p/158974#M9405</guid>
      <dc:creator>milchshake</dc:creator>
      <dc:date>2020-10-29T09:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: problems with rtc interrupt</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/problems-with-rtc-interrupt/m-p/158975#M9406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, and welcome to the forum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is probable that the interrupt vector has not been programmed.&amp;nbsp; There are a number of ways to handle this, including an explicit vector table, or as an entry within the PRM file.&amp;nbsp; If neither of these exist in your program, as I suspect, you might use the following method:&lt;/P&gt;&lt;PRE&gt;__interrupt VectorNumber_Vrtc void RTC_ISR(void){   RTCSC = RTCSC | 0x80;   Tick = TRUE;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:04:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/problems-with-rtc-interrupt/m-p/158975#M9406</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2020-10-29T09:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: problems with rtc interrupt</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/problems-with-rtc-interrupt/m-p/158976#M9407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;added following entry in prm file:&lt;/P&gt;&lt;PRE&gt;RTC_ISR  =  READ_WRITE    0xFFC4 TO 0xFFC5;&lt;/PRE&gt;&lt;PRE&gt;void interrupt 29 RTC_ISR(void){ RTCSC = RTCSC | 0x80; Tick = TRUE;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Faileed writing target adressffc4.&lt;/P&gt;&lt;P&gt;Expected value: 0x1a7d4f00&lt;/P&gt;&lt;P&gt;&amp;nbsp;Actual value: 0xfff2900&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am i doing wrong?&amp;nbsp;&lt;IMG alt=":smileyindifferent:" class="emoticon emoticon-smileyindifferent" id="smileyindifferent" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-indifferent.gif" title="Smiley Indifferent" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:04:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/problems-with-rtc-interrupt/m-p/158976#M9407</guid>
      <dc:creator>milchshake</dc:creator>
      <dc:date>2020-10-29T09:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: problems with rtc interrupt</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/problems-with-rtc-interrupt/m-p/158977#M9408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can it be that interrupts are disabled in debug mode?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ok found in debugger configuration the option &amp;nbsp;disable interrupt during stepping. it was checked but still don´t work&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2012 17:58:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/problems-with-rtc-interrupt/m-p/158977#M9408</guid>
      <dc:creator>milchshake</dc:creator>
      <dc:date>2012-05-01T17:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: problems with rtc interrupt</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/problems-with-rtc-interrupt/m-p/158978#M9409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it seems that the rtc is not working.. the counter always stays at 0&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2012 00:18:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/problems-with-rtc-interrupt/m-p/158978#M9409</guid>
      <dc:creator>milchshake</dc:creator>
      <dc:date>2012-05-02T00:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: problems with rtc interrupt</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/problems-with-rtc-interrupt/m-p/158979#M9410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;haha forgot to add the rtc in the "Component Development Environment". it works now thanks for help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2012 01:51:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/problems-with-rtc-interrupt/m-p/158979#M9410</guid>
      <dc:creator>milchshake</dc:creator>
      <dc:date>2012-05-02T01:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: problems with rtc interrupt</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/problems-with-rtc-interrupt/m-p/158980#M9411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your addition to the PRM file is wrong on several counts, and is totally unnecessary.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By specifying the vector number 29, the linker already knows the actual address of the RTI interrupt &lt;U&gt;vector&lt;/U&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With a modulo value of zero, of course the counter register will remain at zero.&amp;nbsp; Only the prescaler counts in this instance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since you are not stopping the RTC module, but require a periodic interrupt at very approximate one second intervals, it is unnecessary to write to the RTC registers within the main loop, once they have been initialised.&amp;nbsp; The following code should suffice.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; if (Tick == TRUE)&lt;/FONT&gt; &lt;FONT face="courier new,courier"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Tick = FALSE;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Do other tasks here&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; }&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Mac&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2012 01:53:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/problems-with-rtc-interrupt/m-p/158980#M9411</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2012-05-02T01:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: problems with rtc interrupt</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/problems-with-rtc-interrupt/m-p/158981#M9412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;yes that with the prm file i know that it was totally wrong &lt;IMG alt=":smileyvery-happy:" class="emoticon emoticon-smileyvery-happy" id="smileyvery-happy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-very-happy.gif" title="Smiley Very Happy" /&gt; thanks for your additional information!&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2012 02:17:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/problems-with-rtc-interrupt/m-p/158981#M9412</guid>
      <dc:creator>milchshake</dc:creator>
      <dc:date>2012-05-02T02:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: problems with rtc interrupt</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/problems-with-rtc-interrupt/m-p/158982#M9413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Tick variable must be declared as volatile to protect against dangerous optimization assumptions by the compiler. Some Codewarriors are known to make such optimizations. (I don't remember which MCU and version.)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 May 2012 18:40:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/problems-with-rtc-interrupt/m-p/158982#M9413</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2012-05-03T18:40:56Z</dc:date>
    </item>
  </channel>
</rss>

