Home > Simulation of the ECU (Master) > Definition of the ECU mode parameter > Definition of the connected sensor signal > Parameter of a sensor signal > Assignment of the signal
Signals are assigned by the assignment of the according CS line (parameter CS_Number), and identified within the sensor by the parameter Decoder_Mask and Decoder_Value.
CS line: | Bit decoded selection: | Input value parameter CS_Number: |
CS0 | 0001 | 1 |
CS1 | 0010 | 2 |
CS2 | 0100 | 4 |
CS3 | 1000 | 8 |
Parameter
CS_Decoder_Mask:
Presents the mask of the data frame of the MOSI line in which the significant
commands data will be sent.
This value is sensor specified and have no standard, so it have to
get from the sensor data sheet of the manufacturer.
Example:
2 connected sensors.
Sensor 1 supports a x- and a y-signal and is connected to CS line 0.
Sensor 2 supports a z-signal and a temperature signal and is connected
to the CS line 1.
The data frame of the both sensors
has 16 bit (sensor data sheet of the manufacturer)
(Picture: data sheet section of the
manufacturer)
From the data sheet we get that the read command of the master has
a length of 8 bit.
The first 6 bit (A5:A0) contain the read command, the 2 further bits
(RB/W and (aPAR) contain the status and the error detection bit.
Further more the data sheet of the sensor delivers the detailed read
command of the x-signal.
Getting the MSB value of x-signal is carried out by the read
command 15xx (0001 0101 xxxx xxxx), and the LSB value by 10xx (0001
0000 xxxx xxxx).
With the parameter DecoderMask
= ff00
according to 1111 1111 xxxx
xxxx defines, that the first 8 bit of the read command are masked,
that means are relevant. The
1 means, that the bit is used for the
command, but not present the value of the command. The value is defined
with the parameter DecoderValue.
Y-signal of the sensor 1 and z-signal and temperature signal of the
sensor 2 accords to the same systematic.
Read the y-signal by the command 19xx
and 1Cxx.
Read the z-signal by the command 20xx
and 25xx,
read the temperature signal by the
command 49xx.
Decoder_Mask for y-signal = ff00
Decoder_Mask for z-signal = ff00
Decoder Mask for temperature sgnal ff00
Parameter Decoder_Value:
Defines the command value for reading the according signals.
As mentioned we have to get from the data sheet of the manufacturer,
that
the read command of the x-signal is 15xx,
the read command of the y-signal is 1Cxx.
That means that the parameter Decoder
Value = 1500.
For the definition of the y-signal Decoder
Value = 1C00.
The sensor 2 has the Decoder Value
= 2500 for the z-signal and
Decoder Value = 4900 for the
temperature signal.
Overview of the example:
Sensor 1 | Sensor 2 | Parameter
CS_Number Selection of sensors1 (CS0) and sensor 2 (CS1) |
Parameter
Decoder Mask Which bits are used for the command. |
Parameter
Decoder Value Which data values are used for the command. |
x signal | 0 | 0xff00 | 0x1500 | |
Y-signal | 0 | 0xff00 | 0x1c00 | |
z-signal | 1 | 0xff00 | 0x2500 | |
temperature signal | 1 | 0xff00 | 0x4900 |