how to set up interrupt vector programmatically ?
for example, it is easy to define interrupt vector at the compile time like this, using winavr lib:
ISR(INT0_vect)
{
}
but I need select INT0_vect or INT1_vect... etc programmatically, depending on some conditions..
What is the easiest way ?
Thanks a lot
how to set up interrupt vector programmatically
The vector table consists of relative jump instructions. You must compute the correct rjmp instruction and write it to the vector table slot.
Please note that flash memory can only be programmed page-wise. You must read the entire page, modify the vector and write back the page. Also, some AVRs require that you run code which modifies the main flash memory from the boot loader section. And finally: While programming the flash memory, the CPU may be halted.
Please note that flash memory can only be programmed page-wise. You must read the entire page, modify the vector and write back the page. Also, some AVRs require that you run code which modifies the main flash memory from the boot loader section. And finally: While programming the flash memory, the CPU may be halted.