Hello,
I am having difficulty in implementing CAN mailbox timeout interrupts. The timeout interrupt is occurring, but it is not occurring on the correct CAN Interrupt line (As specified by CANGIM). It is supposed to be occurring on CAN Interrupt Line 0, but it is occurring on Interrupt Line 1. Also, when the Timeout occurs, it only happens for a number of times (40 to 70) and then it stops happening altogether.
Furthermore, I am not able to clear the Timeout flags.
For my test, I don't have anything connected to the CAN bus.
Below is a table showing the debugger output after ECanb is initialize.
What am I missing?
Does anyone have any example code that shows how to implement CAN Mailbox Timeouts Interrupts?
Stephen
| CANME | 0xFFC00000 | eCAN Mailbox Enable [Memory Mapped] | Mailboxes 22 through 31 are enabled |
| CANMD | 0xFE000000 | eCAN Mailbox Direction [Memory Mapped] | Mailboxes 25 through 31 are Rx, Mailboxes 22 through 24 are Tx |
| CANTRS | 0x00000000 | eCAN Transmission Request Set [Memory Mapped] | |
| CANTRR | 0x00000000 | eCAN Transmission Request Reset [Memory Mapped] | |
| CANTA | 0x00000000 | eCAN Transmission Acknowledge [Memory Mapped] | |
| CANAA | 0x00000000 | eCAN Abort Acknowledge [Memory Mapped] | |
| CANRMP | 0x00000000 | eCAN Received Message Pending [Memory Mapped] | |
| CANRML | 0x00000000 | eCAN Received Message Lost [Memory Mapped] | |
| CANRFP | 0x00000000 | eCAN Received Frame Pending [Memory Mapped] | |
| CANGAM | 0x80000000 | eCAN Global Acceptance Mask [Memory Mapped] | |
| CANMC | 0x00002080 | eCAN Master Control [Memory Mapped] | Auto bus on,The MSB of the time stamp counter is reset to 0 |
| CANBTC | 0x000900CB | eCAN Bit-Timing Configuration [Memory Mapped] | 500k Baud |
| CANES | 0x00000020 | eCAN Error and Status [Memory Mapped] | Suspend mode acknowledge (because of debugger) |
| CANTEC | 0x00000000 | eCAN Transmit Error Counter [Memory Mapped] | |
| CANREC | 0x00000000 | eCAN Receive Error Counter [Memory Mapped] | |
| CANGIF0 | 0x00000000 | eCAN Global Interrupt Flag 0 [Memory Mapped] | |
| CANGIM | 0x00020003 | eCAN Global Interrupt Mask [Memory Mapped] | Both Interrupt Line 1 and 2 are used for interrupts, All global interrupts are mapped to the ECAN0INT interrupt line and Timeout Interrupt Enabled |
| CANGIF1 | 0x00000000 | eCAN Global Interrupt Flag 1 [Memory Mapped] | |
| CANMIM | 0xFE000000 | eCAN Mailbox Interrupt Mask [Memory Mapped] | Mailbox Interrupt Enabled for all Rx Mailboxes |
| CANMIL | 0xFE000000 | eCAN Mailbox Interrupt Level [Memory Mapped] | Rx Mailbox interrupts on CAN interrupt Line 1 |
| CANOPC | 0x00000000 | eCAN Overwrite Protection Control [Memory Mapped] | |
| CANTIOC | 0x00000009 | eCAN TX I/O Control [Memory Mapped] | CAN Transmit Pin Enabled |
| CANRIOC | 0x00000009 | eCAN RX I/O Control [Memory Mapped] | CAN Receive Pin Enabled |
| CANTSC | 0x00000022 | eCAN Time Stamp Counter [Memory Mapped] | |
| CANTOC | 0x02000000 | eCAN Time-Out Control [Memory Mapped] | Timeout Mailbox Interrupt Enabled for Mailbox 25 |
