Where to Start?

Thread Starter

bwilliams60

Joined Nov 18, 2012
1,450
Been a member of AAC for a while but first time in this section. So I do a lot of automotive work and I would like to know more about coding and how to understand what happens to sensor signals as they are processed and turned into languages. I see a lot of people able to read CAN BUS messages and I understand a little bit but want to learn more about it. Where do I start? Any good tutorials, books etc on getting started? Thanks in advance.
 

-live wire-

Joined Dec 22, 2017
959
Knowledge is Power -- Power Corrupts
...............Study Hard -- Be Evil

by zlynx
How much power can you get out of knowledge? And is it AC or DC? If DC, what's the ripple? What does the waveform look like? Could you measure it with a scope? I would like to know what I could power with knowledge.

Bwilliam, would you like to know more about the subject? Do you intend on modifying anything? Or did you just want to know out of curiosity?
-live wire-
 

WBahn

Joined Mar 31, 2012
32,834
Been a member of AAC for a while but first time in this section. So I do a lot of automotive work and I would like to know more about coding and how to understand what happens to sensor signals as they are processed and turned into languages. I see a lot of people able to read CAN BUS messages and I understand a little bit but want to learn more about it. Where do I start? Any good tutorials, books etc on getting started? Thanks in advance.
It's not so much that sensor signals are turned into languages, as that the meaning of a sensor signal is recognized based on a protocol.

For example, let's say that you used a deck of cards to relay information between you and others. You agree in advance that if you send them a King of Spades, that it means you are in need of water. But if you send them a Queen of Diamonds, in means that you need money and the next cards will be number cards (no face cards, but can be the Ace which is a 1) how much money with the the 10 being interpreted as a zero and this will continue until a black number card is reached.

So you send out the following sequence of cards: {QD, 2H, 3D, 10H, 5C}.

Someone sees this sequence and the print out "bwilliams needs $2305".

To know how to interpret the messages, you need to understand the protocol.

In the case of most protocols like CAN bus, there are a couple of layers. There's a set of signals that are part of the basic definition of the protocol and then there is usually a way to make arbitrary messages.

So if you are interested reading the information conveyed via a CAN bus system, then you probably want to start by studying the CAN bus. Wikipedia is as good a place to start as any:

https://en.wikipedia.org/wiki/CAN_bus
 

Thread Starter

bwilliams60

Joined Nov 18, 2012
1,450
Live wire, I am not sure where you are going with your question, but I suppose if I asked a question I would like to know more about it. As far as what I will do with that information, remains to be seen. Right now I would like to know just to be more informed. I may want to play with modules at home and see if I can make them do different things. Am I going to hack cars, certainly not. I am an eternal student. i just like to learn more about my trade and understand what is going on in my industry.
WBahn, great explanation of what is going on and it is as I understood it already. What I am wanting to understand is what the codes actually mean and how to decipher it. I know there are CAN BUS tools out there that will read code and guys that can take it and make it something else. I just want to know how they got to that level. Are they programmers? Do they know C+, JAVA, ......what do they need to know. What I know is that analog signals are converted to digital, all signals turned to binary and then information sent out serially on CAN BUS and then, that's where I get lost. I need to fill in the blanks between that point and what I read on a scan tool. How do I make an instrument cluster work from an Arduino etc etc.
 

Papabravo

Joined Feb 24, 2006
22,082
One simple model of information on a network is called "producer-consumer". There are network nodes that "produce" data and that is all they do. They never consume data, there is no concept of being able to interrogate them for anything. There or other nodes that "consume" some of the data on the network, they never "produce" anything. In particular they "consume" the data that is of interest to them. There are also some nodes that do both. A simple mechanism for a consumer to segregate the interesting data from everything else is called a "mask-and-match" filter. The "mask" is applied to a particular sub-field of a message to select the bits of interest. The masked bits in the message are then matched to a constant value. If there is a "match" the message is accepted and processed. If there is no match the message is discarded.

In a CAN network, this "identifier" or "tag" field is either 11 bits long for a standard frame or 29 bits long for an extended frame.

The way you get to where we are is to read, study, and implement.
 

Thread Starter

bwilliams60

