Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
projects:pic32mx_obd_evaluation_board [2017/01/11 16:49]
admin [Commands]
projects:pic32mx_obd_evaluation_board [2019/08/20 18:33]
admin [PIC32MX OBD Evaluation Board]
Line 1: Line 1:
 ====== PIC32MX OBD Evaluation Board ====== ====== PIC32MX OBD Evaluation Board ======
-{{:​projects:​dsc_5593_800x536.jpg?​512 |}}+{{:​projects:​dsc_5593_800x536.jpg?​356 |}}
 ===== Requirements ===== ===== Requirements =====
 ===== Basics of communication protocol ===== ===== Basics of communication protocol =====
Line 92: Line 92:
   * low level communication with devices on I²C bus   * low level communication with devices on I²C bus
 ==== Commands ==== ==== Commands ====
 +^ c | calculate CRC checksum for given data |
 ^ C | configure communication parameters | ^ C | configure communication parameters |
 ^ d | get date and time | ^ d | get date and time |
Line 100: Line 101:
 ^ i | read data from I²C device | ^ i | read data from I²C device |
 ^ I | write data to I²C device | ^ I | write data to I²C device |
 +==== Calculating CRC checksum ====
 +<​code>​
 +Query
 +----------------------------------------------
 +| SOF | P | c | TYPE | P1..P4 | D1..DN | EOF |
 +----------------------------------------------
 +</​code>​
 +where
 +^ TYPE | 1b | s - 16-bit CRC-CCITT calculated by software (only P4 used); d - CRC calculated by DMA module |
 +^ P1 | 1b | 0 - input data not reflected (MSB first); ≠0 - input data reflected (LSB first) |
 +^ P2 | 1b | length of CRC polynom (1..32) |
 +^ P3 | 4b | CRC polynom |
 +^ P4 | 4b | CRC seed |
 +^ D1..DN | Nb | data in form of ASCII HEX |
 +<​code>​
 +Response
 +-------------------------------------------
 +| SOF | P | 00 | CRC | TIME | CHSUM | EOF |
 +-------------------------------------------
 +</​code>​
 +where
 +^ CRC | 4b | calculated CRC |
 +^ TIME | 2b | time in μs the calculation process took |
 +Error codes
 +^ N02 | Invalid parameters provided |
 ==== Configuring communication parameters ==== ==== Configuring communication parameters ====
 <​code>​ <​code>​
projects/pic32mx_obd_evaluation_board.txt · Last modified: 2019/08/20 18:33 by admin
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0