AN206371 FR Family, 32-Bit Microcontroller, MB91F313 HDMI-CEC This document describes the usage of HDMI-CEC technology used with MB91F313, which begins being adopted in TV and AV devices. Up to now, analog signals have been used to send pictures and voices on signal lines to connect TVs and HD recorders. Generally, cables of the RCA terminal, S terminal, and D terminal have been used for picture transmission and cables of the RCA terminal for voice transmission. Since the analog signals to send pictures and voices are continuous voltage values, there has been the problem that they are subject to noise influences from the outside and inside. To solve the problem, HDMI technology has been developed for home-use electric apparatuses by arranging the personal computer’s DVI standard already supporting the digital video signal. In HDMI technology, a single cable can transfer pictures, voices, and device information.. Contents 1 2 3 4 1 Introduction ..................................................................1 Outline of MB91F313...................................................2 Outline of reception function HDMI-CEC mounted on MB91F313 ...................................................................3 3.1 Operation of HDMI-CEC reception......................3 Input waveform into HDMI-CEC reception function .....4 4.1 HDMI-CEC format and its reception operation ....4 5 Example of initialization flow of HDMI-CEC reception function ........................................................................ 5 6 Example of HDMI-CEC circuit in MB91F313 ............... 6 6.1 Configuration ...................................................... 6 6.2 Example of simple MB91F313 circuit .................. 6 Document History.............................................................. 7 Introduction This document describes the usage of HDMI-CEC technology used with MB91F313, which begins being adopted in TV and AV devices. Up to now, analog signals have been used to send pictures and voices on signal lines to connect TVs and HD recorders. Generally, cables of the RCA terminal, S terminal, and D terminal have been used for picture transmission and cables of the RCA terminal for voice transmission. Since the analog signals to send pictures and voices are continuous voltage values, there has been the problem that they are subject to noise influences from the outside and inside. To solve the problem, HDMI technology has been developed for home-use electric apparatuses by arranging the personal computer’s DVI standard already supporting the digital video signal. In HDMI technology, a single cable can transfer pictures, voices, and device information. CEC is one function of the HDMI for device control, which has been defined in HDMI ver1.2a and was established in December, 2005. The function controls the relationship among each device mutually; for example, operation for multiple digital apparatuses can be integrated into one remote controller. This document is written for the purpose of smooth introduction of CEC function when using MB91F313. Note that this document is based on High-Definition Multimedia Interface Specification Version. 1.3a. *HDMI, HDMI logo, and High-Definition Multimedia Interface are trademarks and registered trademark of HDMI Licensing LLC. www.cypress.com Document No. 002-06371 Rev. *A 1 FR Family, 32-Bit Microcontroller, MB91F313 HDMI-CEC 2 Outline of MB91F313 MB91F313 has the HDMI-CEC reception function, allowing its hardware to receive CEC data without software intervention. Although data reception through software requires the pulse width measuring function such as PWC to process each bit, this function can make batch processing as one set of data since it can receive data in parallel, resulting in reduced loads of software processing. Sub-clock can be input to the HDMI-CEC reception circuit from the external. So, this sub-clock is entered regardless of the clock of CPU or peripheral function and the HDMI-CEC reception circuit can continuously operate even in the timer mode that stops the main clock. Therefore, MB91F313 should receive the sub-clock. In addition, if a transmission destination address is set to the address setting resister, an interrupt can occur only when MB91F313 receives a specified transmission destination address, which can greatly reduce power consumption in CEC reception standby state. For the specifications of power consumption, see the datasheet. Normal operation Main sleep Timer mode CPU Operates Stops Stops Peripheral function Operates Operates Stops HDMI-CEC function Operates Operates Operates Main clock Oscillates Oscillates Stops Sub-clock Oscillates Oscillates Oscillates Power Normal Operation www.cypress.com Mian Sleep Document No. 002-06371 Rev.*A Timer Mode 2 FR Family, 32-Bit Microcontroller, MB91F313 HDMI-CEC 3 Outline of reception function HDMI-CEC mounted on MB91F313 HDMI-CEC reception function should be used only for reception. This macro has the circuit configuration below, which detects Low width between falling edge and rising edge, compares it with the setting value, and judges 0/1 of the received data. The hardware automatically compares the received address with the specified address, and if the addresses match, then the hardware sets the received data in the data storage register. Internal bus Count clock (1) Counter RCIN (3) Noise (4) Edge filter detection (5) Latch Overflow (2) Interrupt control register Start bit (6) Comparator (7) High width register ACK 0 Detection 1 Detection (8) Shifter Peripheral clock (10) Clock 32 KHz Count clock (9) Address setting register (11) Endian exchange (12) Data storage register selection and division (13) Reception control (14) Division setting register HDMI-CEC reception macro MB91F313 3.1 Operation of HDMI-CEC reception The signal entered from RCIN pin passes through the noise filter (3) in which noise is removed, and goes into the edge detection circuit (4). Rising and falling signals are entered into the counter (1) and the latch circuit (5). The counter (1) into which the clock selected by the clock selection and division circuit (10) enters, generates the overflow signal if it counts the 128 clock or the 256 clock. The signal entered from the latch circuit (5) into the comparator (6) is compared with the High width register (7). The High width register (7) has the time being set to detect the start bit, data “1”, and data “0”. The signal is judged by comparing with this time period. The signal generated from the comparator (6) goes into the shifter (8) and when 8-bit data are stored, they are compared with the address setting register (9). If they match, the interrupt should occur. The signal from the comparator above is also entered into the Endian-exchange circuit (11) and stored in the data storage register (12). www.cypress.com Document No. 002-06371 Rev.*A 3 FR Family, 32-Bit Microcontroller, MB91F313 HDMI-CEC 4 4.1 Input waveform into HDMI-CEC reception function HDMI-CEC format and its reception operation CEC communication formats are roughly classified into the format for transmission start and format for reception. The 1st frame consists of the start bit, transmission source address, transmission destination address, EOM, and ACK and the 2nd frame consists of the transmission data, EOM, and ACK. Start bit 1st frame 2nd frame Transmission Transmission source address destination address Transmissionr data EOM ACK EOM ACK 2nd frame 1st frame Start bit Transmission source address Transmission destination address MSB EOM ACK Data EOM ACK LSB For data transmission, the format of the 1st frame is used to send the transmission source address and the transmission destination address and then the format of the 2nd frame is used to send arbitrary number of data set. Since HDMI-CEC reception function can detect the transmission destination address in the 1st frame, the device address setting register can be used so that it cannot be restored when it receives other than a specified value in it. Data of the 1st frame, the 2nd frame and later is stored as 8-bit parallel data in the data storage register. If overflow occurs after detecting the start bit, the counter overflow detection bit can be set to generate an interrupt. If the received data is normal, the reception side should return ACK for each frame to the source side. In addition, since the source uses EOM to notify the destination of the end of the data, EOM detection bit is used for confirmation. “1” and “0”of the start bit can be identified by using Low/High width of the pulse. Its cycle should be set by the start bit High width setting register, High width setting register A, and High width setting register B. In HDMI-CEC mode, since the input signal is inverted internally, High width comparison is applied to Low width. A value (ex. 3.48 ms) below the minimum value of 3.5 ms for the start bit Low width should be set in the start bit High width register. Since High width setting register A functions as a noise filter, a value (ex. 0.397 ms) below the minimum value of 0.4 ms for data “1” Low width should be set in the register A. Since High width setting register B is used for the threshold value for data “0” and “1”, a value (ex. 0.128 ms) above 0.8 ms and below 1.3 ms should be set in the register B. Data ”1” Start bit 4.5[ms] www.cypress.com 2.4[ms] Data ”0” 2.4[ms] Typical: 3.7[ms] Typical: 0.6[ms] Typical: 1.5[ms] Max.: 3.9[ms] Max.: 0.8[ms] Max.: 1.7[ms] Min.: 3.5[ms] Min.: 0.4[ms] Min.: 1.3[ms] Document No. 002-06371 Rev.*A 4 FR Family, 32-Bit Microcontroller, MB91F313 HDMI-CEC 5 Example of initialization flow of HDMI-CEC reception function Initialization function for HDMI-CEC reception function Starts initialization for HDMI-CEC reception. Interrupt function for HDMI-CEC reception Starts interrupt operation for HDMI-CEC reception. Sets MOD field of RCCR to HCMI-CEC mode. Overflow detected? Sets THSEL (sense selection) of RCCR to “1”. Enables comparison between received address and device address in ADRCE (address comparison permission) of RCCR. Sets the overflow time to 4 ms (128 clock: 32 KHz) in Overflow error handling Yes. OVF=1 No. OVF=0 CEC data processing - Obtaining received data from RCDT - Obtaining ST, ACK, EOM states OVFSEL bit of RCCR. Enables an interruption in STIE of RCST. Enables an interruption in ACKIE of RCST. End Enables an interruption in OVFIE of RCST. Set Low width of start bit to 3.48 ms (114 clock: 32.768 KHz) in RCSHW. Set noise removal width to 0.40 ms (13 clock: 32.768 KHz) in RCDAHW. Set threshold value of data “1” and “0” to 1.28 ms (42 clock: 32.768 KHz) in RCDBHW. Selects sub-clock in CKSEL bit in RCCKD. Enables operation with EN bit in RCCT. End www.cypress.com Document No. 002-06371 Rev.*A 5 FR Family, 32-Bit Microcontroller, MB91F313 HDMI-CEC 6 6.1 Example of HDMI-CEC circuit in MB91F313 Configuration HDMI-CEC reception function is used to receive CEC commands. In addition, PPG output having N-ch open/drain function is used to send CEC commands. As shown in the simple circuit example below, CEC input pins connect to CEC signal lines. 6.2 Example of simple MB91F313 circuit 3.3[V] CEC input/output 1.8[V] 27 KΩ MB91F313 2, 64, 92 pin VDDI 32 pin RCIN0 HDMI-CEC 54 pin PPG0 30, 40, 43, 44, 57, 90, 120 pin VDDE 32.768KHz 59 pin X0A 58 pin INITX 10 MΩ Dumping resistor Dumping resistor 3.3[V] 10 KΩ 80 pin TRSTX 60 pin X1A Reset Switch 62 pin X1 65 pin MD0 66 pin MD1 63 pin X0 67 pin MD2 16.5 MHz 1, 31, 41, 42, 61, 91 pin VSS * Select the dumping resistors and the capacitors for the oscillator based on the matching data of the used oscillator. The matching data is available from the manufacturer of the oscillator * An additional circuit should be required for on-board debugging and on-board flash writing. www.cypress.com Document No. 002-06371 Rev.*A 6 FR Family, 32-Bit Microcontroller, MB91F313 HDMI-CEC Document History Document Title: AN206371 – FR Family, 32-Bit Microcontroller, MB91F313 HDMI-CEC Document Number: 002-06371 Revision ECN Orig. of Change Submission Date ** - YUIS 03/07/2008 Initial release *A 5293547 YUIS 06/02/2016 Migrated Spansion Application Note “AN07-00154-1E” to Cypress format. www.cypress.com Description of Change Document No. 002-06371 Rev.*A 7 FR Family, 32-Bit Microcontroller, MB91F313 HDMI-CEC Worldwide Sales and Design Support Cypress maintains a worldwide network of offices, solution centers, manufacturer’s representatives, and distributors. To find the office closest to you, visit us at Cypress Locations. Products ® ® PSoC® Solutions ARM Cortex Microcontrollers cypress.com/arm Automotive cypress.com/automotive PSoC 1 | PSoC 3 | PSoC 4 | PSoC 5LP Clocks & Buffers cypress.com/clocks Cypress Developer Community Interface cypress.com/interface Forums | Projects | Videos | Blogs | Training | Components Lighting & Power Control cypress.com/powerpsoc Memory cypress.com/memory PSoC cypress.com/psoc Touch Sensing cypress.com/touch USB Controllers cypress.com/usb Wireless/RF cypress.com/wireless Technical Support cypress.com/support PSoC is a registered trademark and PSoC Creator is a trademark of Cypress Semiconductor Corporation. All other trademarks or registered trademarks referenced herein are the property of their respective owners. Cypress Semiconductor 198 Champion Court San Jose, CA 95134-1709 Phone Fax Website : 408-943-2600 : 408-943-4730 : www.cypress.com © Cypress Semiconductor Corporation,2008-2016. This document is the property of Cypress Semiconductor Corporation and its subsidiaries, including Spansion LLC (“Cypress”). This document, including any software or firmware included or referenced in this document (“Software”), is owned by Cypress under the intellectual property laws and treaties of the United States and other countries worldwide. Cypress reserves all rights under such laws and treaties and does not, except as specifically stated in this paragraph, grant any license under its patents, copyrights, trademarks, or other intellectual property rights. If the Software is not accompanied by a license agreement and you do not otherwise have a written agreement with Cypress governing the use of the Software, then Cypress hereby grants you a personal, non-exclusive, nontransferable license (without the right to sublicense) (1) under its copyright rights in the Software (a) for Software provided in source code form, to modify and reproduce the Software solely for use with Cypress hardware products, only internally within your organization, and (b) to distribute the Software in binary code form externally to end users (either directly or indirectly through resellers and distributors), solely for use on Cypress hardware product units, and (2) under those claims of Cypress’s patents that are infringed by the Software (as provided by Cypress, unmodified) to make, use, distribute, and import the Software solely for use with Cypress hardware products. Any other use, reproduction, modification, translation, or compilation of the Software is prohibited. TO THE EXTENT PERMITTED BY APPLICABLE LAW, CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS DOCUMENT OR ANY SOFTWARE OR ACCOMPANYING HARDWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. To the extent permitted by applicable law, Cypress reserves the right to make changes to this document without further notice. Cypress does not assume any liability arising out of the application or use of any product or circuit described in this document. Any information provided in this document, including any sample design information or programming code, is provided only for reference purposes. It is the responsibility of the user of this document to properly design, program, and test the functionality and safety of any application made of this information and any resulting product. Cypress products are not designed, intended, or authorized for use as critical components in systems designed or intended for the operation of weapons, weapons systems, nuclear installations, life-support devices or systems, other medical devices or systems (including resuscitation equipment and surgical implants), pollution control or hazardous substances management, or other uses where the failure of the device or system could cause personal injury, death, or property damage (“Unintended Uses”). A critical component is any component of a device or system whose failure to perform can be reasonably expected to cause the failure of the device or system, or to affect its safety or effectiveness. Cypress is not liable, in whole or in part, and you shall and hereby do release Cypress from any claim, damage, or other liability arising from or related to all Unintended Uses of Cypress products. You shall indemnify and hold Cypress harmless from and against all claims, costs, damages, and other liabilities, including claims for personal injury or death, arising from or related to any Unintended Uses of Cypress products. Cypress, the Cypress logo, Spansion, the Spansion logo, and combinations thereof, PSoC, CapSense, EZ-USB, F-RAM, and Traveo are trademarks or registered trademarks of Cypress in the United States and other countries. For a more complete list of Cypress trademarks, visit cypress.com. Other names and brands may be claimed as property of their respective owners. www.cypress.com Document No. 002-06371 Rev.*A 8