Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

CAN Bus Blog Series (shameless self promotion)

Highlighted

CAN Bus Blog Series (shameless self promotion)

Hey all, so I've been working on a blog series that I think I'm done with for now.  It is a 9 part series on various CAN stuff.  I hope that in the future when questions come up on the forums about CAN hardware, I can point people to read Part 1, or when there are discussions on how to read and write CAN data to files I'll link to Part 7.

 

I'd recommend anyone interested in learning about CAN to skim through it or read up on areas you're interested in.  There are several examples, and code in the form of VIPM packages.  The overview and downloads can be found at the main landing page here.  Comments and questions are of course welcome.


Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
Interesting in learning all you can about automotive CAN bus communicatin? Checkout my 9 part CAN Blog series.

Message 1 of 4
(199 Views)

Re: CAN Bus Blog Series (shameless self promotion)

Great job!

Many thanks for sharing.

0 Kudos
Message 2 of 4
(163 Views)

Re: CAN Bus Blog Series (shameless self promotion)

Like anything else, it is always easier to critique someone else's work than create our own.

 

With that being said, let me dive into it some.  It is a very comprehensive view from the 10,000 foot hierarchical level.  It misses much of the underlying information that people would view with a scope or need in order to hardware configure their own CAN network.  (Yes, I understand that many of the scopes today can actually decode the bits and produce the CAN Frame information)

  • Hardware Addressing (DTO, CRO, Slave Address)
  • Byte Order (Big or little endian)
  • Baudrate/Sampling of bits (85% = BTR0/BTR1)
  • DBC, A2L, and other basis files
  • Bits (Dominant and Recessive)
  • Typical CAN frame (bit-by-bit breakdown)
  • built up from CAN primitives (Upload, Set MTA,...)
  • Software Updating (Bootloader, Flash Kernels, Application)
  • Others (Catch all for anything that I might have passed over) Smiley Wink

Perhaps you could add some Appendices that show all of this from the ground-up or extend Part 1. 

Thanks for putting this together.

0 Kudos
Message 3 of 4
(138 Views)

Re: CAN Bus Blog Series (shameless self promotion)

Hey no worries I'm open to criticism.  Let me address some of your comments.

 


Minions wrote:

 

It misses much of the underlying information that people would view with a scope or need in order to hardware configure their own CAN network.  (Yes, I understand that many of the scopes today can actually decode the bits and produce the CAN Frame information)


I intentionally don't go into the bit's of what is being sent and in Part 2 mention this by basically stating we aren't going into it and a frame is the smallest amount of data being discussed.  Maybe it would be best to link to the wiki article on a CAN frame.

 

This frame contains multiple components of various data types.  At the low level a frame does get transmitted as a series of bits on the bus, which can be viewed with a scope.  But when we are discussing what is sent and received in CAN, the lowest level we will discuss is a frame which is between 41 and 113 bits of data.

DTO, CRO, Slave Address - In Part 8 I do mention DTO and CRO as the request and reply IDs used in ISO 15765.  From that point I on just refer to it as the request and reply frames.  I think this is easier to identify in a natural discussion where at least for me I have to keep looking up which direction DTO and CRO is, but stating "The request frame" is easier to identify the direction.

 

Byte Order - Yeah never went into this, but I do mention in Part 5 how signals are made up of things defined in a data base which include offset, scale, etc.  I do mentioned Byte Order here but don't talk about what it means.

 

Baudrate/Sampling of bits - Might be good to add, but again I defer that the frame is the smallest amount of data discussed, which happens after this sampling process.  It could be added maybe in a new post that covers sampling, scope, and bit packing.

 

DBC, A2L - I do mention DBCs in both Part 5 where I have a section on it, and in Part 6 where we talk about XNet Databases.  A2L's aren't mentioned because I don't have a post on XCP/CCP, but I would like to have that one day.  I don't mention CDDs, which I probably should since I talk about diagnostic CAN stuff in Part 8.

 

Bits (Dominant and Recessive) - I do talk about message priority in Part 2, but again not at the bit level.  The more I type this up the more I think a new part for that should be added.

 

Typical CAN frame (bit-by-bit breakdown) - Yup again it was intentional, but could be a new part.

 

Built up from CAN primitives (Upload, Set MTA,...) - Again I don't have a part discussing XCP/CCP but if I do this will be mentioned.

 

Software Updating (Bootloader, Flash Kernels, Application) - I do have a draft of a post discussion CAN flashing.  But at the moment it only covers ISO 15765 diagnostic flashing, since this builds on Part 8.  My intent was to one day post on XCP/CCP, and then make a single post on flashing which covers the two common types of CAN flash.

 

So future parts which I don't see doing for several months could be:

 

Part 10 - Low Level CAN, talking about the bits that go into a frame, sampling techniques, baud rates, what the signals look like on a scope.

 

Part 11 - XCP/CCP, talking about how this works, along with the various common request functions.  This will likely be another VIPM package just like how there is an ISO 15765 package.

 

Part 12 - CAN Flashing, talking about the two common methods of flashing with XCP/CCP, and diagnostic CAN.  This again would come with one example of each, both using the S rec and Hex file function mentioned in Part 7.

 

Part 13 - Running Code on XNet hardware, which is an undocumented feature of the hardware, which NI said I can talk about with locked block diagrams demonstrating CRC and counter functionality.


Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
Interesting in learning all you can about automotive CAN bus communicatin? Checkout my 9 part CAN Blog series.

0 Kudos
Message 4 of 4
(131 Views)