Smart test
Test SPC protocol decoding by oscilloscope
In many occasions, we often need to measure the angle and position with higher accuracy, such as the car's accelerator, throttle position, and steering torque sensing. As a result, SPC used to transmit the magnetic induction intensity came into being. Let's take a look at the content of this protocol.
SPC overview
The SPC (Short PWM Code) protocol is based on the enhanced version of the SENT (Single Edge Nibble Tranmission) protocol. Data transmission is achieved through the pulse between the falling edges of two adjacent cycles. Compared with analog output and PWM output, it has a good The EMC characteristic, has higher transmission speed, stronger reliability and anti-interference ability. This protocol is widely used in rotation angle measurement and position detection. Automotive applications include pedal, accelerator or gear lever position detection, suspension control or electric power steering system direct torque detection, etc.
The SPC protocol uses single-wire half-duplex transmission for data transmission, and up to 4 sensors can be controlled at the same time. Unlike SENT, SPC has a new trigger field, which can indicate three modes: synchronization mode, ID selection and range selection. The value of each field of SPC represents a four-bit value according to the time between two falling edges. The result obtained by dividing the falling edge time by a fixed value minus 12 is the value represented, and this fixed value becomes the unit Time (UT).
SPC frame format introduction
Figure 1 SPC frame format
Trigger field (master Trigger Pulse): sent by the host, the length is different depending on the mode.
Synchronization field (Sync frame): sent by the slave, which means that the slave starts to collect data.
Status field (status Nibble): indicates the current status of the slave. When the mode of the trigger field is ID selection or range selection, it also indicates the ID or current range value of the slave.
Data field (DataNibble): indicates the data collected by the slave. According to the settings of the slave, the number of data fields can range from 3 to 6. The data can include Hall value and temperature value.
Check field (CRC Nibble): Provide check value to check whether this frame is correct.
Example application
1. Decoding example
Simulate the SPC communication protocol to decode the data, as shown in Figure 2 below:
Figure 2 SPC decoding configuration parameters
As shown in the figure above, it is the configuration parameters required for SPC decoding, where the time slice width refers to the unit time set by the host. According to the nature of the data field of the frame, set the number of data fields, as shown in the following figure:
Figure 3 Meaning of the number of data fields
As shown in the figure above, when the number of data fields is 3 or 4, it means that the data only has Hall value. When the number is 5 or 6, the sensor will measure and transmit the temperature value in addition to the Hall value.
Figure 4 SPC decoding
Figure 5 SPC decoding
As shown in the figure above, this frame represents that the trigger field is range selection, and the selected range is 100mT, and the status field indicates that the current state of the sensor is Normal and the current magnetic flux range is 200mT.
to sum up
ZDS4054 Plus oscilloscope now supports SPC protocol decoding, which is more convenient to use. Hurry up and try it after upgrading the firmware. Click on the bottom to read the original text to jump to the link.