Design and Implementation of DVB-C Set Top Box Based on Hi2011

This article refers to the address: http://

Abstract : This paper introduces the basic principle of digital TV set-top box, then designs the hardware architecture of DVB-C set-top box with Hi2011 chip as the core, and analyzes the software implementation of set-top box, including the software structure of the system and the implementation of the search algorithm. Database construction, etc., which focuses on the design and implementation of the software architecture and software of the DVB-C set-top box with Hi2011 chip as the core.
Keywords : Hi2011; DVB-C; digital TV set-top box; software architecture

1. Introduction

Set Top Box (STB) is a new type of home appliance that expands the functions of TV sets. It is divided into satellite digital TV set-top box (DVB-S), terrestrial digital TV set-top box (DVB-T) and cable digital TV set-top box (DVB). -C) Three. At present, the domestic DVB-C set-top box generally adopts the streaming media processor provided by foreign manufacturers and the operating system bundled with it and the development tools on the system. It is difficult for domestic manufacturers to develop independently and must rely heavily on the technology of foreign manufacturers. stand by. This paper uses the domestic streaming media processor Hi2011 and the open source embedded real-time operating system μC/OS-II to design and research the DVB-C digital TV set-top box.

2. Hardware architecture design

The main unit of STB hardware can be divided into the front-end chip that receives the broadcast signal and converts it into a digital transmission stream, that is, the tuner and the modulation/demodulation transformer; the back-end chip includes the TV decoder/encoder, MPEG. -2 Transport, MPEG-2 MP@ML or HL decoder, microprocessor, graphics chip, audio processor, audio DAC, video DAC; and DRAM/SDRAM, Flash and other storage, power components and other standard discrete components. Some STB high-end products will also integrate security chips, modems or home network chips, as well as recordable hard drives (HDDs). The processing process of the digital TV signal by the STB is as follows: the TV radio frequency signal is tuned by the Tuner (high frequency head), and the analog-to-digital conversion is performed. The 36 MHz intermediate frequency digital signal is sent to the OFDM demodulation module for demodulation, and then becomes the TS stream. The channel decoding obtains the MPEG-2 TS stream, and the demultiplexing module (integrated descrambling module) selects an MPEG-2 audio and video stream and corresponding data information, and obtains the digital information of the selected program after being decoded by the source. The digital information is then converted to an analog signal for output to an analog television.

The Hi2011 processor is a streaming media processor developed by Beijing Haier Integrated Circuit Co., Ltd., which features: QFP160 package; low power consumption, high integration and low cost system solution; 0.18μm process, work The frequency can reach 108MHz; three pulse width modulation outputs. At the same time, the processor integrates a fully compatible 51 CPU, working clock 13.5MHz to 27MHz, four clock instruction cycle, fully compatible with standard 8051 instructions; integrated DSP, can achieve 16-bit multiply / accumulate operation coprocessor Improve the performance of the 8051. On the processor, hardware modules such as MPEG decoder, video playback, OSD and audio playback are also integrated.

The hardware of this system is based on Hi2011 chip, equipped with certain peripheral devices and interfaces, which constitute the hardware part of DVB-C data set-top box. Its hardware structure is shown in Figure 1.

Figure 1 DVB-C motherboard structure with Hi2011 chip as the core

3. Software system design

The DVB-C software system adopts a hierarchical structure, first layering the software of the system, and then performing modular hierarchical division.

3.1 Software Hierarchy

According to different software functions and functions in the set-top box software system, the software system is divided into layers according to layers, which can be divided into operating system layer, driver layer, middle layer and application layer, as shown in Figure 2.

Figure 2 Software hierarchy diagram

The operating system layer mainly includes the operating system kernel, hardware platform abstraction and operating system abstraction; the hardware platform abstraction is also called the hardware abstraction layer, which mainly encapsulates the relevant operations and functional parts of the CPU to provide the upper layer call, thereby avoiding direct The direct correlation of hardware brings great convenience to the transplantation of system software and the replacement of operating system. The abstraction of operating system mainly abstracts and modularizes the operations directly related to the operating system to provide simple application. Convenient interface while making the software system have good portability.

