
As there are more and more audio and video equipment in the home, the number of remote controls is gradually increasing, and each switch is a big project. In order to solve this problem, the HDMI Association developed CEC technology, which can use a single remote control to control multiple devices, greatly simplifying the operation method and improving the user experience.

How to remotely connect products with HDMI CEC function?
CEC entity/logical location allocation
In real society, if we want to ask distant friends to help us with something, we usually communicate through emails or phone calls. Such a process will require two important parameters, one is the friend's email address or phone number, and the other is the correct instructions.
Similarly, in order for the Follower to operate normally, the Initiator, in addition to sending the correct instructions, also needs to be sent to the correct Follower location. A CEC device will have both a physical location and a logical location. The physical location refers to the node location of the device in the connection tree, and the logical location reflects the product type of the device. Since each consumer connects to the product in a different way, neither the physical location nor the logical location can be fixed and need to be adjusted with different connection methods to ensure that the initiator can send messages to the correct device in all situations.
The allocation of physical locations is achieved through DDC lines and Sink EDID.
Generally speaking, the TV will be the end device of the entire CEC connection tree, which is called CEC Root Device. Its physical location is four codes and fixed at 0.0.0.0. So how do other connecting devices obtain their physical locations regularly?
Taking Figure 4 as an example, assuming there is an AV device connected to the TV input 2, the device will use the DDC line to read the EDID of the TV input 2, and set the read physical position value 2.0.0.0 in the VSDB to its own physical position. If the AV device has an input, it will generate a new physical position by adding the input number to its own physical position 2.0.0.0 and put it into the EDID of the corresponding input. Therefore, when the DVD player is connected to input 1 of the AV device, the physical location obtained will be 2.1.0.0. If you continue to expand the device tree in this way, theoretically CEC devices can form up to a five-level connection network, with each level having a maximum of 15 devices. It is worth noting that in actual applications, it is impossible to connect more than 15 devices. This is because too many devices will cause excessive capacitive load on the line and affect the quality of the transmission signal.

Figure 4 Physical location allocation diagram (Data source: HDMI Spec 1.4b)
In addition to the physical location, each CEC device will also obtain an exclusive logical location to reflect the product type of the device (Table 3). For example, the corresponding logical location for TV is 0, and the logical location available for set-top boxes is one of 3, 6, 7, and 10. Careful readers may have a question, if there are multiple devices with repeated functions connected to the network, how to allocate logical locations? The logical location allocation of duplicate devices will be implemented through the Polling message in CEC. Polling message refers to a message with only Header Block (Figure 5), in which the logical positions of Initiator and Destination are the same, and the EOM bit is set to 1. Next, take the example of daily life applications to see how logical positions are allocated when consumers connect TV game consoles such as PS5 and Xbox to TVs.

Table 3 HDMI CEC device logical locations (Data source: HDMI Spec 1.4b)

Figure 5 Polling message structure (Data source: HDMI Spec 1.4b)
CEC-enabled HDMI device connection logic application
When the consumer connects all devices, the TV will send a Polling message (logical position 0 -> logical position 0). Since no other device responds to ACK at this time, the TV will obtain the logical position 0. Then in chronological order, assuming the first one connected to the TV is the PS5 game device, it will send a Polling message (logical position 4 -> logical position 4). Since no other device responds to ACK, PS5 will obtain logical position 4. The Xbox that is connected to the TV at the latest will also try to send the Polling message (logical position 4 -> logical position 4) first, but the PS5 has already occupied the logical position at this time, so the PS5 will reply ACK to this message, indicating successful reception. Because logical position 4 is already occupied, Xbox will try to send the next Polling message (logical position 8 -> logical position 8). At this time, if no other device responds to ACK, Xbox will obtain logical position 8.
In summary, whenever a CEC device is connected or disconnected, the device will automatically assign physical and logical locations according to the above process, forming a new device connection network.
Stable communication mechanism of CEC architecture
The following two methods are used in the CEC architecture to provide stable information transmission:
(1) Retransmission: After the Initiator transmits the CEC message, if the Follower does not respond with ACK or the Follower pulls the CEC line voltage low at the wrong time, this means that the transmission message is incorrect or the Follower is too late to process the message. Therefore, the specification allows the Initiator to try to transmit the same message again, up to 5 times.
(2) Arbitration: Since only a single Initiator is allowed to transmit messages on the CEC line, in order to avoid output abnormalities caused by multiple Initiators transmitting signals at the same time, CEC defines a Signal free time (Table 4). The Initiator needs to wait for the Signal free time to pass before transmitting messages. As can be seen from Figure 9, the Signal free time required for Initiator transmission is the shortest, which means that the arbitration priority is the highest and there is a higher chance of successfully transmitting the message.

Table 4 Signal free time (Source: HDMI Spec 1.4b)
HDMI CEC improves user experience and test laboratory ensures normal operation
The unique CEC function of the HDMI interface allows consumers to simplify the operation of audio and video equipment, bringing a better user experience and reducing annoying and complicated operations in life. In order to ensure that the audio-visual equipment purchased by consumers that supports CEC has normal functions, the equipment should be sent to a third-party certification testing laboratory for testing before being put on the market, and should pass the relevant CEC certification test in accordance with HDMI specifications. This article introduces the basic electrical properties and protocol layer specifications of CEC, hoping to help readers understand the operating principles of CEC, grasp product specifications more clearly, and successfully pass the certification test.