2 An Introduction to Consumer Electronics Control (CEC) Quantum Data, Inc.
3 What is CEC? – Quick Facts CEC stands for Consumer Electronics Control.It’s 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.
4 CEC: A Bit of HistoryIn 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 one-wire 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.
5 How To Find CEC Devices CEC is available in many HDMI products today! Limited multi-vendor interoperability.ManufacturerNamePanasonicEZSync / HDAVI Control (USA), Viera Link (Japan)SonyBravia Theater Sync (USA), Bravia Link (Japan)SharpAQUOS FamiLinkToshibaCE-Link (USA), Regza Link (Japan)SamsungAnyNet+LGSimpLink
6 What is the benefit of CEC? Today’s 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-to-point. Examples are one touch play and one touch record which greatly simplify the user experience.
8 CEC Messaging – Quick Facts 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 device’s 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.
9 CEC Messaging – Blocks and Frames CEC Header BlockLogical Address ofInitiatorDestinationEnd ofMessageAcknowledgmentA 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.Acknowledgement (ACK) – set to 1 for every block.CEC Data BlockInformation BitsEnd ofMessageAcknowledgmentCEC FrameStartBitHeaderBlockOptional DataBlocksExample Messages:Image View On – 40 04Routing Change - 5F
11 CEC at Work – One Touch Play DVDDTVImage View On (40 04)DVDALL:00: :00: PLAYER1->TV CEC CEC IMAGE VIEW ON:00: :00: PLAYER1->ALL CEC CEC ACTIVE SOURCEActive Source (4F ):00: :00: AUDIO->ALL CEC CEC REQUEST ACTIVE SRC:00: :00: PLAYER1->ALL CEC CEC ACTIVE SOURCE:00: :00: TV->ALL CEC CEC REQUEST ACTIVE SRC:00: :00: PLAYER1->ALL CEC CEC ACTIVE SOURCEDVDAVRDTVRequest Active Source(5F 85)Request Active Source(5F 85)DTVDVDALLActive Source (4F )AVRDVDGame SystemSTB-DVRDTVALLRequest Active Source (0F 85)DVDALLActive Source (4F )Device functions, actions, message simulation only, 3 ports AVR
12 CEC at Work – One Touch Play STB-DVRDTVImage View On (30 04)Set Stream Path ( ):00: :00: TUNER->TV CEC CEC IMAGE VIEW ON:00: :00: TV->TUNER CEC CEC SET STREAM PATH:00: :00: TUNER->ALL CEC CEC ACTIVE SOURCESTB-DVRALLDTVDTV RemoteActive Source (3F )Ch. 2Ch. 3Ch. 4AVRDVDGame SystemSTB-DVR
13 CEC at Work – Device Menu Control STB-DVRDTVImage View On (40 04):00: :00: PLAYER1->TV CEC CEC IMAGE VIEW ONSTB-DVRALL:00: :00: PLAYER1->ALL CEC CEC ACTIVE SOURCE:00: :00: TV->TUNER CEC CEC MENU REQUESTActive Source (4F ):00: :00: TUNER->TV CEC CEC MENU STATUS:00: :00: TV->TUNER CEC CEC USER CNTL PRESSED:00: :00: TV->TUNER CEC CEC USER CNTL RELEASED:00: :00: TUNER->TV CEC CEC MENU REQUEST:00: :00: TV->TUNER CEC CEC MENU STATUSSTB-DVRDTVCh. 2Ch. 3Ch. 4DTV RemoteMenu Request (Activate) (03 8D 00)DTVMenu Status (Activate) (30 8E 00)AVRDVDGame SystemSTB-DVRUser Control Pressed (03 44 XX)User Control Released (03 45 XX)Menu Request (Deactivate) (03 8D 01)Menu Status (Deactivate) (30 8E 01)
14 CEC at Work: One Touch Record DTVSTB-DVRRecord TV Screen (10 0F):00: :00: RECORDER->TV CEC CEC RECORD TV SCREEN:00: :00: TV->RECORDER CEC CEC RECORD ONRecord ON [Digital Service ID] ( ):00: :00: RECORDER->TV CEC CEC RECORD STATUSDTVRecord Status [Recording Digital Service] (10 0A 02)RecordingAVRDVDGame SystemSTB-DVR
15 CEC at Work – Deck Control DTVDVDPlay [Forward] ( ):00: :00: TV->PLAYER CEC CEC PLAY FORWARDDeck Status [Play] (40 1B 11):00: :00: PLAYER->TV CEC CEC PLAY STATUS:00: :00: TV->PLAYER CEC CEC SKIP FORWARD:00: :00: PLAYER->TV CEC CEC SKIP STATUSDeck Control [Skip Forward] ( )DTVDTV RemoteDeck Status [Skip Forward] (40 1B 17)AVRDVDGame SystemSTB-DVR
16 CEC at Work - Shutdown DTV AVR DVD Game System STB-DVR DTV ALL Standby (0F 36):00: :00: TV->*ALL* CEC CEC STANDBYDTVAVRDVDGame SystemSTB-DVR
18 CEC AddressingCEC 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:LogicalPhysical
19 Logical AddressingLogical 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 follower’s (receiver’s) address.CEC Header BlockLogical Address ofInitiatorFollowerEnd ofMessageAcknowledgment
20 Logical Addressing (continued) Logical addresses are split among device types:0 is a TV1,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 system12 & 13 are reserved14 is a wild-card15 means “Unregistered” if it’s the initiator address, “Broadcast” if it’s the follower address.
21 Physical AddressingPhysical 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.
22 Physical Addressing Description A TV (that does not have HDMI outputs) will use physical address [ ]. 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 device’s 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.
29 Physical InformationCEC 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”).
30 Physical Information (continued) 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.
31 Physical Information – Bit Timing Start BitsLogical “0” and “1”
32 CEC Message WaveformMax Rise Time = 250usecsMax Fall Time = 50usecs
34 CEC Bus Control - Retransmission Retransmission can occur for many reasons: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.
35 CEC Bus Control - Acknowledgement Directed messagesIntended for a single deviceACK is set as a “logical 1”Set to “logical 0” by the follower to acknowledgeBroadcast messagesIntended for all devicesMust be kept as a “logical 1” by all devicesA “logical 0” is a NACK
36 CEC Bus Control - Acknowledgement Directed MessageSTB-DVRDTVImage View On (30 04):00: :00: TUNER->TV CEC CEC IMAGE VIEW ONSTB-DVRPull down bus to Ack with “0’ bit:00: :00: AUDIO->ALL CEC CEC REQUEST ACTIVE SRCDTVhighlowDTV0.6 ms1.5 msRelease busRelease bus to set Ack bit to “1”Broadcast MessageSTB-DVRAVRDTVRequest Active Source(5F 85)Request Active Source(5F 85)AVRDVDGame SystemSTB-DVRAVRDo nothing toacknowledgeALLhighlowRelease bus to set Ack bit to “1”0.6 ms
37 CEC Bus Control – No Acknowledgement STB-DVRDirected MessageDTVImage View On (30 04):00: :00: TUNER->TV CEC CEC UNACKNOWLEDGEDAVR:00: :00: AUDIO->ALL CEC CEC UNACKNOWLEDGEDDTVhighlowDTVRelease bus toset Ack bit to “1”0.6 msDo nothing to NackBroadcast MessageSTB-DVRAVRDTVRequest Active Source(5F 85)Request Active Source(5F 85)AVRDVDGame SystemSTB-DVRSTB-DVRPull down to 0 toNackDTVhighlow0.6 ms1.5 msRelease busRelease bus toset Ack bit to “1”
38 CEC Bus Control - Arbitration 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 messageAt 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).
39 CEC Bus Control - Arbitration DVDDTVDVDImage View OnImage View On(40 04)Get Menu Language(04 91):00: :00: PLAYER1->TV CEC CEC ERROR:00: :00: TV->PLAYER1 CEC CEC GET MENU LANGUAGE:00: :00: PLAYER1->TV CEC CEC IMAGE VIEW ON:00: :00: PLAYER1->ALL CEC CEC ACTIVE SOURCEActive Source(4F ):00: :00: TV->RECORDER CEC CEC UNACKNOWLEDGED:00: :00: TV->RECORDER CEC CEC RECORD TV SCREEN:00: :00: RECORDER->TV CEC CEC RECORD ON:00: :00: TV->RECORDER CEC CEC RECORD STATUSDTVSTB-DVRDTVSignal Free Time>/= 5 bit times(~ 12.0ms)New MessageSignal Free Time>/= 3 bit times(~ 7.2ms)RetransmitRecord TV Screen (01 0F)Record TV ScreenRecord ON [Digital Service ID]( )AVRRecord Status [Recording Digital Service](01 0A 02)DVDGame SystemSTB-DVR
41 Verifying the CEC Implementation Compliance testingIn-house using compliance test toolsPlugfests (CEA and ETSI)HDMI Authorized Test CentersInteroperability testing (multi-vendor)In-housePlugfests
42 Verifying the CEC Implementation Tools you will needCEC debug tools used during developmentCEC bus monitorCEC compliance test application (Quantum Data Test Management Environment is the recommended test tool in the HDMI CTS)Test fixtures
43 CEC Debug Testing – Error Simulator Sample screen of CEC debug test application. Enables:Simulation of acknowledgement failuresSimulation of arbitration failuresAbility to corrupt bitsModify timing parameters(Quantum Data CEC Controller)
44 CEC Debug Testing – Message Logger Sample screen of CEC Transaction logger:Logs CEC trans- actions during compliance testLogs CEC trans- actions during debug testingShows detailed timingShows acknow- ledgement and other errors(Quantum Data Auxiliary Channel Analyzer)
45 CEC Compliance Testing – CDF Entry Sample of a CEC compliance test application showing CDF definition:Enables importing CDF from comma separated value file for fast CDF definitionEnables definition of CDF parameters for new devices through GUISupports saving CDFs for later use(Quantum Data CEC Compliance Application)
46 CEC Compliance Testing - Test Initiator Sample of a CEC compliance test application showing test execution:Enables running of selective tests, or groups of testsOnline help for test setupTests run automati- cally without user interaction after test setupResults provided on display interfaceComprehensive report for all tests that can printed or ed.(Quantum Data CEC Compliance Application)
47 For more information…Quantum Data has prepared an educational whitepaper and a video on CEC that provides some further examples:
48 Thank You… Presenter: Neal Kendall Technical consultant: Jeff StenhouseAnimation & Graphics: Robert Watson