Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] main program doesn't get execute if i use RTC interrupt

Status
Not open for further replies.

bikashh

Full Member level 5
Full Member level 5
Joined
Nov 28, 2009
Messages
264
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
india
Visit site
Activity points
3,132
Dear friends,
thanks for the reply friends,I've solved the problem but still have a small problem with it
->if i enable the RTC interrupt under main() the program works perfectly but when i write it separately under RTCinit() the code after VICIntEnable doesn't work that means rest of the program under mains doesn't execute.


VICVectAddr13 = (unsigned long)RTC_isr;/*Set Interrupt Vector*/
VICVectCntl13 = 15;
VICIntEnable |=(1<<13);

also in the above VICVectCntl13 the actual value to be loaded is 0x2D but doesn't work while it works correctly if i put 15;

please reply
 

also in the above VICVectCntl13 the actual value to be loaded is 0x2D but doesn't work while it works correctly if i put 15;

This was true in the 21xx/22xx series where the interrupt needed to be enabled using the 0x20 in the VICVectCntl register.
In 23xx/24xx it doesn't work this way and there is no VICVectCntl register and it is a mistake that Keil includes a define that points VICVectCntl to the VICVectPriority location

the 23xx.h is like this and is wrong
#define VICVectCntl0 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x200))
#define VICVectCntl1 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x204))
...
#define VICVectPriority0 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x200))
#define VICVectPriority1 (*(volatile unsigned long *)(VIC_BASE_ADDR + 0x204))


The correct code is

Code C - [expand]
1
2
3
VICVectAddr13 = (unsigned long) interrupt_function_name;           /* set interrupt vector 13 */
VICVectPriority13 = 15 ;           /* default priority is 15 (lowest), can be set between 0-15 */
VICIntEnable |= ((unsigned long)1<<13);           /* Enable RTC Interrupt */



Alex
 

dear friend, I've already used the "VICVectPriority" in my code but the result is still the same.

RTC works correctly but the remaining program under mains doesn't get executed.

Terminal Output:
Real Time Clock = 4 : 4 : 44 : 52 5 5 2011
Real Time Clock = 4 : 4 : 44 : 53 5 5 2011

main()
{
Init_UART0(9600); // Initilial UART0 = 9600,N,8,1
RTCIN();
while(1) //this loop doesn't get executed.
{
uart0Puts("hi \n\r");
}
}

I tried to debug by writing a sentence after "VICIntEnable |= ((unsigned long)1<<13); "
but that sentence never appear on the terminal except RTC time and date as above.

thanks for the reply
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top