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. 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; }
s3c2440a
hi, thanks for reply. i want to know that interrupts are implemented under OS only or without OS also it is implemented. because i did implementation of interrupts in arm7 without OS and there it is working fine. is there any address of interrupt is missing? pls tell me. thank you a lot for the reply regards
hi everybody. i'm using mini2440 now and it makes me confused. i installed linux on my PC( ubuntu 9.10) and began programming. But i don't know how to program, which language i should use, which IDE i can use. i also installed Code Block as an IDE but i can't create an GUI on it. do anyone tell me more specifically ? thanks a lot.
Hi Im developing a application to display images in LCD. Can anyone pls suggest me how to do this using Keil. Also, pls suggest how to flash the compiled .bin file to mini2440 board with bootloader. Also, if there is any initial settings to be done in keil, pls reply with that too. Thanks in Advance.