Hi,
I've been working on driver code for the TCAN4550 and have successfully been able to send and receive data packets on the CAN bus (as verified by a CAN to USB tool).
Receiving data so far has been done by polling the m_can interrupt register(0x1050) for the RF0N/RF1N flag bit.
The problem that I have happens when I try to use the nINT interrupt pin instead of polling for data. When data is sent or received, I always get an interrupt from the nINT pin, and when I read the interrupt status register(0x820) I always get the value 0x4A0 which are the flags CANSLNT, CANERR, GLOBALERR. I have tried to set the SWE_DIS bit and disable the watchdog from the status register(0x0800) but I still continue to get CANSLNT interrupts.
A few observations:
1. When receiving CANSLNT interrupts, the m_can_int bit in the same register(0x820) is never set even though the RF0N/RF1N bit in the m_can interrupt register(0x1050) has changed.
2. The CANSLNT interrupt triggers BOTH after sending out a TX packet and receiving a Rx packet. Clearing the interrupt does not help with the problem, the interrupt still triggers the next time data is received.
3. If I disable the CANSLNT interrupt, I do not get interrupts at all when data is received. I verified that the data is still received into the Rx FIFO correctly with no m_can errors set.
4. A few register states that may be of interest: (every time interrupt registers are read, they are cleared)
- After initialization, before sending out data:
address 0x0800: 0x00000000
address 0x1044: 0x0000070F
address 0x1050: 0x00000000
- After sending out data (this is the state after interrupt is triggered)
address 0x0800: 0x0000040A
address 0x1044: 0x00000708
address 0x1050: 0x00011000
- After receiving data (this is the state after interrupt is triggered)
address 0x0800: 0x0000040A
address 0x1044: 0x00000708
address 0x1050: 0x00010001
How do I go about avoiding these CANSLNT interrupts? Are there any settings that have to be configured that I missed?
Thanks in advance!