FlexCAN Interrupt/Polling

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FlexCAN Interrupt/Polling

Jump to solution
819 Views
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 Kudos
Reply
1 Solution
762 Views
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

View solution in original post

0 Kudos
Reply
3 Replies
774 Views
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 Kudos
Reply
768 Views
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 Kudos
Reply
763 Views
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 Kudos
Reply