After the hardware platform and software structure are basically built, the embedded real-time operating system suitable for efficient multi-tasking system environment is selected, and μC/OS-II adopts priority-based multi-task preemptive scheduling strategy; the kernel is short and real-time. Good, can perform fast context switching (less than 5μs), high efficiency; low memory requirements. In view of these characteristics, in this system, the embedded real-time multitasking operating system is selected as μC/OS-II, as the operating system of the set-top box. And transplant it on the Hi2011 system, while designing the operating system abstraction layer, packaging the operating system and user-related operations.

3.2 Operating System

After the hardware platform and software structure are basically built, the embedded real-time operating system suitable for the system is selected. When selecting an embedded real-time operating system (RTOS), the RTOS should have the following characteristics: a priority-based multi-tasking preemptive scheduling strategy; the kernel is short, real-time, and can perform fast context switching ( Less than 5μs), high efficiency; open source, and supports a range of processor chips; low memory requirements; can be tailored and portable.

Because such an RTOS is an efficient operating system, it can provide an efficient multi-tasking environment for DVB-C, including task scheduling management, clock management, memory management, interrupt handling, synchronization and mutual exclusion through semaphores, and message queues. Implement message communication and more. For example, operating systems such as μC/OS-II, μCLinux, Vxworks, and OS20 all have the above features.

In this system, the embedded real-time multitasking operating system is selected as μC/OS-II, as the operating system of the set-top box, and transplanted on the Hi2011 system, and the operating system abstraction layer is designed, and the operating system is related to the user. operating.

3.3 Division of software modules and tasks

According to the consistency of the DVB-C hardware module, the software module mainly includes an initialization startup module, a port processing module, a demultiplexing module, a descrambling module, a program storage module, a Flash module, an audio and video operation module, and a user interface control module. , channel conversion control, system upgrade module, EPG module, Chinese font module and SDRAM module.

According to the functions and module divisions to be implemented by DVB-C, the tasks of the system are divided into 10 main tasks, and each task is assigned different priorities. Each task completes the corresponding function and delegates the scheduling of the task to the operating system implementation. The initialization startup module and the device driver module of the system call corresponding functions in the main function to implement their corresponding functions. The specific division is as follows: Task2 completes the functions of remote power management, clear screen, main menu key and transfer key to key value processing module; Task3 completes audio and video processing of the system; Task4 completes channel update; Task5 processes channel program editing and refreshing, etc. Task6 schedules booting LoGo; Task7 handles various display tasks of set-top boxes; Task8 schedules games and calendars; Task9 handles various forms such as program listings and demultiplexing lists; Task10 processes OSDs and PMTs. Task1 starts other tasks and starts the logo.

3.4 Database Construction

The database construction of digital set-top box based on DVB-C mainly constructs two aspects of local temporary database and database management. The local temporary database includes: a program list ProgramList, an additional program table TransponderList, and a program data structure. The construction of the ProgramList and the TransponderList is completed at the time of searching, and when the user performs channel management, it needs to update and write Flash.

Database management is mainly for managing and accessing data in each database. Database management is divided into three aspects: frequency point database management, program database management and system database management. The frequency point database management is mainly to complete the management of the frequency point data, including the frequency point information unit, the data block header and the linked list. The program database management mainly manages the program information unit and the data block header and linked list. Since the data volume of the program database is very large, when the structure of the program database is defined, the program information cannot be placed in a structure, so as not to exceed the 64 KB of the compiler. Boundary.

3.5 search module

