Hello all, I wish I could be more beneficial to the arduino community with my first post but unfortunately I come seeking for help.
Hardware:
Right now I am using a can bus shield from sparkfun to interface with my ecu (not OBD car ecu but an aftermarket unit like a MoTeC controller). Everything hardware wise works correctly as far as I know.
Then it just keeps on repeating message ID 14. I'm missing message ID 11 - 13. From my knowledge, the ecu is supposed to generate these messages in cycles (10 - 14, 10 - 14, etc...).
The messages that are received though have the correct data.
// (this is poor code as clearly if two messages are received then the second will overwrite the first)
At 1 Mbps, with intervening Serial writes, the sketch is very likely missing the other frames. As a test, I suggest you alter the sketch to scan for and print a specific message ID (like 11).
I've noticed that and I inserted a print function in between the 2 two read functions so the first message will not be over written. Unfortunately the scenario remains the same. I've noticed that both the message buffers (RXB0 and RXB1) contain the same message. I'm at a loss right now.
I've left the serial monitor running and copied the contents after running for a while. I did a ctrl-F and could not find any message IDs 10 - 13 :S.
If I take out the delay and I do an if statement so the serial output prints only when message ID 13 is in the buffer then it is able to get message 13.
For future reference, what you have to do is have the arduino intake data without delays and filter using if statements the data you want. I put the MCP2515 in listen only mode and disabled all the filters on it.
It appears adding delays during the buffer read cycles really screws up the data acquisition.