Commit Graph

209 Commits

Author SHA1 Message Date
rusefillc 21cacf8c54 Overview Motorola vs. Intel-Format in Can-Frame
Some explanations of CAN byte order and bit numbering:

openxcplatform-bitnumbering

Mathworks-Side

CAN frame data is either in big endian or little endian byte format.

The bits are numbered by the file format either using MSB first (MSB0) or LSB first (LSB0).

With "consistent" format/numbering, bit numbering follows the byte format. MSB0 for big endian, LSB0 for little endian.

ietf-endianess

Usually the start bit referenced by the file formats reference the start of the signal data within the message independent of the endianess of the signal. With some formats (DBF), the startbit may always reference the LSB of the signal data.

Common formats:

KCD, SYM (consistent bit numbering)

little,LSB0
big,MSB0
DBC, ARXML (OSEK bit numbering)

little,LSB0
big,LSB0 (inconsistent)
DBF (startBit=LSB, startByte and startBit specified separately)

little,LSB0
big,LSB0,startBit=LSB (inconsistent)
Legacy canmatrix (yaml, json) (Note: internally canmatrix now uses consistent bit numbering)

little,LSB0
big,LSB0,startBit=LSB (inconsistent)
###First Example:

Frame with two 32-bit signals in motorola one can-frame

 7 6 5 4 3 2 1 0
0>msb-----
1  signal1
2
3       ----lsb>
4>msb-----
5  signal2
6
7       ----lsb>
DBC:

BO_ 291 newFrameMotorola: 8 Vector__XXX
 SG_ signal1 : 7|32@0- (1,0) [0|0] "" Vector__XXX  (most significant bit)
 SG_ signal2 : 39|32@0- (1,0) [0|0] "" Vector__XXX (most significant bit)
candb++ views:

signal1: 24 (least significant bit?)
signal2: 56 (least significant bit?)
Dbf:

byte 4 bit 0
byte 8 bit 0
###Second Example:

 7 6 5 4 3 2 1 0
0        >msb---
1---------lsb>
2
3
4
5
6
7
DBC:

startbit 3
length 11
candb++ views:

Startbit 9 (least significant bit?)
dbf:

length 11
byte 2 (counting starts with byte 1)
bit 1
##found docs about kcd "Least significant bit offset of the signal relative to the least significant bit of the messages data payload." least significant bit?

estimation about dbf
least significant bit?

new formulars from dmahurin
Note the basic operations used.

convert from lsb0 bit numbering to msb0 bit numbering (or msb0 to lsb0)
b = b - (b % 8) + 7 - (b % 8)

convert from lsbit of signal data to msbit of signal data, when bit numbering is msb0
b = b + 1 - length

convert from msbit of signal data to lsbit of signal data, when bit numbering is msb0
b = b + length - 1

So conversion from msbit in lsb0 bit numbering to msbit in lsb0 bit numbering is:

b = b - (b % 8) + 7 - (b % 8)

b = b + length - 1

b = b - (b % 8) + 7 - (b % 8)

byte order names
little endian == Intel == MOST-SIGNIFICANT-BYTE-LAST

big endian == Motorola == MOST-SIGNIFICANT-BYTE-FIRST
2024-11-06 21:54:49 -05:00
rusefillc fcf1119800 Overview Motorola vs. Intel-Format in Can-Frame
Some explanations of CAN byte order and bit numbering:

openxcplatform-bitnumbering

Mathworks-Side

CAN frame data is either in big endian or little endian byte format.

The bits are numbered by the file format either using MSB first (MSB0) or LSB first (LSB0).

With "consistent" format/numbering, bit numbering follows the byte format. MSB0 for big endian, LSB0 for little endian.

ietf-endianess

Usually the start bit referenced by the file formats reference the start of the signal data within the message independent of the endianess of the signal. With some formats (DBF), the startbit may always reference the LSB of the signal data.

Common formats:

KCD, SYM (consistent bit numbering)

little,LSB0
big,MSB0
DBC, ARXML (OSEK bit numbering)

little,LSB0
big,LSB0 (inconsistent)
DBF (startBit=LSB, startByte and startBit specified separately)

little,LSB0
big,LSB0,startBit=LSB (inconsistent)
Legacy canmatrix (yaml, json) (Note: internally canmatrix now uses consistent bit numbering)

little,LSB0
big,LSB0,startBit=LSB (inconsistent)
###First Example:

Frame with two 32-bit signals in motorola one can-frame

 7 6 5 4 3 2 1 0
0>msb-----
1  signal1
2
3       ----lsb>
4>msb-----
5  signal2
6
7       ----lsb>
DBC:

BO_ 291 newFrameMotorola: 8 Vector__XXX
 SG_ signal1 : 7|32@0- (1,0) [0|0] "" Vector__XXX  (most significant bit)
 SG_ signal2 : 39|32@0- (1,0) [0|0] "" Vector__XXX (most significant bit)
candb++ views:

signal1: 24 (least significant bit?)
signal2: 56 (least significant bit?)
Dbf:

byte 4 bit 0
byte 8 bit 0
###Second Example:

 7 6 5 4 3 2 1 0
0        >msb---
1---------lsb>
2
3
4
5
6
7
DBC:

startbit 3
length 11
candb++ views:

Startbit 9 (least significant bit?)
dbf:

length 11
byte 2 (counting starts with byte 1)
bit 1
##found docs about kcd "Least significant bit offset of the signal relative to the least significant bit of the messages data payload." least significant bit?

estimation about dbf
least significant bit?

