How to change vector Table

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to change vector Table

2,867 次查看
pIx
Contributor I

I basically need an answer to post http://forums.freescale.com/freescale/board/message?board.id=16BITCOMM&message.id=2795&a#M2795

J2MEJediMaster asked to "in the vector table you'd just plug the reset interrupt vector into the COP interrupt vector. In other words, if the COP occurs, you reset the processor."

How to do that?

I use CodeWarrior 4.5 and the vector table is defined in MC9S12DP512.h as
...
etc
...
...
#define Vcop 0x0000FFFA
#define Vclkmon 0x0000FFFC
#define Vreset 0x0000FFFE

I tried putting "0x0000FFFE" across Vcop, tried making Vcop into Vreset etc but nothing is working and I think its something I am doing wrong. My microcontroller is shutting down when the COP expires, but it is not coming back up. What to do? Please Help.

~Sujith

(Alban: link highlight)

Message Edited by Alban on 2006-11-29 11:25 AM

标签 (1)
0 项奖励
回复
3 回复数

849 次查看
CompilerGuru
NXP Employee
NXP Employee
Sorry, I cannot really help because I don't understand the problem.
I'm not sure what you did, somehow it sounds as if you would have changed the defines in the derivative header file.
As far as I know, those are there to be used, but out of the box, no one is using them. So writing wrong values into them wont help at all, it just make hard to track problems in the future.

There are really many ways to program the vectors. If this is about how to define the COP vector in addition to the reset vector, I would say, do it the same way for the cop as you did it for the reset vector. (maybe a VECTOR entry in the prm?), then add the same for the COP and all the other vectors you need (with an adapted vector number or vector address, of course).

Daniel
0 项奖励
回复

849 次查看
pIx
Contributor I
I am sorry, I wanted my microcontroller to reset when the COP times out and one suggestion I received was to update the interrupt vector table to reflect that and it didn't work and I was under the impression I was doing something wrong.

The solution turned out what you mentioned "updating the VECTOR entry in the prm". That solved the issue.

Thanks,
~Sujith

Message Edited by pIx on 2006-12-0108:31 PM

0 项奖励
回复

849 次查看
bigmac
Specialist III
Hello Sujith,
 
I suspect that there may have been some confusion between the address of a vector location, and the contents of that vector (the start address of the ISR or reset procedure).  The header file entry #define Vcop 0x0000FFFA  provides for substitution of a name to represent a numerical value ( that happens to be the address of a vector).  It does nothing else, and will do nothing unless your code actually uses the name.
 
To allocate the contents of a vector requires an entry in the .PRM file, as you have already discovered.
 
Regards,
Mac
 
0 项奖励
回复