RE: Guaranteed Valid Messages
"John Dammeyer" <[email protected]> Mon, 4 May 2015 20:07:43 -0700
| Newsgroups | gmane.comp.hardware.bus.can |
|---|---|
| Message-ID | <[email protected]> |
Chuck, Dig deep into the CAN specification and you will find that the CRC used for CAN messages is robust but does not detect all errors. So there is a small likelihood that a message with more than two error bits could create a message that would pass the CRC and be received as a correctly formed message. It's unlikely you are having this issue. The next issue is more complicated. Remember how CAN works. Any single node receiving a message can overwrite the message with an error flag of 6 dominant bits if it detects an error. Again look closely at the CAN spec and there is a spot where the error could be missed which is why TOGGLE messages are not a really good idea. So again if the message is somehow improperly formed or damaged someone will catch it and everyone will see that error flag. Finally we're into the actual CAN device here. How might it fail? The state machine inside is pretty straight forward. The bus has to be idle for a specific number of bits. Any noise on the bus that doesn't meet the bit definition criteria restarts the bit counter for bus idle. Once the falling edge of the start bit is detected and it's still dominant at the sample point the state machines launch into their bit assembly and destuffing algorithm. This is where a FORM or STUFF error can be detected and later at the end of the message a CRC Error. As I understand it the interval after the ACK bit is when the CAN device checks to see if the message contained in the MAB matches the filters. If there was an error flag the message is always discarded. You'd never get a message that was damaged with an error flag since that doesn't tell you anything about the message other than now 6 or more dominant bits in a row. Perhaps what Microchip means is that if the Filters are set with values but the Rx bits are set to 11 then all messages are received irrespective of the filter and mask values. When set to 00 then both 11 and 29 bit IDs are received based on the filter and mask values. So your setting of 0b11 isn't really incorrect. Unless Microchip is passing something else through. Best thing to try would be to set the bits to 0b00 and set your masks to allow all messages. Ie. Filter bits are don't care. If you still see the same symptoms then you have a hardware problem. John Dammeyer From: [email protected] [mailto:[email protected]] On Behalf Of Chuck Hackett Sent: May-04-15 7:20 PM To: [email protected] Subject: [CANLIST] Guaranteed Valid Messages Just to be sure my understanding is correct . Assuming a CAN bus controller is correctly configured (e.g.: set to receive ONLY valid messages as in my previous post), there is no way that an invalid (i.e.: corrupt/damaged) message will be received . lost maybe, but NEVER corrupt . regardless of bus disturbances, excessive length, too many loads, etc. If an invalid message is received it must have been invalid when it was given to the sending CAN controller. True? Cheers, Chuck Hackett "Sometimes it is the people that no one imagines anything of who do the things that no one can imagine ." 7.5" gauge Union Pacific Northern (4-8-4) 844 http://www.whitetrout.net/Chuck -- Archives and useful links: http://groups.yahoo.com/group/CANbus Subscribe and unsubscribe at www.vector.com/canlist/ Report any problems to <[email protected]>