Verifying serial buses and components in embedded designs

Gregory Davis, Tektronix

July 1, 2012

Gregory Davis, Tektronix

Short Range data radio Communications
In this example, the mixed signal oscilloscope is used to confirm the correct packet transmission and the timing of each stage of a two-way radio communications system involving a PC communicating to a base station using RS-232 serial communications.

The base station then communicates to a remote unit using a proprietary radio protocol. RS-232 decode capability is used to look at the message sent from the PC to the base station and from the base station to the PC.

The oscilloscope’s analog and digital channels provide insight into the radio transmitted and received signals on both the base station and remote unit. The radio scheme used in this example is AM which allows for very simple circuitry on the remote side. The packet structure consists of eight bytes as follows:

* Header byte = 0x21 for commands (0x28 is used for long data packets not used in this example)

* Two serial number bytes = 0x0000 for the base station and any other value for remotes

* Command byte = 0x30 to 0x3F

* Two argument or data bytes = 0x0000 to 0xFFFF with the low byte first

* Two checksum bytes = the sum of the first 6 bytes with the low byte first

Figure 4 below shows the entire transaction from the RS-232 signal being sent to the base station at E1 to the return message at E2. The RS-232 signals are captured by two digital lines labeled Tx and Rx. The corresponding decoded information is displayed on the lines labeled RS-232(Tx) and RS-232(Rx). The yellow trace labeled BASE_TX_OUT is the analog transmitted signal. The blue trace labeled BASE_RSSI is the base station received analog signal.


Click on image to enlarge.

Figure 4. Capture showing the full communication cycle from the PC and back.

This signal’s digital version is captured by digital signal labeled BASE_RX_DATA. On the remote side, the purple signal labeled REMOTE_RSSI shows the analog version of the received signal, and the digital signal labeled REMOTE_RX_DATA is the digital version of this signal.

As can be seen from this capture, the entire transaction takes about 230 milliseconds for a full command packet and the return data. Note that the capture is triggered by the start bit of the return RS-232 signal to assure that the entire transaction is captured.

In Figure 5 below the capture is magnified to show the decoded version of the data transmitted from the PC to the base station. With this decode, it is easy to check the data to confirm that the correct packet is being sent, which is true in this case.

Note that the gray zoom window in the upper section of the screen shows the area being displayed in the magnified view. The decoded data shows that the packet is correctly formed with eight bytes. The first byte correctly reflects the command 0x21. Since this is the base station we expect the address to be 0x0000 which it is. The command 0x3A is the request for the battery voltage. Since this is a request, there is no argument so the bytes are zeros. The checksum of 0x5B is the correct sum of the previous bytes.


Click on image to enlarge.

Figure 5. Decode of the initial RS-232 from the PC.
The next step is to look at the base station transmitted data to ensure that the exact same pattern in both the analog (REMOTE_RSSI) and digital versions (REMOTE_RX_DATA) are being sent and then to evaluate the response from the remote and the length of the delay. In this case it’s only about 5 milliseconds after the receipt of the message from the remote.

In Figure 6 below, the decoded RS-232 message is shown, and can be used to confirm that the return data is what is expected. The decoded data showed that the packet is the proper length of eight bytes. The first byte was again the command header of 0x21.

The address was 0xFFFF which is a legitimate value. The command byte of 0x3A was echoed so that the base station can confirm that the response is due to the command sent and not a misread command. The data value returned was 0x12F which corresponds to 2.5 Volts, which is what was applied. The checksum was the correct sum of the first 6 bytes: 0x21 + 0xFF + 0xFF + 0x3A + 0x2F + 0x01 = 0x0289.


Click on image to enlarge.

Figure 6. Decode of returned message to the PC.

In this example, the oscilloscope’s RS-232 data decode feature provided a simple way to confirm the correct two-way communication of a radio system. The packets were correctly formed, the header and command values and checksums were correct, and the receiver response time was in the expected range.

< Previous
Page 3 of 4
Next >

Loading comments...

Most Commented

  • Currently no items

Parts Search Datasheets.com

KNOWLEDGE CENTER