How to write interrupt function in codewarrior10.7

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

How to write interrupt function in codewarrior10.7

2,186 次查看
weilong
Contributor I

Such as title

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

1,962 次查看
weilong
Contributor I

9s12zvca192

IMG_20171123_142758.jpg

???? What's wrong with that?

IMG_20171123_142652.jpg

0 项奖励
回复

1,962 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi,

There is not only one way to implement interrupt.

the most commonly used way is : interrupt <vector_number> <function_name>

Vector number can be found in datasheet vector locations table.

I would suggest you refer tn101.pdf for how to implement interrupt. It also works for S12Z.

Count from bottom of the table for the “vector number”. the power on reset vector is vector number 0 (located at address 0), vector number 1 is located just after the vector 0 (at address 0x2) and so on.

ie Reset = 0 (address is $FFFE),Low Voltage Reset = 1,  External pin RESET = 2 , ......

Using the keyword ‘interrupt’:


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

1,962 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi

What chip do you work with?

0 项奖励
回复