I am trying to enhance an existing CAN receive driver for our 570LS032 (soon to be 570LS042). We have msg obj 1 set for transmit and msg obj 2 set for receive. I have successfully experimented with the message acceptance feature, and now want to divide up our CAN receive traffic into 2 messages, which would be msg obj 2 and msg obj 3. I want to differentiate where the 2 types of messages are stored, so I need to see which received message invoked the interrupt. I may add further filtering in the future, so am looking for a way that doesn't add too much overhead.
- Experimentally, the interrupt register (DCAN INT) always reads zero whenever I get an interrupt. In addition, the latest manual (spnu517b) shows that this register only allows for 32 msg objects (1h-20h), even though there are provisions for up to 64 msg objects. The actual CAN data I read in is accurate.
- I am confused by the manual on how to set up DCAN INTMUX12 to have msg objs 2&3 drive DCAN1INT. Existing code for msg obj 2 only sets it to 0x0100. The manual implies a correlation of bit number set for msg obj, but why does it allow for 128 bits then if only 64 msg objs allowed? In theory, I should set 0x1100 for msg objs 2&3?
- Existing code sets up the automatic update DCAN IF3UPD12 register for msg obj 2 as 0x0010. This does not appear to be the same mapping as for the intmux register (unless the driver has an error). The manual is no help.
I have intentions of trying to further optimize this by experimenting with DMA if that is even possible, to eliminate as much CPU overhead as possible, but I need to get the interrupt working first. Thanks for any help.