| Electronic Components Datasheet Search |
|
ELM327P Datasheet(PDF) 31 Page - ELM Electronics |
|
|
|||||||||||||||||||||||||||||
ELM327P Datasheet(HTML) 31 Page - ELM Electronics |
|
31 / 51 page ![]() CAN Messages and Filtering The ELM327 monitoring commands (AT MA, MR and MT) usually work very well with the ‘slower’ protocols – J1850, ISO 9141 and ISO 14230. The CAN systems are a different story, however, as they often have an order of magnitude more information passing over them. The relatively small 256 byte buffer that the ELM327 uses for sending can quickly fill up when data is arriving at 500 Kbps and leaving at 38.4 Kbps, or even 115.2 Kbps. To help reduce the amount of information seen by the ELM327, the internal CAN module has a ‘filter’ that can be used to pass only messages with specific ID bits. A range of values can be passed when the filter is used with what is called a ‘mask’ to say which bits are relevant. As an example, consider an application where you are trying to monitor for 29 bit CAN diagnostic messages, exactly like the ELM327 does. By definition, these messages will be sent to the scan tool at address F1. From ISO 15765-4, you know then that the ID portion of the reply must be of the form: 18 DA F1 xx where xx is the address of the module that is sending the message. To use the filter, then, enter what you have into it, putting anything in for the unknown portion (you will see why in a moment). The command to set the CAN filter is AT CF… >AT CF 18 DA F1 00 How, you ask, do you tell the ELM327 to ignore those last two 0’s? You do that with the mask. The mask is a set of bits that tell the ELM327 which bits in the filter are relevant. If the mask bit is 1, that filter bit is relevant, and is required to match. If it is 0, then that filter bit will be ignored. All bits in the above message are relevant, except those of the last two digits. To set the mask for this example then, you would need to use the CAN Mask command, as follows: >AT CM 1F FF FF 00 If desired, you can convert the hexadecimal to binary to see what has been done. The 11 bit CAN IDs are treated in the same manner. Recall that they are stored internally in the right-most 11 bits of the locations used for 29 bit CAN, which must be considered when creating a filter or mask. As an example, assume that we wish to display all messages that have a 6 as the first digit of the 11 31 of 51 ELM327 ELM327DSC Elm Electronics – Circuits for the Hobbyist www.elmelectronics.com bit ID. We need to set a filter to look for 6 in that digit: >AT CF 00 00 06 00 The 11 bit ID is stored in the last three locations, so the 6 would appear where it is shown. Now, to make that digit relevant, we create the mask: >AT CM 00 00 0F 00 The system only uses the 11 right-most bits in this case, so we can be lazy and enter the F as shown (the first bit of the F will be ignored, and it will be treated as if we had entered a 7). Clearly, this can be quite cumbersome if using 11 bit CAN systems routinely. To help with that, the ELM327 offers some shorter versions of the CF and CM commands. To use them for the example above, you need only enter three digit arguments: >AT CF 600 and >AT CM F00 As for the full eight digit versions, only the 11 least significant (right-most) digits are actually used, so you do not need to take special care with the first bit. With a little practice, these commands are fairly easy to master. Initially, try entering the filter and mask values, then use a command such as AT MA to see what the results are. The ELM327 knows that you are trying to filter, and combines the effects of both commands (it will do that for MR and MT as well). The MA, MR and MT commands all have the extra benefit that while they are in effect, the ELM327 will remain quiet, not sending acknowledgement or error signals, so anything you do while monitoring should not disrupt other devices that are on the bus. Note that if a filter has been set, it will be used for all CAN messages. Setting filters and masks may cause standard OBD requests to be ignored though, and you may begin seeing “NO DATA” responses. If this happens, and you are unsure of why, you may want to reset everything to their default values (AT D) and start over. |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |