The vector table for the QY is found on the datasheet. Please refer to page 32 of the datasheet (Rev. 5) found here:
formatting link
To populate the interrupt vector table for the interrupts you are want to use (you don't have to populate them all unless you are willing to use them) in Codewarrior you simply define an interrupt service routine (and populate its vector table entry at the same time) as the following:
interrupt NN void YourInterruptNameHere (void) { }
Where NN is the vector table entry.
0 for Reset (NEVER CHANGE THIS UNLESS YOU PROVIDE YOUR OWN STARTUP FILE)
1 for the Software Interrupt
2 for the external IRQ
3 Not used
4 Timer Channel 0 ...
15 Keyboard Interrupt
16 ADC
Example:
interrupt 15 void MyFirstKeyboardInterrupt (void) { KBSCR |= 0x04; /* Ack this interrupt */ /* Do your stuff here */ }
void main (void) { KBIER |= 0x5; /* Enable KBI0 and KBI2 IRQs */ EnableInterrupts; /* main loop goes here */ }
To simply test your Interrupt handing you can use the simulator and write a handler to populate and process the Software Interrupt. Here is the example;
interrupt 1 void MySoftwareInterrupt (void) { __asm ( "nop" ); /* Place your breakpoint here */ }
void main (void) { EnableInterrupts; __asm ( "swi" ); /* Perform a sowftare interrupt */ for (;;); }
Happy coding!