It is very important to search the platform, not only to find out the channel list, but also to analyze a certain degree of information about each channel. The search algorithm is divided into manual search and automatic search algorithm. Because the automatic search is achieved by manually searching the for loop of the frequency, the manual search is studied. Before searching, various programs information tables are searched first, so the order in which various tables are searched is important, which will affect the time and efficiency of searching for programs. When searching, there are several search tables: PAT: provide pid of PMT, so search before PMT; PMT: provide information such as audio and video pid for each program (service_id); SDT: provide attributes of the program Information, including program name, program running status and other attributes, search after PAT; NIT: provide network information, including network identification number and network name, stored in the frequency database; NIT also provides parameters of other frequencies under this network Information, according to this can increase the frequency point database.

The idea of ​​using the search algorithm is as follows: firstly call the corresponding API encapsulated by the driver layer, set parameters such as Tuner frequency and symbol rate, decide whether to clear the ProgramList and TransponderList according to the way of data update, and then search and parse the PAT table, and parse the PAT table. After the program parses the PMT table and the SDT table one by one, after all the programs are completed, the NIT table is parsed to obtain the network information, the TransponderList is updated, and finally the return is successful. The algorithm flow is shown in Figure 3.

Figure 3 search algorithm algorithm flow chart

3.6 system main function implementation

The μC/OS-II operating system is written in standard C language, so there is only one main() function in the entire system software. In this system, there is also only one main() function. When implementing main(), you must consider the efficiency of the system. In the design of this system, Task1 is used to open other tasks, to reduce the code of the main function and improve the running efficiency of the main function. The code is as follows:



OSInit (); / / operating system initialization

Sys_init();//System initialization

System_mail_Set = OSMboxCreate(0);//System Message Initialization

Sysflag = OSFlagCreate(0x81, &err_main);//System Flag Initialization

OSTaskCreate(task1, (void *) &Task1_Stk [TASK1_STK_SIZE - 1], TASK1_PRIO);//Task scheduling starts

OSStart();//Operating system starts


4. System debugging

According to the basic principles of embedded systems and the basic characteristics of DVB-C, the debugging of this system is divided into motherboard debugging, system software and hardware debugging and system software and hardware verification.

In terms of hardware, it mainly verifies the consistency of the hardware circuit and the design circuit and the current and voltage characteristics of each input/output port of the circuit, and the other is the anti-interference ability and stable reliability of the test hardware. When debugging, use the external interference source to test the anti-interference ability of the controller.

In terms of software, it is mainly to verify the correctness of the software. Download the software to the DVB-C Flash and connect the cable TV signal to DVB-C, then connect to the analog TV, and then watch the correctness of the software through the remote control test.

This article is innovative:

This paper proposes the DVB-C set-top box software hierarchy and software module hierarchy, which effectively improve the system software development efficiency. Through the application design of Hi2011-based DVB-C digital TV set-top box research and development project, the research practice shows that this paper gives a better solution from the software level and structure of the system, the search algorithm and the database construction.

After the application of this project, it has accumulated an economic benefit of 210,000 yuan.


[1]ISO/IEC 13818-1.Information technology -Generic coding of moving pictures and associated audio:Systems [S], 1994

[2] Gu Zhiqi, Yu Songzhen. Design and implementation of set-top box SI module [J]. Television Technology, 2004-3: 51-53

[3] Xu Deng, Zheng Shibao, Jin Jian. Design and Implementation of an Optimized Set-top Box SI Engine[J].Tv Technology,2005-5:13-15

[4] Li Haiyang, Li Bolin, Guo Rongzuo. Application research of orthogonal software architecture design and evolution method[J].Application Research of Computers,2007-1:78-80

[5] Chai Wei. Building data access middleware based on design pattern[J]. Computer Engineering and Design, 2007-17:4102-4104

[6] Liu Jiufu, Sun Demin, Yang Zhong, Zhang Zhiqiang.Dynamic Testing of Embedded Software[J].Microcomputer Information,2006,1-2:82-84,248

LED Ceiling Light

Flexible Led Ceiling Lamp,3W Led Ceiling Light,Square Panel Led Ceiling Light

Kingunion Lighting Co., Ltd. ,