FlexCAN Interrupt/Polling

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

FlexCAN Interrupt/Polling

跳至解决方案
1,009 次查看
Noobie
Contributor I

Hello,

I'm using MPC5777C controller.

How can I configure flexCAN Rx to polling method and Tx to interrupt method.
What are the registers I've to configure for this ?

Thanks in advance.

0 项奖励
回复
1 解答
952 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

yes, some of interrupt sources are ORed together for single interrupt vector, but still those interrupt requests are masked by bits in IMASK registers. So if you set bits 0 and 1 in IMASK2 register (which correspond to MB62 and MB63) then interrupt will be called after message are transmitted from MB62 and MB63 only. Within interrupt clear just MB62 and MB63 flags.

BR, Petr

在原帖中查看解决方案

0 项奖励
回复
3 回复数
964 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

each MB has has respective flag and mask interrupt bit in IFLAGn and IMASKn register. MB's flag is set upon successful message transmission or reception. If respective MB's mask bit is set then interrupt request is generated to the core. So for pooling keep mask bit cleared and for interrupt method set mask bit for respective MB.

BR, Petr

0 项奖励
回复
958 次查看
Noobie
Contributor I

Hi @PetrS 
 

Thank you for your response.

The below attached snap is from data-sheet. The vector table shows different interrupt vector for MB 0 - MB 16.  But shared between MB16 to MB31 and MB32 to MB63.

Noobie_0-1687168525216.png

In my configuration I'm trying to configure only the MB62 and MB63 for Tx. whereas MB0 to MB61 for Rx.
I want ISR to be invoked only for MB62 and MB63(For Tx only), But with this configuration my ISR function is invoked because of Rx, when messages are received at MB32 to MB61.

How can I fix this issue ?

 

0 项奖励
回复
953 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

yes, some of interrupt sources are ORed together for single interrupt vector, but still those interrupt requests are masked by bits in IMASK registers. So if you set bits 0 and 1 in IMASK2 register (which correspond to MB62 and MB63) then interrupt will be called after message are transmitted from MB62 and MB63 only. Within interrupt clear just MB62 and MB63 flags.

BR, Petr

0 项奖励
回复