new formulars from dmahurin
Note the basic operations used.

convert from lsb0 bit numbering to msb0 bit numbering (or msb0 to lsb0)
b = b - (b % 8) + 7 - (b % 8)

convert from lsbit of signal data to msbit of signal data, when bit numbering is msb0
b = b + 1 - length

convert from msbit of signal data to lsbit of signal data, when bit numbering is msb0
b = b + length - 1

So conversion from msbit in lsb0 bit numbering to msbit in lsb0 bit numbering is:

b = b - (b % 8) + 7 - (b % 8)

b = b + length - 1

b = b - (b % 8) + 7 - (b % 8)

byte order names
little endian == Intel == MOST-SIGNIFICANT-BYTE-LAST

big endian == Motorola == MOST-SIGNIFICANT-BYTE-FIRST
2024-11-06 21:51:05 -05:00
rusefillc c9580eaaf5 applyOrderForStartOffset 2024-11-06 18:38:20 -05:00
rusefillc d7cfa66425 AlwaysSameScanner 2024-11-05 22:29:54 -05:00
rusefillc 4e44fe5d98 some strange progress 2024-11-05 21:33:25 -05:00
rusefillc 0427ae0785 yFrom 2024-10-24 22:01:25 -04:00
rusefillc 1bcc179486
Update README.md 2024-10-24 11:55:00 -04:00
rusefillc d6222d1141 PinLine 2024-10-22 07:28:08 -04:00
rusefillc 53cf35734c PinoutTemplate 2024-10-22 06:41:37 -04:00
rusefillc cb253eda61 send-only proto as well 2024-10-16 22:45:03 -04:00
rusefillc d14ca16039 allowDuplicateNames 2024-10-16 22:44:42 -04:00
rusefillc 22e66be7cd timestamp scale bugfix 2024-09-22 21:21:13 -04:00
rusefillc 430ec5cd7a docs timestamp 2024-09-22 21:10:17 -04:00
rusefillc 5c89e92212 documentation 2024-09-22 20:55:58 -04:00
rusefillc 3010885aa0 dead 2024-09-22 20:54:54 -04:00
rusefillc cd4ffd6729 ByteRateOfChangeReports.filter 2024-09-12 19:28:58 -04:00
rusefillc 735ccbb04f upload-artifact@v4 2024-09-06 19:23:08 -04:00
rusefillc f3a84c7e72 smarter code 2024-09-06 19:17:03 -04:00
rusefillc e127cda824 hello September 2024 2024-09-04 23:42:20 -04:00
rusefillc c336245c02 C/C++ into _middle 2024-09-04 22:26:51 -04:00
rusefillc 609733c64a filter.rejectPacket 2024-07-25 21:37:38 -04:00
rusefillc 10700106f7 FirstPacket tool 2024-07-25 21:22:16 -04:00
rusefillc 6a63b31e11 WOW bugfix - wrong result when running multiple files! 2024-07-25 16:09:35 -04:00
rusefillc 1def6a7463 more readable report 2024-07-25 16:04:30 -04:00
rusefillc dcb6283620 ops dead code 2024-07-25 16:04:16 -04:00
rusefillc bd90ce8019 Let's use unique field names 2024-05-27 11:08:25 -04:00
rusefillc 2698a8fb30 bugfix? 2024-05-15 16:17:29 -04:00
rusefillc 63762e6900 things are a bit broken 2024-05-15 15:45:55 -04:00
rusefillc d249e28787 throw new IllegalArgumentException 2024-05-14 17:02:30 -04:00
rusefillc c6accaacb9 code style 2024-05-13 21:30:36 -04:00
rusEFI LLC cc3e6ebda6 GrowingValuesScanner 2024-04-27 22:23:17 -04:00
rusEFI LLC 432bfc156e GrowingValuesScanner 2024-04-27 21:54:35 -04:00
rusEFI LLC 1b2d1e7ab8 going a bit fancier 2024-04-27 20:48:42 -04:00
rusefi c00bf3378e usability 2024-04-15 10:41:40 -04:00
rusefi eb9726224b fresh gradle 2024-04-14 17:27:43 -04:00
rusefillc c92cb4ce1c NPE bugfix 2024-04-14 14:03:26 -04:00
rusefillc 6e5411ff86 PacketRatio 2024-04-10 18:36:17 -04:00
rusefillc 3501ac3b32 logging 2024-04-10 18:36:06 -04:00
rusefillc 8933621961 logging 2024-04-10 18:35:47 -04:00
rusefillc 4ff0333d1b better error handling 2024-03-23 12:20:33 -04:00
rusefillc ce7e635291 check for errors 2024-03-22 21:21:57 -04:00
rusefillc 00cc0c0a39 progress 2024-03-22 21:11:50 -04:00
rusefillc dc4ec93dc5 check for errors 2024-03-22 14:08:47 -04:00
rusefillc ba11705db0 filtered uses DBC 2024-03-22 12:01:05 -04:00
rusefillc e795581f6a ByteRateOfChangeReports shows relevant byte 2024-03-22 11:45:19 -04:00
rusefillc 6a04166862 new API & coverage 2024-03-16 19:56:54 -06:00
rusefillc 5f8e344c15 progress 2024-03-14 11:38:27 -06:00
rusefillc f6b5408bab using packet names from dbc 2024-03-02 20:44:35 -05:00
rusefillc 8f7dd55311 extracting DualSid 2024-02-24 17:46:46 -05:00
rusefillc dbdb57f191 nissan 2024-02-24 17:45:18 -05:00