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.
已解决! 转到解答。
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?
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?
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.
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.