This article refers to the address: http://
Abstract: This paper introduces the hardware structure design and system software design of the car multi-disc DVD player based on Sunplus MCU SPCE061A, and elaborates the communication between MCU and DVD multi-disc box (CDC) and the software implementation of the sound controller. It also analyzes the unique aspects of the design. The field test results of this design are satisfactory.
Keywords : car DVD player; SPCE061A; microcontroller
1 Introduction In recent years, China's automobile industry has developed rapidly, and the market for automotive-related electronic products is growing. As a representative of the consumption trend of the new generation of car audio and video market, car DVD has a broad development prospect. Currently, the car audio and video systems sold in China are mostly foreign brands, and domestic brands are few. Therefore, research and development of a set of car DVD control system with independent characteristics has its practical application value. This paper designs and implements a set of car multi-disc DVD player based on Sunplus MCU SPCE061A.
2 system hardware The vehicle multi-disc DVD system introduced in this paper, its hardware structure diagram is shown in Figure 1: The right side of the dotted line is the hardware structure block diagram of the vehicle multi-disc DVD player, which is based on the Lingyang 16-bit single-chip microcomputer SPCE061A as the core, integrated DVD control module, FM/AM radio module, sound control module, LCD display module, keyboard module and infrared remote control processing module; the left side of the dotted line is a multi-disc DVD box, which is controlled by the DVD player and is responsible for audio/video decoding. Provide audio signals and video signals in PAL/NTSC format to return the current playback information in real time.
Let's take a look at some of the main functional modules that make up the DVD player system.
2.1 Microcontroller SPCE061A[1]
SPCE061A is a 16-bit microcontroller controlled by Sunplus Technology. It consumes less power and consumes only 2μA/3.6V when the system is in standby (sleep state); built-in 2K words SRAM and 32K words of FLASH; two 16-bit programmable timers/counters; two 10-bit DACs (D/A conversion) output channel; two 16-bit general-purpose programmable input/output ports IOA and IOB; rich interrupt resources: timer A/B interrupt, time base interrupt, 2 external interrupts, and touch-key wake-up interrupt; 7-channel 10-bit voltage analog-to-digital converter (ADC) and single-channel audio analog-to-digital converter; with serial device interface (SIO); system clock signal selectable via phase-locked loop PLL oscillator; low-voltage reset function and Low voltage detection function; WatchDog function, etc. Compared with other single-chip microcomputers, SPCE061A is a resource-rich, powerful, and highly integrated microcontroller. This microcontroller is used as the microcontroller of this system with high cost performance.
2.2 The panel module includes two parts: a button circuit and an infrared receiving circuit, wherein the keyboard portion has a total of 16 user buttons. In order to make reasonable use of SPCE061A's I/O port resources and 8 channels of A/D resources, a resistor array circuit is used here to obtain different voltages when different buttons are pressed, and to collect buttons through two A/Ds (IOA2 and IOA3). Voltage signal. Since some buttons have a long press/short press alternate function, one A/D is set to collect the short key signal, and the other A/D is responsible for collecting the key signal with the alternate function, and the voltage value obtained according to the A/D conversion. Check the table to determine the corresponding function key value.
The infrared remote control code of this system adopts UPD6122 encoding mode, that is, the boot code is composed of a low level of 9ms and a high level of 4.5ms, followed by 8-bit system code, 8-bit system inverse code, 8-bit function. The code and the inverse of the 8-bit function code. The infrared receiving circuit passes the photoelectric conversion, demodulation and shaping of the received infrared signal, and finally obtains pulse data. IOB3 (external interrupt 2) connected to the infrared code data is in a high state input state under normal conditions. When the pulse data arrives, a falling edge is generated to trigger the MCU external interrupt 2, at which time the timer B starts to receive the serial remote control data.
Figure 1 system hardware structure diagram
2.3 Sound Control Module
The sound control module is divided into two parts: a sound controller and a power amplifier, wherein the output signal of the sound controller is input to the power amplifier for amplification. This design uses Philips' TEA6320[2] chip as the sound processing control chip. This is a high-fidelity sound attenuation control circuit for car audio circuits, which implements stereo pre-amplification through I2C bus control. It can have up to 4 channels of two-channel sound input and 1 channel of mono source. The system has three sources: DVD source, radio source and microphone input.
The power amplifier uses the TDA7384A[3] chip. The chip is suitable for car audio amplifier circuit, can amplify 4 channels of signals, has the characteristics of small distortion, low output noise, high power output (power of each channel can reach 35W/4Ω). In addition, the pins ST-BY and MUTE can control the operating state of the power amplifier: when both ST-BY and MUTE are high, the power amplifier is in the operating mode; when both ST-BY and MUTE are low, the power is The amplifier stops working.
2.4 LCD display module uses chip CS1685 [4] as the driving circuit of liquid crystal display, directly driving 156-segment LCD. In this design, the serial device input/output port SIO of SPCE061A is used as the data communication interface between the MCU and the LCD, and the display data is continuously transmitted in units of bytes. IOB0 is the clock port (SCK), and IOB1 is the data port (SDA), which is directly connected to the chip's 63-pin CL (synchronous clock) and 64-pin DI (transport data).
3 system software design 3.1 software <br> a good or bad with the overall design of the system software of the system performance are inseparable. In order to achieve the stability and scalability of the system functions, the system software design follows the following programming principles:
(1) Message driven programming mode. The whole software system consists of three parts: the main program, the interrupt service program and the function sub-program. The interrupt service program is only responsible for setting the flag bit and adding corresponding information to the main program's message queue. If the main program detects the flag, it performs the corresponding function. Adopting this programming mode greatly reduces the time taken by the interrupt handler, avoids event conflicts, and improves the timeliness and accuracy of the system response.
(2) The modularization of each function subroutine. The information between the function block and the function block is passed through the entry parameters and the exit parameters, so that the modules have good independence.
(3) In the main program, the watchdog counter WatchDog is cleared at the end of each loop to prevent the program from "running" due to abnormal conditions. The system main program design flow block diagram is shown as in Fig. 2.
Figure 2 System main program flow block diagram The system clock frequency of SPCE061A is generated by the 32768Hz real-time clock through the PLL multiplier circuit. Different system clock frequency and CPU clock frequency can be selected by programming the register P_SystemClock unit. Since the system clock frequency fosc=24.576 MHz by default, and the power-on reset or the system wakes up from sleep, the default CPU clock frequency is fosc/8. Considering the stability of the system, this design chooses 24.576 MHz as the system clock frequency and fosc/8 as the CPU clock frequency.
3.2 Communication between MCU and multi -disc DVD player In the multi-disc DVD player, how to control the playback/pause, stop, and select the upper/lower disc of the DVD player in real time is the core part of this design. The communication data between the DVD player and the MCU uses a pulse width modulation (PWM) waveform, which is determined to be "0" or "1" depending on the width of the pulse. In order to send the control code in time and accurately, the external interrupt 1 (IOB2) and the timer A are selected to realize the transmission and reception of the control code word. When the control word is transmitted, the BUS level is set to low or high according to whether the current bit data is "0" or "1", and the initial value of the timer is set, and the timer is started. When the DVD player is playing, the playback information is returned every 1 second or so, such as the current disc number, the current playing time, and the like. In order to receive the returned information in time, the external interrupt 1 falling edge trigger mode is used. When there is information return, the BUS line changes from the normal high level to the low level, and an external interrupt request signal is generated. When the MCU detects an external interrupt signal, it starts receiving data. When receiving data, the timer is used to measure the interval between adjacent bits to determine whether to receive a timeout. If a timer interrupt is entered during data reception, it indicates that the reception has timed out.
3.3 Sound Controller Program Design Since SPCE061A has no I2C bus interface, it uses two I/O ports to simulate the data line SDA and clock line SCL of the I2C bus, and writes different control words to the TEA6320 to realize volume control and bass control. High-pitched control, left and right balance/front and rear balance control, mute control and loudness switch control. The I2C bus write format is shown in Figure 3, where the slave address of the chip is 80H; the subaddress SAD is from 00H to 07H, and the corresponding registers are the volume/loud control register and the front right channel. FFR) control register, front left channel (FFL) control register, rear right channel (FRR) control register, rear left channel (FRL) control register, bass (Bass) control register, Treble control register and sound Channel control register. One byte after SAD is the control word written to the corresponding register. The TEA6320 provides three muting modes: one is to use the pin 12 to achieve hardware mute, the other is to use the highest GMU of the Switch control word to directly mute the whole, and the other is the highest position ZCM and GMU of the Vol/Loud control word. Combine to implement the mute function. The last muting method allows direct mute or zero-crossing mute.
Figure 3 TEA6320 I2C bus control word format
The software implementation principle of each function is basically the same. Only the initialization of TEA6320 is introduced here. Figure 4 is a software flow diagram for initialization. Since the TEA6320 writes more than one byte of data, the subaddress can be automatically incremented. Therefore, as long as SAD takes 00H, eight control words are sequentially written into the corresponding control registers. It is important to note that each time the circuit is powered down, the eight registers of the TEA6320 are initialized. After the initialization is completed, the subsequent written control words will be valid.
Figure 4 TEA6320 initialization software flow
4 Uniqueness of the system design
4.1 Energy-saving design
For any electronic product, saving energy is always the goal pursued by designers. Use SPEA061A's IOA0~IOA7 touch-key wake-up function to set IOA2 and IOA3 as two A/Ds for collecting keyboard voltage signals. If no button is pressed within a certain time interval, the system clock (PLL oscillator) is turned off and goes to sleep. If the system receives a wake-up signal, the PLL oscillator is turned on and the CPU responds to the processing of the wake-up event. The design method of touch-key wake-up reduces the power consumption of the system.
4.2 Power Supply Detection Due to the special nature of the vehicle's electronic working environment, the power supply is often unstable, especially when the voltage is too high. Using SPCE061A low voltage reset (LVR) and low voltage monitoring (LVD) function, when the power supply is unstable or the voltage is not in the working range, the display prompts the power supply error message, and the system enters the shutdown mode to avoid the power supply instability. Damage to the device.
4.3 Software Update Sunplus MCU SPCE061A has a 32K word FLASH ROM embedded in it. As long as the program download interface is pulled out on the circuit panel, the software update can be realized at any time, and the software upgrade is quite convenient.
4.4 The real-time volume display is different from the volume analog display mode adopted by many products on the market. The system described in this article can truly reflect the current volume. Through the voltage acquisition of the left and right channel volume and AD conversion, the volume level is accurately displayed in real time in the volume indication area of ​​the LCD.
5 Conclusion The car multi-disc DVD player system introduced in this article realizes modular design and generalization, and also has its own characteristics. At present, the entire system has passed the test phase smoothly, and the field test results are satisfactory.
references
[1] Luo Yafei et al. Application basis of Lingyang 16-bit single-chip microcomputer Beijing University of Aeronautics and Astronautics Press 2003
[2] Data Sheet of TEA6320 Philips Semiconductors Dec 1995
[3] Data Sheet of TDA7384A STMicroelectronic Mar 1999
[4] Data Sheet of CS1685 Wuxi China Resources Microelectronics Co., Ltd. 2003
Industrial Ring Ethernet Switch is an industrial grade redundant ring Ethernet Switch, equipped with 1000base-X SFP interface, 10/100base-T (X) port. Support industrial ring protocol "NT- Ring", Gigabit ports effectively create Gigabit self-recovery ring redundancy (self-recovery time <20ms), protection grade, industrial grade four in accordance with EMC requirements, guide rail type or wall mounted, STP, RSTP protocol. It meets the requirements of industrial field for the reliability and practicability of the network system. Its reliable hardware design is especially suitable for industrial communication applications that require continuous operation.
Industrial Ring Ethernet Switch
Industrial Ring Ethernet Switch,Industrial Ethernet Switch,Ethernet Ring Switch,Industrial Ring Network Switch, Industrial Ring Managed Switch, Industrial Ring Management Switch
Shenzhen N-net Technology Co.,Ltd , http://www.nnetswitch.com