<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>LPC2368 RTC initialization problem</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/21378/lpc2368-rtc-initialization-problem</link><description> 
Hi All, 
I am trying to read RTC data in interrupt routine and display the
data on PC through RS232. 

 
I always get interrupt every 16.40ms, and RTC data (hour, min and
sec) is 0 (no increment). 

 
Following are my RTC initilization and ISR codes</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: LPC2368 RTC initialization problem</title><link>https://community.arm.com/thread/138389?ContentTypeID=1</link><pubDate>Wed, 14 Mar 2007 08:39:29 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d050c01b-a0e3-47f6-b517-7c7548a81cab</guid><dc:creator>Jaxk Y</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi Vektor,&lt;br /&gt;
Thank you very much for your help.&lt;br /&gt;
Have a good day.&lt;br /&gt;
Jack&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPC2368 RTC initialization problem</title><link>https://community.arm.com/thread/134959?ContentTypeID=1</link><pubDate>Wed, 14 Mar 2007 06:33:23 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f713122b-68a6-48fe-8956-9bf182a80ee2</guid><dc:creator>Viktor Bucher</dc:creator><description>&lt;p&gt;&lt;p&gt;
About 0x20 (bit 5=IRQslot_en) in VicVectCntl13 :&lt;/p&gt;

&lt;p&gt;
From Manual : &amp;quot;When 1, this vectored IRQ slot is enabled, and can
produce a unique ISR address when its assigned interrupt request or
software interrupt is enabled, classified as IRQ, and asserted.&amp;quot;&lt;/p&gt;

&lt;p&gt;
About the interrupt handler:&lt;/p&gt;

&lt;p&gt;
void rtc_int(void) __irq { if(ILR_BITS.RTCCIF) { ILR |= 1; // Put
code here } if(ILR_BITS.RTCALF) { ILR |= 2; // Put code here }
VICVectAddr = 0; }&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPC2368 RTC initialization problem</title><link>https://community.arm.com/thread/123727?ContentTypeID=1</link><pubDate>Tue, 13 Mar 2007 17:02:18 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:da42f276-4eab-44fc-b0c6-ed119277b429</guid><dc:creator>Jaxk Y</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi Vektor,&lt;br /&gt;
The result is the same as mine-- too many interrupts in 1 sec, but
RTC data updated is ok.&lt;br /&gt;
when I added CISS = 0 in initial_rtc(), your code works,&lt;br /&gt;
same thing done in my code, it works also, interesting!!&lt;br /&gt;
Question is: in your code, &amp;quot;VICVectCntl13 |= 0x20 | VIC_RTC;&amp;quot; what
does &amp;quot;0x20&amp;quot; mean?&lt;/p&gt;

&lt;p&gt;
Thanks&lt;/p&gt;

&lt;p&gt;
Jack&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPC2368 RTC initialization problem</title><link>https://community.arm.com/thread/112737?ContentTypeID=1</link><pubDate>Tue, 13 Mar 2007 16:30:48 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:25563b20-690d-4b66-bdb0-7310bf73ec54</guid><dc:creator>Jaxk Y</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi Vektor,&lt;br /&gt;
Thanks a lot, I will try it.&lt;/p&gt;

&lt;p&gt;
Thanks again&lt;/p&gt;

&lt;p&gt;
Jack&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPC2368 RTC initialization problem</title><link>https://community.arm.com/thread/99020?ContentTypeID=1</link><pubDate>Tue, 13 Mar 2007 15:38:49 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ea3c2223-e3c4-4d1f-8ba0-66dc1065e5c4</guid><dc:creator>Viktor Bucher</dc:creator><description>&lt;p&gt;&lt;p&gt;
This initialization should work&lt;/p&gt;

&lt;p&gt;
#define VIC_RTC 13&lt;/p&gt;

&lt;p&gt;
void initial_rtc()&lt;br /&gt;
{ ILR = 0x03; CCR = (1&amp;lt;&amp;lt;4) | (1&amp;lt;&amp;lt;0); CIIR = 1&amp;lt;&amp;lt;0;
VICVectAddr13 = (unsigned long)read_rtc; VICVectCntl13 |= 0x20 |
VIC_RTC; VICIntSelect &amp;amp;= ~(1&amp;lt;&amp;lt;VIC_RTC); VICIntEnable |= (1
&amp;lt;&amp;lt; VIC_RTC);&lt;br /&gt;
}&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPC2368 RTC initialization problem</title><link>https://community.arm.com/thread/74913?ContentTypeID=1</link><pubDate>Tue, 13 Mar 2007 11:23:33 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:619ae31b-fd7c-4536-bce1-d9c5865343bb</guid><dc:creator>Jaxk Y</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi Viktor,&lt;br /&gt;
It does not work, the result is the same as before.&lt;/p&gt;

&lt;p&gt;
Thanks&lt;br /&gt;
Jack&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: LPC2368 RTC initialization problem</title><link>https://community.arm.com/thread/50500?ContentTypeID=1</link><pubDate>Tue, 13 Mar 2007 11:18:48 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e85eb9d5-b0e1-4587-8397-b11bd64c42cd</guid><dc:creator>Viktor Bucher</dc:creator><description>&lt;p&gt;&lt;p&gt;
Try with:&lt;/p&gt;

&lt;p&gt;
Replace line :&lt;br /&gt;
CCR |=0x01;&lt;/p&gt;

&lt;p&gt;
with&lt;/p&gt;

&lt;p&gt;
CCR = 0x11;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>