question on PE generated vector table for 8bit MCU

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

question on PE generated vector table for 8bit MCU

Jump to solution
1,005 Views
hotashu
Contributor III

I use Codwarrior 6.3 processor expert. when creates a new project. processor expert generate vector table that includes UNASSIGNED_ISR defined as 0xFFFF.

so what will happen when this unexceptional UNASSIGNED_ISR happend? program goes to address 0xFFFF and stuck there?

and what will happen if define UNASSIGNED_ISR as 0xfffe?

0 Kudos
1 Solution
826 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Let’s see what will happen when an interrupt comes:

When an interrupt comes,  CW will check the according interrupt table and load the interrupt service subroutine address(for example, 0xE0A4) to PC pointer, then CW will executes the pseudo-instruction from 0xE0A4 until it meets the return instruction(for example RTI). This is the normal interrupt execution process in Codewarrior.

If the interrupt service subroutine address is 0xFFFE, when the according interrupt comes, CW will load 0xFFFE to PC pointer then executes the pseudo-instruction from 0xFFFE.  Although 0xFFFE loads the startup code address(for example 0xE07B), PC pointer will not load 0xE07B the code will not jump to address 0xE07B but execute the pseudo-instruction of address 0xFFFE.

If you want see the exact difference between PC pointer pointing 0xFFFE and 0xFFFF. You can check how the code execution for these two line of code, separately:

asm jmp 0xFFFE;

asm jmp 0xFFFF;

View solution in original post

0 Kudos
3 Replies
827 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Let’s see what will happen when an interrupt comes:

When an interrupt comes,  CW will check the according interrupt table and load the interrupt service subroutine address(for example, 0xE0A4) to PC pointer, then CW will executes the pseudo-instruction from 0xE0A4 until it meets the return instruction(for example RTI). This is the normal interrupt execution process in Codewarrior.

If the interrupt service subroutine address is 0xFFFE, when the according interrupt comes, CW will load 0xFFFE to PC pointer then executes the pseudo-instruction from 0xFFFE.  Although 0xFFFE loads the startup code address(for example 0xE07B), PC pointer will not load 0xE07B the code will not jump to address 0xE07B but execute the pseudo-instruction of address 0xFFFE.

If you want see the exact difference between PC pointer pointing 0xFFFE and 0xFFFF. You can check how the code execution for these two line of code, separately:

asm jmp 0xFFFE;

asm jmp 0xFFFF;

0 Kudos
826 Views
Monica
Senior Contributor III

Hello hotas,

Have you tried out these examples? Have they been helpful?

Please don't forget to keep us posted!

Best,

Monica.

0 Kudos
825 Views
vfilip
NXP Employee
NXP Employee

Hello,

I have just generated deafult vector table for DZ60 (please find it attached) where you can find CPU_Interrupt function where the code jumps when unhandled interrupt appear. For details please see Unhandled vectors item on Build Options tab in CPU component.

Best regards

Vojtech Filip

Processor Expert Support Team