I am trying to develop some code that uses interrupt 17, but the compiler is not generating the interrupt vector table correctly. With interrupt 17, location 0x0083 in code space should contain an LJMP instruction to the corresponding address interrupt 17 ISR. However, using the Silicon Labs IDE (version 3.50 and the target device is a C8051F320) all I am seeing at that location is an RETI instruction.
I have attached some code that is a simple program that blinks an LED. To reproduce this problem, just try compiling this code to and then downloading to a device (I do not think this problem is device specific). I am not receiving and warnings or errors after compiling. If you look at location 0x0083 in code, you will see that there is no LJMP instruction (in my case, there is an RETI instruction). However, if you define the interrupt as 18 instead of 17 (in both the interrupt prototype and the ISR declaration), the compiler is generating the correct code. Using interrupt 18, if you look at location 0x0093 in code space, you will see an LJMP instruction that has the address of the actual interrupt 18 ISR.
I am using SDCC version 2.8.0. I am also attaching a Silicon Labs IDE workspace file (in case you are able to test this on that particular IDE). If not, the command line options are:
Compiler: -c --debug --use-stdout -V
Linker: --debug --use-stdout -V
Let me know if you need anymore information.
Log in to post a comment.