Hi,
I am currently working on making CAN communication on my TM4C1290NCZAD as reliable and robust as possible.
While testing many scenarios I noticed that controller gets flooded with ewarn and epass related interrupts if I disconnect the CAN cable or set incorrect baud rate. Depending on situation interrupts are arriving every 100-300uS. I am always reading CANINT register and CANSTS reg or adequate message object in my ISR, so interrupt gets cleared every time.
While this flooding is not a tragedy, it is putting some unnecessary load on the CPU. Hence, I would like to ask if there is way to minimise this effect?
Ideally, I would like to be able to receive an interrupt only if something changes. e.g. ewarn or epass bit is set or goes away. Being interrupted every time just to see that situation has not changed since last interrupt does not seem necessary in my application.
So far I was not able to come up with nice way of handling this problem. I know I can mask interrupts for some time and then enable them again to see if something has changed but that does not seem to be a good solution as it introduces unnecessary delays.
Is there a more elegant way ?
I will greatly appreciate your help.
Thank you,
Peter A.