Hello, i am trying to write vector table for lpc1768 using c language. i have used the following code but the ISR is not executing.
// HW_REG is a macro to convert address value to pointer #define HW_REG(addr) (*((volatile unsigned long *)(addr))) #define NEW_VECT_TABLE 0x10006000 main() {
SCB->VTOR = NEW_VECT_TABLE; // Relocate vector table to SRAM HW_REG(4*(7+16)) = (unsigned) EINT0_IRQHandler; // Setup vector NVIC_SetPriority(EINT0_IRQn, 0xC0); // Set IRQ#7 priority level to 0xC0 NVIC_EnableIRQ(EINT0_IRQn); } kindly help me thank you in advance
Wouldn't HW_REG need to be passed an address that's actually in the vector table? ie addr + NEW_VECT_TABLE