We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
dear all, i have a arm board of s3c2440a from friendlyarm. i am using IDE of metrowerks code warrior for arm developer suite v1.2. i have started the PLL and timer. but i am unable to start interrupt. i did all the initialisation for interrupt sam as the way it is shown in the sample program. i am attaching my code for the reference. i am posting in keil because i didnt get help in friendlyarm.net. pls gothrough my code and help me out thank you regards PS: in case of any queries pls let me know. here is my code:
#include "def.h" #include "option.h" #include "2440addr.h" #include "2440lib.h" #include "2440slib.h" #define EnableIrq(bit) rINTMSK &= ~(bit) #define DisableIrq(bit) rINTMSK |= (bit) #define EnableSubIrq(bit) rINTSUBMSK &= ~(bit) #define DisableSubIrq(bit) rINTSUBMSK |= (bit) void delay(unsigned int i); void initialise(void); void init(void); void __irq timer0isr(void); void MMU_SetFastBusMode(void); //GCLK=HCLK void MMU_SetAsyncBusMode(void); //GCLK=FCLK @(FCLK>=HCLK) void HaltUndef(void); void HaltSwi(void); void HaltPabort(void); void HaltDabort(void); void HaltIrqabort(void); void HaltFiqabort(void); void ClearPending(int bit); void ClearSubPending(int bit); void enable_IRQ(void); void __irq timer0isr(void) { rGPBDAT = 0x141; rSRCPND = BIT_TIMER0; //Clear pending bit rINTPND = BIT_TIMER0; } void delay(unsigned int i) { unsigned int a,b; for(a=0;a<i;a++) b = 0; } void init(void) { unsigned char mdiv,pdiv,sdiv; mdiv = 0x5c; //settings for 405MHZ operation for M PLL pdiv = 0x01; sdiv = 0x01; rMPLLCON = (mdiv << 12); rMPLLCON |= (pdiv << 4); rMPLLCON |= sdiv; mdiv = 2; pdiv = 0; rCLKDIVN = (mdiv << 1); //FCLK = 405MHZ (MPLLCON setting), HCLK = FLK/4 = 101MHz, PCLK = HCLK/2 = 50MHz, UCLK = UPLLCON (as it is 48MHZ reqd) rCLKDIVN |= pdiv; mdiv = 0x38; //settings for 405MHZ operation for M PLL pdiv = 0x02; sdiv = 0x02; rUPLLCON = (mdiv << 12); rUPLLCON |= (pdiv << 4); rUPLLCON |= sdiv; pISR_UNDEF=(unsigned)HaltUndef; pISR_SWI =(unsigned)HaltSwi; pISR_PABORT=(unsigned)HaltPabort; pISR_DABORT=(unsigned)HaltDabort; pISR_IRQ =(unsigned)HaltIrqabort; pISR_FIQ =(unsigned)HaltFiqabort; rINTMOD=0x00000000; // All=IRQ mode rINTMSK=BIT_ALLMSK; // All interrupt is masked. rPRIORITY = 0x00; rSUBSRCPND = 0x00000000; rINTSUBMSK = 0xffff; rCLKCON = 0xfffff0; } int Main(int argc, char **argv) { int i; i = 0; for(i=0;i<100;i++) delay(10000); for(i=0;i<100;i++) delay(10000); for(i=0;i<100;i++) delay(10000); for(i=0;i<100;i++) delay(10000); for(i=0;i<100;i++) delay(10000); for(i=0;i<100;i++) delay(10000); init(); //initialisation of the interrupt ClearPending(BIT_TIMER0); rPRIORITY = 0x7f; pISR_IRQ = (unsigned int)timer0isr; pISR_TIMER0 = (unsigned int)timer0isr; //timer initialisation: //Timer input clock Frequency = PCLK / {prescaler value+1} / {divider value} rTCFG0 = 0x000000ff; //prescalar = 255 + 1 rTCFG1 = 0x00000003; //divide by 16 rTCNTB0 = 30000; //down counter rTCMPB0 = 500; rTCON = 0x00000000; rTCON = 0x0000000b; //AR INV UPDT START rTCON = 0x00000009; EnableIrq(BIT_TIMER0); delay(100); //port initialisation: rGPBCON = 0x155556; //tout0 = gpb0 rGPBUP = 0x7ff; //pullup disable rGPBDAT = 0x0000a0; //|AR|INV|UPDT|START| //if set inverter on, when TCNT2<=TCMP2, TOUT is low, TCNT2>TCMP2, TOUT is high //if set inverter off, when TCNT2<=TCMP2, TOUT is high, TCNT2>TCMP2, TOUT is low for(;;) { i = 0; } return 0; } void HaltUndef(void) { while(1); } void HaltSwi(void) { while(1); } void HaltPabort(void) { while(1); } void HaltDabort(void) { while(1); } void HaltIrqabort(void) { while(1); } void HaltFiqabort(void) { while(1); } void ClearPending(int bit) { register i; rSRCPND = bit; rINTPND = bit; i = rINTPND; } void ClearSubPending(int bit) { register i; rSUBSRCPND = bit; i = rINTPND; }
hello everyone, can you pls help me out in my problem? thank you all
hello everyone, has anyone worked on arm9 of s3c2440a? pls suggest me some documents for it. so that i can solve my problem thank you
http://www.keil.com/dd/chip/4277.htm provides a copy of the User Manual
Have you looked on the manufacturer's (Samsung?) website?
hello andy, thankx for reply. i have its user manual but i didnt get info about interrupt much except its register. is it so that interrupt in arm9 works only on OS platform? because i have not installed OS on arm board and on samsung i couldnt found the info nor do they send me info. so pls clr my doubt. thank you
Think about it: the processor just executes instructions - it has absolutely no idea whatsoever whether those instructions happen to form part of an OS or anything else!
dear sir, i read about its nand memory that it loads code to 1st 4kB of sdram in s3c2440a and executes from there but they didnt mention about interrupt location. do i have to shift to any interrupt location then how? interrupts are executed in priviledged mode. but i m writing code in 'C' so i think i dont have to do this switching am i right? i think its related to place interrupts at proper location but how? pls guide me thank you regards