56F807, interrupt vector table, jmp vs. jsr

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

56F807, interrupt vector table, jmp vs. jsr

1,093件の閲覧回数
j___
Contributor IV

I am working on some new code & some legacy code for an old product that uses the 56F807.

The new code generated from stationary (non-PE) using  CW8.3 uses the "jmp" instruction in the vector table. This what I expect. However, the legacy code, has "jsr" instructions in the vector table.

Which is expect or required in the vector table, "jmp" or "jsr"?

Is it OK to use either "jmp" or "jsr" in the vector table as long as the called function is marked with "#pragma interrupt"?

0 件の賞賛
返信
3 返答(返信)

931件の閲覧回数
j___
Contributor IV

Attached is the vector .asm file generated by CW8.3, project stationary (non-PE). It has "jmp" in the reset vectors instead of "jsr".

I'm thinking that either one is OK.

0 件の賞賛
返信

931件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Jim,

Regarding the vector table of DSC, I think you can use either jmp or jsr.

When interrupt happens, the PC value of the next instruction and SR register are saved in stack automatically, then DSC jump to the ISR and execute te the ISR. When the DSC execute the RTI instruction in ISR, PC and SR are popped from stack, the DSC resume to execute from where it enters ISR. From the analysis, I think jump is good.

Hope it can help you

BR

Xiangjun Rong

0 件の賞賛
返信

931件の閲覧回数
j___
Contributor IV

I found this in the document, “DSP56F800 Family User’s Manual, Rev. 8”.

 

3.10 56800 Reset and Interrupt Vectors

The reset and interrupt vector map specifies the address the processor jumps to when it recognizes an interrupt or encounters a reset condition. The instruction located at this address must be a JSR instruction for an interrupt vector, or a JMP instruction for a reset vector. The interrupt vector map for a given chip is specified by all possible interrupt sources on the 56800 core, as well as from the peripherals. No Interrupt Priority Level (IPL) is specified for hardware reset or for COP reset because these conditions reset the chip. Resetting takes precedence over all other interrupts.

 

Oddly, though, the CW8.3 stationary created the file “DSP56F807_vector_pROM.asm which uses “jmp” in all vectors including the first two, which are the reset vectors. The code seems to run OK.

The legacy code has "jsr" in all the vectors and it seems to work OK too.

What would specifically be the difference between these two instructions?

In document "DSP56F800 Family User’s Manual, Rev. 8, pg. A-3", is table for these instructions:

=======================================================
|Mnemonic|Syntax|Parallel|Prog|Clock |SZ|L|E|U|N|Z|V|C|
|        |      |Moves   |Word|Cycles|  | | | | | | | |
|========|======|========|====|======|==|=|=|=|=|=|=| |
|        |      |        |    |      |  | | | | | | | |
|   JMP  | xxxx |  ...   | 2  |      |--|-|-|-|-|-|-|-|
|        | (Rn) |        | 1  | 6+jx |  | | | | | | | |
|        |      |        |    |      |  | | | | | | | |
|========|======|========|====|======|==|=|=|=|=|=|=| |
|        |      |        |    |      |  | | | | | | | |
|   JSR  | xxxx |  ...   | 2  |      |--|-|-|-|-|-|-|-|
|        |  AA  |        | 1  |      |  | | | | | | | |
|        | (Rn) |        | 1  | 8+jx |  | | | | | | | |
|        |      |        |    |      |  | | | | | | | |
=======================================================

It looks like the only difference is that JSR saves upper & lower accumulator A, is that correct?

If so, then it would seem that it is not a problem to use JSR for interrupts as long as the increased latency of saving the accumulator is not an issue for the user's code.

Does this sound reasonable?

0 件の賞賛
返信