Monday, February 13, 2017

[CAN] Determine the min. and max. of CAN signals

1. 16 bit, unsigned, resolution 10(scaling factor), offset 100

16bit = 0 ~ 2^16-1
0 * resoultion 10 = 0
1 * resolution 10 = 10
2 * 10 = 20
:     :  =   :
65535 * 10 = 65535

Besides, because the offset is 100, the minimum value becomes 0 + offset(100) and the maximum value becomes 65535 + offset(100)=65635.

2. 16 bit, unsigned, resolution 0.031, offset -230

0 ~ 65535 ( 2^16-1)
0 * 0.031 = 0
1 * 0.031 = 0.031
:      :    =  :
200 * 0.031 = 6.2
:      :    =  :
65535 * 0.031 = 2031.585

Therefore, the minimum is 0 + (-230) = -230, and the maximum is 2031.585 + (-230) = 1801.585.

3. 8 bit, signed, resolution 0.123, offset -1300

1 bit of 8 bit represents a sign of a number.
Therefore, signed 8 bit returns from -(2^7-1) to 2^7-1.
Minimum : -127 * 0.123 + (-1300) = -1315.62
Maximum : 127 * 0.123 + (-1300) = -1284.38



No comments:

Post a Comment