Professional Documents
Culture Documents
Developers Conference
Taipei, Taiwan
CEC stands for Consumer Electronics Control. Its a one-wire bus (pin 13) that snakes through an HDMI system - allowing products to pass messages to one another. CEC runs at approx. 400Hz, so including flow control bits and idle timing requirements on the line, it can send approximately 30 bytes each second. Commands need to be very efficient.
In Europe, there was an analog predecessor to HDMI known as the SCART interface. Like HDMI, SCART carried audio and video signals through one cable. The SCART cable had a onewire bus for controlling a home theater system. This was branded as AV.link by Philips, among others. This bus supported one touch play, standby, etc.
Manufacturer
Panasonic
Todays HDMI systems are comprised of separate components (digital set top boxes, audio receivers/amps, a DVD player, etc.), which are not always easy to configure & operate. The general public has difficulty with the how/when/why to set up these devices in order to use them. The more devices, the more complex is the setup. CEC is a solution to this problem! CEC uses signal routing to allow devices to be configured across a system - rather than just point-topoint. Examples are one touch play and one touch record which greatly simplify the user experience.
CEC Messaging
CEC messages generally consist of two functional categories: Request asking another device(s) to take action or to give information (e.g. asking a device to play, go into standby, switch sources, or request a devices physical address). Informative status messages and messages describing where a devices is in a network (e.g. report physical address, report vendor ID). CEC messages can also be grouped in terms of the intended target device: Directed Message - sent to a single CEC device. Broadcast - sent to all devices in the CEC network. CEC messages can be up to 16 blocks total (including the header and opcode blocks). If they were longer, they would impede access to the CEC bus due to the speed of the bus. (Sending 16 blocks successfully takes about 0.4s). The shortest message that can be sent is the polling message, which is simply a start bit followed by a header block. Devices must respond to a message in 1 second or less, but the desired response time is 200 msec.
A CEC message block includes the 8 data bits as well as two extra bits: End of message set to 0 for every block except the final block of the message where it is set to 1.
CEC Frame
Start Bit
Header Block
CEC at Work
ALL
01 02 03 04 05 06
PLAYER1->TV
CEC
IMAGE VIEW ON ACTIVE SOURCE REQUEST ACTIVE SRC ACTIVE SOURCE REQUEST ACTIVE SRC ACTIVE SOURCE
PLAYER1->ALL CEC
DVD
AVR
DTV
DTV
ALL
AVR
ALL
DVD
Active Source (4F 82 11 00)
DVD
Game System
STB-DVR
ALL
DTV
Ch. 2 Ch. 3 Ch. 4
DTV Remote
DTV
ALL
02 03 04 05 06 07 08
PLAYER1->ALL CEC TV->TUNER TUNER->TV TV->TUNER TV->TUNER TUNER->TV TV->TUNER CEC CEC CEC CEC CEC CEC
DTV
DTV
DTV Remote
User Control Released (03 45 XX) Menu Request (Deactivate) (03 8D 01)
STB-DVR
03
DTV
Record Status [Recording Digital Service] (10 0A 02)
STB-DVR
DVD
02 03 04
DTV
Deck Status [Skip Forward] (40 1B 17)
DTV Remote
ALL
DTV
CEC Addressing
CEC Addressing
CEC assumes that all AV source products in a system are directly or indirectly connected to a root display (DTV). HDMI connections form an upside-down tree, with a display as the root, switches as branches, and various source products as leaf nodes. There are two types of addressing:
Logical Physical
Logical Addressing
Logical addressing is what CEC uses to identify a specific instance of a specific device type. When messages are sent over CEC, the logical address identifies both the sender (Initiator) and intended receiver (Follower) of the message. Logical addressing is done with nybbles (4-bit numbers, allowing for addresses from 0-15). Because of this, the header blocks are simply in to, from format the first four bits sent are the address of the initiator (or sender), while the latter four bits are the followers (receivers) address. CEC Header Block
Logical Address of Logical Address of End of Acknowledgment Initiator Follower Message
0 is a TV 1,2 & 9 are recorders (HDD, DVD, BD, etc.) 3,6,7 & 10 are tuner devices (i.e. set-top boxes) 4,8 & 11 are players (DVD, VCR, Blu-Ray, etc.) 5 is an audio system 12 & 13 are reserved 14 is a wild-card 15 means Unregistered if its the initiator address, Broadcast if its the follower address.
Physical Addressing
Physical addressing describes the topology, i.e. what devices are between the CEC device and the TV, and through what inputs it is connected. Physical addressing is a required feature for ALL HDMI devices (regardless of whether or not they support CEC), and is essential for routing control, among other things.
A TV (that does not have HDMI outputs) will use physical address [0.0.0.0]. Any device with an HDMI output will have an address that contains at least one non-zero number, which is grabbed from the HDMI vendor specific data block (VSDB) of the sink devices EDID. Devices with both a source and a sink must read the physical address from the EDID of the sink device that it is attached to, and configure its own EDIDs on its sink ports so that they contain the proper physical addresses.
PA 1000
DVD
Game System
STB-DVR
PA 1100
PA 1200
PA 1300
1100
UNREG->PLAYER1 CEC PLAYER1->*ALL* CEC UNREG->PLAYER1 CEC UNREG->PLAYER2 CEC PLAYER2->*ALL* CEC
Unregistered
DTV
LA 04 LA 1100
LA 04 08 PA 1200
DVD
STB-DVR
UNREG->PLAYER1 CEC UNREG->PLAYER2 CEC PLAYER2->ALL UNREG->TUNER TUNER->ALL UNREG->RECORD RECORD->ALL CEC CEC CEC CEC CEC
DTV DTV
DTV: PA 000 LA 0 AVR: PA 1000 LA 05 DVD: PA 1100 LA 04 Game System: PA 12 00 LA 08 STB-DVR: PA 1300 LA 03/LA 01
LA 08 PA 1200
LA 04 LA 1100
DVD
Physical Information
CEC is pin 13 on the HDMI cable. It shares a common ground with DDC. CEC idles in a high-impedance state (the line shows a voltage between +2.5 and +3.63V). During a message, the line will be pulled down to between 0 and +0.6V (low-impedance).
CEC supports nine devices on the bus simultaneously (potentially more if good cabling is used). The limitation is due to a network limit on capacitance of 7200pF (allowing for 100pF per device and 700pF per cable). However, there are only 15 valid CEC logical addresses, so having a limitation of nine devices would rarely be a problem in real-world applications. The CEC line is in use when there is a device pulling the line low. All timing is derived from the high to low transitions.
Start Bits
Logical 0 and 1
A device could be holding the CEC bus low when the initiator expects it high, causing a bus error. A device sends a message and does not receive the expected acknowledgement. A device loses arbitration (retry).
Retransmission should not occur if there is sufficient indication that the follower does not support the message being sent.
Directed messages
Intended for a single device ACK is set as a logical 1 Set to logical 0 by the follower to acknowledge
Broadcast messages
Intended for all devices ACK is set as a logical 1 Must be kept as a logical 1 by all devices A logical 0 is a NACK
Directed Message
Image View On (30 04)
DTV
01
00:00:11.01 00:00:18.41
00:00:00.00 00:00:06.20
TUNER->TV AUDIO->ALL
CEC CEC
CEC CEC
STB-DVR
02
DTV
high
low
0.6 ms Release bus to set Ack bit to 1 1.5 ms Release bus
DTV
STB-DVR
Broadcast Message
AVR
DTV
AVR
Do nothing to acknowledge
ALL
high low
0.6 ms
Directed Message
Image View On (30 04)
DTV
01
00:00:11.01 00:00:18.41
00:00:00.00 00:00:06.20
TUNER->TV AUDIO->ALL
CEC CEC
CEC CEC
UNACKNOWLEDGED UNACKNOWLEDGED
AVR
02
DTV
Do nothing to Nack
DTV
STB-DVR
Broadcast Message
AVR
DTV
STB-DVR
DTV
Release bus
Since CEC is a single wire for all devices, it is sometimes the case that two devices want to use the CEC line at the same time. Arbitration check begins with leading edge of start bit and continues to end of initiator address. Priority given to the device with the lowest logical address. The TV (logical address 0) has priority over all other devices. If a device is already using the CEC line, the devices that would like to use it must wait until signal free time has been met (the device has stopped using the line for a defined length of time).
At least 3 bit periods (7.2ms) in the case of a device trying to resend a message. At least 5 bit periods (12.0ms) for a new device wishing to send a message At least 7 bit periods (16.8ms) for the same device wishing to send a new message.
Signal free time is defined from the START of the final bit being sent (the high to low transition).
DTV
DVD
01 02 03 04 00:00:11.01 00:00:11.07 00:00:12.01 00:00:12.21 00:00:18.41 00:00:18.49 00:00:69.51 00:00:69.71 00:00:00.00 00:00:00.60 00:00:00.20 00:00:01.60 00:00:06.20 00:00:06.11 00:00:51.10 00:00:00.20 PLAYER1->TV TV->PLAYER1 PLAYER1->TV CEC CEC CEC CEC CEC CEC CEC CEC CEC CEC CEC ERROR GET MENU LANGUAGE IMAGE VIEW ON ACTIVE SOURCE UNACKNOWLEDGED RECORD TV SCREEN RECORD ON RECORD STATUS
PLAYER1->ALL CEC TV->RECORDER CEC TV->RECORDER CEC RECORDER->TV CEC TV->RECORDER CEC
05 06 07 08
DTV
STB-DVR
Record TV Screen Record TV Screen (01 0F)
DTV
AVR
Record Status [Recording Digital Service] (01 0A 02)
DVD
Game System
STB-DVR
Compliance testing
In-house using compliance test tools Plugfests (CEA and ETSI) HDMI Authorized Test Centers In-house Plugfests
CEC debug tools used during development CEC bus monitor CEC compliance test application (Quantum Data Test Management Environment is the recommended test tool in the HDMI CTS) Test fixtures
Quantum Data has prepared an educational whitepaper and a video on CEC that provides some further examples: http://www.quantumdata.com/
Thank You
Presenter: Neal Kendall Technical consultant: Jeff Stenhouse Animation & Graphics: Robert Watson