你好!请检查编译器手册下的“中断”部分,简单地说,如果你不能在26K22上启用中断优先级,那么你可以声明IRS是什么样的,或者你想使用什么样的名字来做中断例程。在ISR内部,你必须检查各种中断标志,看看哪个外设请求中断(更好的是:检查标志和使能,像这样:如果(PrI1BIT.TXIF和PIE1BIT.TXEY),因为你可能有一个外围设备不总是有它的中断启用和你想要的。只在这种情况下服务)如何使用中断优先级…编译器手册是你的朋友。
以上来自于百度翻译
以下为原文
Hi! Please check the compiler manual, under the section "interrupts"
to put it simply if you don't enable interrupt priorities on the 26k22 you declare the IRS as such
void interrupt introutine()
or whatever name you want to use for the interrupt routines. inside the ISR you will have to check the various interrupt flags to see which peripheral requested the interrupt (better yet: check both the flag and the enable, like this: if (PIR1bits.TXIF & PIE1bits.TXIE) as you may have that a peripheral don't always have its interrupt enabled and you want to service it only in such cases)
on how to use interrupt priorities... the compiler manual is your friend.
你好!请检查编译器手册下的“中断”部分,简单地说,如果你不能在26K22上启用中断优先级,那么你可以声明IRS是什么样的,或者你想使用什么样的名字来做中断例程。在ISR内部,你必须检查各种中断标志,看看哪个外设请求中断(更好的是:检查标志和使能,像这样:如果(PrI1BIT.TXIF和PIE1BIT.TXEY),因为你可能有一个外围设备不总是有它的中断启用和你想要的。只在这种情况下服务)如何使用中断优先级…编译器手册是你的朋友。
以上来自于百度翻译
以下为原文
Hi! Please check the compiler manual, under the section "interrupts"
to put it simply if you don't enable interrupt priorities on the 26k22 you declare the IRS as such
void interrupt introutine()
or whatever name you want to use for the interrupt routines. inside the ISR you will have to check the various interrupt flags to see which peripheral requested the interrupt (better yet: check both the flag and the enable, like this: if (PIR1bits.TXIF & PIE1bits.TXIE) as you may have that a peripheral don't always have its interrupt enabled and you want to service it only in such cases)
on how to use interrupt priorities... the compiler manual is your friend.
举报