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.
Hello,
I'm trying to write an interrupt function on the ADuC7020 (Analog Devices) using Keil V4. While my code is compiling and linking without error the interrupt function I've written is not being executed. I'm identifying my interrupt function as,e.g.:
__irg void My_Irq_function (void) { interrupt code; }
I'm missing something (prob simple). I've looked everywhere and have not been able to find anything. If someone could point me in the right direction (documentation, website etc.) it would be much appreciated.
Thanks,
Arm7 newbie
you need to: * Register the interrupt service routine in your vector interrupt controller at the slot dedicated to the correct peripheral. * determine the required priority. * enable the VIC slot.
for a LPC2478, preparing for serial communication coming in via interrupt driven UART, it might look like this:
// install handler for serial communication (UART2) SCS |= 1 ; // this bit must be set again in the application as it is not preserved after the jump to application PCONP |= 0x01000000 ; //Power Control for Peripheral uart2 on PINSEL0 |= 0x500000 ; // Enable UART2 pins on P0.10=TXD2,P0.11=RXD2, p0.12 as GPIO U2IER = 0x1 ; // enable uart2 RX interrupts // 8 bits, no Parity, 1 Stop bit U2LCR = 0x83 ; // enable FIFOs trigger level for RX interrupt is 14 (=UART3_RX_FIFO_TRIGGER_LEVEL) characters U2FCR |= 0xC7 ; // Configure uart2 for 115200 baud. U2DLL = 6 ; U2DLM = 0 ; U2FDR = 0xC1 ; U2LCR = 0x03 ; // DLAB = 0 // i/o init outputs p0.12 DIR and p0.22 LED uart2 FIO0DIR |= 0x00401000; FIO0SET |= 0x00401000; // install ISR VICVectAddr28 = (unsigned int)uart2_handler ; VICVectCntl28 = IRQ_PRIORITY_7 ; VICIntEnable = (int32u)1<<UART2_INT ;