Joined Nov 18, 2012
1,450
For the most part, i understand the CAN BUS and how it works as well as the information sent out over the CAN BUS. I understand the producer-consumer portion and how modules only use the portion of information that they need. What I don't understand is how binary numbers in that message get changed to a language. I am assuming that is done in the processor and if that is as far as I can go, I guess I am done. I would like to know though, is how do I hook a cluster up to an Arduino and simulate functions that a car would perform. Or how do I manipulate signals to a vehicle electrical system such as making a turn signal come on. I am interested in how the languages play out to tell things what to do and how to interpret that language.So for example, if I have a CAN BUS sniffer and it shows an address and a bunch of hex data, how do I interpret that data? I think I understand this more than I think I do. I am guessing the next step would be to learn how to read HEX data???
 

BobaMosfet

Joined Jul 1, 2009
2,211
Your question is valid, but you're expecting it to be more complicated than it is. It's bits. Just bits in a chain, that may then be interpreted as discrete clumps of bits forming higher level meanings (ASCII, opcodes, addresses, flags, etc). You won't find a book telling you how to read all the bit patterns in CANBUS, many are secret and proprietary to specific vendors, or used for different purposes via different vendors, so the same code would mean 2 or more things depending on the vendor.
 

Thread Starter

bwilliams60

Joined Nov 18, 2012
1,450
Hey Max, I have been looking at the ELM327 for a while now. I have it on my list of toys to buy and will probably pull the trigger on it shortly. So far, it makes the most sense to me.
BobaMosfet, I hear what you are saying. Perhaps someone can then tell me this because it is the one I see the most. Say I want to take an instrument cluster and run it on the test bench with an Arduino or something else (???). I need to be able to simulate the conditions on the vehicle to have the correct readings on my cluster. So lets say that engine coolant is run on CAN BUS or Class 2 data lines and it is at 100 degrees Celsius (because I'm Canadian) What do I need to do to simulate the data that the car would send without using an actual PCM from a car? I ask because I see this all the time. Then I see guys manipulating the data on the cluster to make it read something else. Some of this has to do with EEPROM reading but how do you know where to change to code? I am assuming that said object will have an address, and then you have to decipher the code from that address. Am I right?
 

Papabravo

Joined Feb 24, 2006
22,082
I cannot speak for all CAN networks, but the one I am most familiar with is DeviceNet, originally developed by Allen Bradley. In that network, every piece of data, in a particular node, was referenced by an "address" consisting of three parts. A device could be interrogated with an explicit message to get or set the value of a piece of data, by providing the three components of an addres called "class", "instance", and "attribute". The device would respond with a piece of data or an error message detailing why the request could not be satisfied. This is a long way from converting data to a language as I understand the common meaning of the terms. Data is just data after all.

In DeviceNet, other data was defined solely by the contents of the CAN ID field. It really was just that simple.
 

Thread Starter

bwilliams60

Joined Nov 18, 2012
1,450
PB, I think we have talked in the past and you seem to be well versed in CAN BUS. I am a little confused on the three components as I have not seen anything about this in my readings so thus is new to me. I think though that it would appear that I should center my studies around CAN BUS but still not sure on how to interact with it by reading and changing code. I think that is where I stall out.
 

Papabravo

Joined Feb 24, 2006
22,082
PB, I think we have talked in the past and you seem to be well versed in CAN BUS. I am a little confused on the three components as I have not seen anything about this in my readings so thus is new to me. I think though that it would appear that I should center my studies around CAN BUS but still not sure on how to interact with it by reading and changing code. I think that is where I stall out.
Based on your current level of experience you have asked a series of imprecise questions which are subject to wide interpretation. A forum post is hardly the correct place to answer such questions. As you read, study, and experiment your overall familiarity will lead you to ask more precise questions that are less subject to interpretation. I will say that the concepts were difficult for me to grasp initially and I had difficulties similar to yours. The solution is to keep digging.
 

Thread Starter

bwilliams60

Joined Nov 18, 2012
1,450
Thanks PB. I connected a lot of dots in the last 24 hours by doing exactly just that. I have done a lot of research on CAN BUS and I know what you mean by my questions. I know what I am trying to ask and I think my questions were ill worded in trying to get it out there. I believe in the end what I was looking for was a programming language to help me interpret tne data coming across the CAN BUS but I now realize it varies from manufacturer to manufacturer. There are a number of hackers out there that do exactly that and the podcast put the pieces in order for me. I will continue to research and play with CAN BUS but now I am inspired to go out and buy some more toys to do this with. Thank you for your help
 
Top