<?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>ColdFire/68K Microcontrollers and ProcessorsのトピックRe: RTC problem with MCF52234 (Clock doesn't start to run)</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/RTC-problem-with-MCF52234-Clock-doesn-t-start-to-run/m-p/159334#M4921</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hi&lt;BR /&gt;&lt;BR /&gt;Don't forget that the day counter counts from 0..64k so it is necessary to add Gregorian date conversion when setting the data, and the opposite when displaying it. You don't seem to be using the data counter at the moment and you will have only time of day.&lt;BR /&gt;&lt;BR /&gt;I think that you can simply set the time by doing the following:&lt;BR /&gt;&lt;PRE&gt;MCF_RTC_HOURMIN_HOURS   = hour;     // alternatively (hour &amp;amp; 0x1f)
MCF_RTC_HOURMIN_MINUTES = minutes;  // alternatively (minutes &amp;amp; 0x3f)
MCF_RTC_SECONDS_SECONDS = sec;      // alternatively (minutes &amp;amp; 0x3f)&lt;/PRE&gt;I didn't check the defines used above but basically there are 2 x 32 registers:&lt;BR /&gt;- SECONDS containing just seconds&lt;BR /&gt;- HOURMIN containing hours and minutes&lt;BR /&gt;I suspect that you have defines like RTC_HOURMIN_HOURS and RTC_HOURMIN_MINUTES allowing byte accesses to the corresponding parts of the HOURMIN register.&lt;BR /&gt;Alternatively you can probably do a single access to the complete register&lt;BR /&gt;&lt;PRE&gt;MCF_RTC_HOURMIN = ((hour &amp;lt;&amp;lt; 8) | minutes);&lt;/PRE&gt;It seems that some of the code which you show is syntactically incorrect but also probably not relevant for what you want to do.&lt;BR /&gt;&lt;BR /&gt;&lt;I&gt;app_hw_m5223x.h&lt;/I&gt; is a hardware configuration file from the uTasker project (which you are not using). We are presently adding RTC support for the M5221X which has an external 32k crystal and battery back-up support, making the RTC much more&amp;nbsp; attractive - here we also use Gregorian date conversions so that the calendar date is managed correctly. Our experience has shown that most M5223X projects with RTC requirements are solved by using an external RTC (eg. via I2C) with battery backup but this will certainly change with the battery backup support in newer devices.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Mark&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.uTasker.com" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;www.uTasker.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;






&lt;/PRE&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2020 09:04:44 GMT</pubDate>
    <dc:creator>mjbcswitzerland</dc:creator>
    <dc:date>2020-10-29T09:04:44Z</dc:date>
    <item>
      <title>RTC problem with MCF52234 (Clock doesn't start to run)</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/RTC-problem-with-MCF52234-Clock-doesn-t-start-to-run/m-p/159331#M4918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am having trouble by initializing the RTC on the MCF52234.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There is an external oscillator (25 MHz) and now I want to access the registers onto the processor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I added a screenshot from my Codewarrior window.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My problem is that I don't know where to place the code. In the Main-file?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Or in a function? Do I need a loop.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The market code did I find on the net.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The TCP/IP-Stack is working fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There are only a few information according to the RTC on the net.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Perhaps you can give me a hint or name a website.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BlackIP&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by BlackIP on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2008-05-27&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;02:20 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 May 2008 20:17:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/RTC-problem-with-MCF52234-Clock-doesn-t-start-to-run/m-p/159331#M4918</guid>
      <dc:creator>BlackIP</dc:creator>
      <dc:date>2008-05-27T20:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: RTC problem with MCF52234 (Clock doesn't start to run)</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/RTC-problem-with-MCF52234-Clock-doesn-t-start-to-run/m-p/159332#M4919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi BlackIP&lt;BR /&gt;&lt;BR /&gt;The only thing needed when the program starts is to set the correct 1Hz value:&lt;BR /&gt;MCF_CLOCK_RTCDR = (OSCCLK-1);&lt;BR /&gt;The RTC will run per default so it doesn't need to be started. It will however start with all count values as 0, so you may want to set these - depending on your application.&lt;BR /&gt;&lt;BR /&gt;There is a further discussion here:&lt;BR /&gt;&lt;A href="http://www.utasker.com/forum/index.php?topic=35.0" rel="nofollow" target="_blank"&gt;http://www.utasker.com/forum/index.php?topic=35.0&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Mark&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.uTasker.com" rel="nofollow" target="_blank"&gt;www.uTasker.com&lt;/A&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 May 2008 01:51:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/RTC-problem-with-MCF52234-Clock-doesn-t-start-to-run/m-p/159332#M4919</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2008-05-28T01:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: RTC problem with MCF52234 (Clock doesn't start to run)</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/RTC-problem-with-MCF52234-Clock-doesn-t-start-to-run/m-p/159333#M4920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hello again.&lt;BR /&gt;&lt;BR /&gt;Thank you for your help. The Clock is running now.&lt;BR /&gt;And you are right, I want to set the clock.&lt;BR /&gt;I'm sending the clock values (hour, minute, second) to the MCF52234 by the Ethernet-Stack.&lt;BR /&gt;The Values are stored in a buffer and then in values.&lt;BR /&gt;&lt;BR /&gt;But how can I write them to the RTC?&lt;BR /&gt;My assignments always types out an lvalue-error.&lt;BR /&gt;&lt;BR /&gt;Here some code I tried:&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;MCF_RTC_HOURMIN_HOURS = hour;
MCF_RTC_HOURMIN_MINUTES = minutes;
MCF_RTC_SECONDS_SECONDS = sec;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;(UINT8)((MCF_RTC_HOURMIN  &amp;amp; 0x00001F00)&amp;gt;&amp;gt;8) = hour;(UINT8)(MCF_RTC_HOURMIN &amp;amp; 0x0000003F) = minutes;(UINT8)(MCF_RTC_SECONDS &amp;amp; 0x0000003F) = sec;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;I think its only a little thing, but to hard for a beginner..&lt;BR /&gt;&lt;BR /&gt;Thank you for your help!&lt;BR /&gt;&lt;BR /&gt;BlackIP&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;EDIT:&lt;BR /&gt;&lt;BR /&gt;I don't even have the "app_hw_m5223x.h" file exposed in the other thread.&lt;BR /&gt;Where do I get it?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by BlackIP on &lt;SPAN class="date_text"&gt;2008-05-28&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;01:29 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:04:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/RTC-problem-with-MCF52234-Clock-doesn-t-start-to-run/m-p/159333#M4920</guid>
      <dc:creator>BlackIP</dc:creator>
      <dc:date>2020-10-29T09:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: RTC problem with MCF52234 (Clock doesn't start to run)</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/RTC-problem-with-MCF52234-Clock-doesn-t-start-to-run/m-p/159334#M4921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hi&lt;BR /&gt;&lt;BR /&gt;Don't forget that the day counter counts from 0..64k so it is necessary to add Gregorian date conversion when setting the data, and the opposite when displaying it. You don't seem to be using the data counter at the moment and you will have only time of day.&lt;BR /&gt;&lt;BR /&gt;I think that you can simply set the time by doing the following:&lt;BR /&gt;&lt;PRE&gt;MCF_RTC_HOURMIN_HOURS   = hour;     // alternatively (hour &amp;amp; 0x1f)
MCF_RTC_HOURMIN_MINUTES = minutes;  // alternatively (minutes &amp;amp; 0x3f)
MCF_RTC_SECONDS_SECONDS = sec;      // alternatively (minutes &amp;amp; 0x3f)&lt;/PRE&gt;I didn't check the defines used above but basically there are 2 x 32 registers:&lt;BR /&gt;- SECONDS containing just seconds&lt;BR /&gt;- HOURMIN containing hours and minutes&lt;BR /&gt;I suspect that you have defines like RTC_HOURMIN_HOURS and RTC_HOURMIN_MINUTES allowing byte accesses to the corresponding parts of the HOURMIN register.&lt;BR /&gt;Alternatively you can probably do a single access to the complete register&lt;BR /&gt;&lt;PRE&gt;MCF_RTC_HOURMIN = ((hour &amp;lt;&amp;lt; 8) | minutes);&lt;/PRE&gt;It seems that some of the code which you show is syntactically incorrect but also probably not relevant for what you want to do.&lt;BR /&gt;&lt;BR /&gt;&lt;I&gt;app_hw_m5223x.h&lt;/I&gt; is a hardware configuration file from the uTasker project (which you are not using). We are presently adding RTC support for the M5221X which has an external 32k crystal and battery back-up support, making the RTC much more&amp;nbsp; attractive - here we also use Gregorian date conversions so that the calendar date is managed correctly. Our experience has shown that most M5223X projects with RTC requirements are solved by using an external RTC (eg. via I2C) with battery backup but this will certainly change with the battery backup support in newer devices.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Mark&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.uTasker.com" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;www.uTasker.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;






&lt;/PRE&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:04:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/RTC-problem-with-MCF52234-Clock-doesn-t-start-to-run/m-p/159334#M4921</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2020-10-29T09:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: RTC problem with MCF52234 (Clock doesn't start to run)</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/RTC-problem-with-MCF52234-Clock-doesn-t-start-to-run/m-p/159335#M4922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Thank you for the advice but I don't need the day counter now, perhaps later.&lt;BR /&gt;&lt;BR /&gt;I think you mean this defines:&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;#ifndef __MCF5223_RTC_H__
#define __MCF5223_RTC_H__

/*********************************************************************
*
* Real-time Clock (RTC)
*
*********************************************************************/

/* Register read/write macros */
&lt;FONT color="#ff0000"&gt;#define MCF_RTC_HOURMIN              (*(vuint32*)(&amp;amp;__IPSBAR[0x0003C0]))
#define MCF_RTC_SECONDS              (*(vuint32*)(&amp;amp;__IPSBAR[0x0003C4]))&lt;/FONT&gt;
#define MCF_RTC_ALRM_HM              (*(vuint32*)(&amp;amp;__IPSBAR[0x0003C8]))
#define MCF_RTC_ALRM_SEC             (*(vuint32*)(&amp;amp;__IPSBAR[0x0003CC]))
#define MCF_RTC_CR                   (*(vuint32*)(&amp;amp;__IPSBAR[0x0003D0]))
#define MCF_RTC_ISR                  (*(vuint32*)(&amp;amp;__IPSBAR[0x0003D4]))
#define MCF_RTC_IER                  (*(vuint32*)(&amp;amp;__IPSBAR[0x0003D8]))
#define MCF_RTC_STPWCH               (*(vuint32*)(&amp;amp;__IPSBAR[0x0003DC]))
#define MCF_RTC_DAYS                 (*(vuint32*)(&amp;amp;__IPSBAR[0x0003E0]))
#define MCF_RTC_ALRM_DAY             (*(vuint32*)(&amp;amp;__IPSBAR[0x0003E4]))

/* Bit definitions and macros for MCF_RTC_HOURMIN */
&lt;FONT color="#ff0000"&gt;#define MCF_RTC_HOURMIN_MINUTES(x)   (((x)&amp;amp;0x0000003F)&amp;lt;&amp;lt;0)&lt;/FONT&gt;&lt;FONT color="#ff0000"&gt;
&lt;/FONT&gt;&lt;FONT color="#ff0000"&gt;#define MCF_RTC_HOURMIN_HOURS(x)     (((x)&amp;amp;0x0000001F)&amp;lt;&amp;lt;8)&lt;/FONT&gt;

/* Bit definitions and macros for MCF_RTC_SECONDS */
&lt;FONT color="#ff0000"&gt;#define MCF_RTC_SECONDS_SECONDS(x)   (((x)&amp;amp;0x0000003F)&amp;lt;&amp;lt;0)&lt;/FONT&gt;

/* Bit definitions and macros for MCF_RTC_ALRM_HM */
#define MCF_RTC_ALRM_HM_MINUTES(x)   (((x)&amp;amp;0x0000003F)&amp;lt;&amp;lt;0)
#define MCF_RTC_ALRM_HM_HOURS(x)     (((x)&amp;amp;0x0000001F)&amp;lt;&amp;lt;8)
.
.
. and so on..&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;Here I added my code for setting and reading the time from RTC:&lt;BR /&gt;The reading works fine. I will make no changes here.&lt;BR /&gt;Codewarrior gets an error by compiling this:&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;//********** Set Time ********************************************************//// Sets Time and Date // // Arguments: Time  ////*****************************************************************************void set_time(u_char *pBuffer){ int hour, minutes, sec;  pBuffer++; hour = (u_char)*pBuffer;  pBuffer++; minutes = (u_char)*pBuffer;  pBuffer++; sec = (u_char)*pBuffer;  MCF_RTC_HOURMIN_HOURS =  hour;   // hour &amp;amp; 0x1f MCF_RTC_HOURMIN_MINUTES = minutes; // minutes &amp;amp; 0x3f  MCF_RTC_SECONDS_SECONDS = sec; // sec &amp;amp; 0x3f}//********** Read Time ********************************************************//// Sends Time and Date to the TCP/IP Client// // Arguments: Time  ////*****************************************************************************void read_time(){ int time_temp; int rtc_hrs; int rtc_min; int rtc_sec;  rtc_hrs = (UINT8)((MCF_RTC_HOURMIN  &amp;amp; 0x00001F00)&amp;gt;&amp;gt;8); rtc_min = (UINT8)(MCF_RTC_HOURMIN &amp;amp; 0x0000003F) ; rtc_sec = (UINT8)(MCF_RTC_SECONDS &amp;amp; 0x0000003F) ;  buffer[0]=0xFF; asm {nop} buffer[1]=rtc_hrs; asm {nop} buffer[2]=rtc_min;  asm {nop} buffer[3]=rtc_sec; asm {nop} m_send( emg_tcp_communication_socket, (char*)&amp;amp;buffer[0], 4 ); }&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;Codewarrior has the following errors:&lt;BR /&gt;&lt;BR /&gt;undefined identifier MCF_RTC_HOURMIN_HOURS&lt;BR /&gt;undefined identifier MCF_RTC_HOURMIN_MINUTES&lt;BR /&gt;undefined identifier MCF_RTC_HOURMIN_SECONDS&lt;BR /&gt;&lt;BR /&gt;I don't understand why I'm getting these errors. In the reading-function everything works fine.&lt;BR /&gt;And I'm just using the same defines.&lt;BR /&gt;&lt;BR /&gt;So I need help again.&lt;BR /&gt;&lt;BR /&gt;Thank you and regards.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Btw: Which code do you mean is incorrect? I'm just practising and learning by doning &lt;SPAN&gt;&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:04:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/RTC-problem-with-MCF52234-Clock-doesn-t-start-to-run/m-p/159335#M4922</guid>
      <dc:creator>BlackIP</dc:creator>
      <dc:date>2020-10-29T09:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: RTC problem with MCF52234 (Clock doesn't start to run)</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/RTC-problem-with-MCF52234-Clock-doesn-t-start-to-run/m-p/159336#M4923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi&lt;BR /&gt;&lt;BR /&gt;Now I see. You are using the macros incorrectly - I think that they need to be used as follows:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;I&gt;MCF_RTC_&lt;/I&gt;&lt;I&gt;SECONDS&lt;/I&gt;&lt;/FONT&gt;&lt;I&gt;&lt;FONT size="2"&gt;= MCF_RTC_SECONDS_SECONDS(sec);&lt;BR /&gt;MCF_RTC_HOURMIN = MCF_RTC_HOURMIN_HOURS(hour) | MCF_RTC_HOURMIN_MINUTES(minutes);&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/I&gt;However I see no real advantage of the macros - they are also not really accurate in restricting the value (hour &amp;amp;= 0x1f) will still allow a value of 25 to be written (for example).&lt;BR /&gt;I would simply check the values before writing (eg.):&lt;BR /&gt;if (hours &amp;gt;= 24) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // bad parameter&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; hours = 0;&amp;nbsp;&amp;nbsp; // limit&lt;BR /&gt;}&lt;BR /&gt;if (minutes &amp;gt;= 60) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // bad parameter&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; minutes= 0;&amp;nbsp;&amp;nbsp; // limit&lt;BR /&gt;}&lt;BR /&gt;Then&lt;BR /&gt;&lt;I&gt;&lt;FONT size="2"&gt;MCF_RTC_HOURMIN = ((hour &amp;lt;&amp;lt; 8) | minutes);&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/I&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Mark&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.uTasker.com" rel="nofollow" target="_blank"&gt;www.uTasker.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;I&gt;&lt;BR /&gt;&lt;/I&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 May 2008 21:58:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/RTC-problem-with-MCF52234-Clock-doesn-t-start-to-run/m-p/159336#M4923</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2008-05-28T21:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: RTC problem with MCF52234 (Clock doesn't start to run)</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/RTC-problem-with-MCF52234-Clock-doesn-t-start-to-run/m-p/159337#M4924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;it's working now.&amp;nbsp; &lt;SPAN&gt;&lt;IMG alt=":smileyhappy:" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-happy.gif" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;I tried the following options:&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;MCF_RTC_SECONDS = MCF_RTC_SECONDS_SECONDS(sec);MCF_RTC_HOURMIN = MCF_RTC_HOURMIN_HOURS(hour) | MCF_RTC_HOURMIN_MINUTES(minutes);&lt;/PRE&gt;&lt;/DIV&gt;and&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;MCF_RTC_HOURMIN = ((hour &amp;lt;&amp;lt; 8) | minutes);MCF_RTC_SECONDS = (sec);&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;They are similar.&lt;BR /&gt;&lt;BR /&gt;Now I'm thinking about realizing the day counter.&lt;BR /&gt;It should run with this line:&lt;BR /&gt;&lt;BR /&gt;MCF_RTC_DAYS_DAYS(days)&lt;BR /&gt;&lt;BR /&gt;Perhaps you can give me some information for integrating the gregorean calendar.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I have to thank you for your help!&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;&lt;BR /&gt;BlackIP&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by BlackIP on &lt;SPAN class="date_text"&gt;2008-05-29&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;10:34 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:04:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/RTC-problem-with-MCF52234-Clock-doesn-t-start-to-run/m-p/159337#M4924</guid>
      <dc:creator>BlackIP</dc:creator>
      <dc:date>2020-10-29T09:04:48Z</dc:date>
    </item>
  </channel>
</rss>

