Priority of interrupts on MC9S12G192

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

Priority of interrupts on MC9S12G192

跳至解决方案
1,335 次查看
falchun
Contributor I

Hi all,

 

I am working on MC9S12G192 and I would like to change the priority of my interrupts. By reading the datasheet, I saw the priority level of each interrupts is depending on the address of the vectors interrupts. But I am not able to find how to change this address and keep the link with the initial interrupt...

Can you help me please?

Thanks in advance.

标签 (1)
标记 (3)
0 项奖励
回复
1 解答
917 次查看
kef2
Senior Contributor V

You can't. On S12XE you can change priority level of each interrupt. On older S12 you could rise priority of only one interrupt using HPRIO register. On S12G you have no option to change interrupt priority. But do you really need it? HPRIO didn't make a lot of sense, since it applies to quite rare case when two or more interrupts happen at (almost) exactly the same time. What if lower priority interrupt happens just a couple of bus cycles prior to your high priority interrupt? No magic, lower priority interrupt executes first without interruption. So what HPRIO is supposed to solve?

在原帖中查看解决方案

0 项奖励
回复
4 回复数
918 次查看
kef2
Senior Contributor V

You can't. On S12XE you can change priority level of each interrupt. On older S12 you could rise priority of only one interrupt using HPRIO register. On S12G you have no option to change interrupt priority. But do you really need it? HPRIO didn't make a lot of sense, since it applies to quite rare case when two or more interrupts happen at (almost) exactly the same time. What if lower priority interrupt happens just a couple of bus cycles prior to your high priority interrupt? No magic, lower priority interrupt executes first without interruption. So what HPRIO is supposed to solve?

0 项奖励
回复
917 次查看
falchun
Contributor I

Ok. Thanks Edward for your answer. I did not find, for my microcontroller, the HPRIO register you were talking about. But it's ok, I will do with it. Thanks again :smileywink:

0 项奖励
回复
917 次查看
kef2
Senior Contributor V

I meant you can't change priority of any interrupt in S12G. Older classic S12 families like S12A, S12D, S12C had HPRIO register. On S12G and S12P and other modern S12's you don't have even HPRIO.

917 次查看
RadekS
NXP Employee
NXP Employee

There is one older application note AN2617 A Software Piority Interrupt Scheme on HCS12 Microcontrollers

http://www.freescale.com/files/microcontrollers/doc/app_note/AN2617.pdf

http://www.freescale.com/webapp/sps/download/license.jsp?colCode=AN2617SW

Note: this application note was written for older S12 MCUs. Please take it only as inspiration.

0 项奖励
回复