Design of FM radio system based on single chip microcomputer and TEA5767HN

Publisher:幸福之舞Latest update time:2011-08-25 Keywords:TEA5767HN Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Abstract: In order to embed the stereo FM digital radio function in electronic products. Using the single-chip microcomputer AT89S52 and TEA5767HN as the hardware core, the software design is carried out using the I2C bus communication method, and the design method of the FM digital FM radio that realizes the functions of manual station search and automatic station search is given. This method uses PT2257 to process the audio to achieve stereo output, so it has the characteristics of lightness, convenience, wide frequency band, low power consumption, high sensitivity, etc., and can be embedded in small electronic products such as MP3, mobile phones, and portable players.
Keywords: single-chip microcomputer; AT89S52; TEA5767HN; PT2257

0 Introduction
In the current PC era with the rapid development of digital information technology and network technology. Embedded technology is increasingly closely related to people's lives. Among them, handheld embedded electronic products have brought great convenience and a lot of happiness to people's lives. Although lifestyles are constantly changing, radio is still very popular. Therefore, this article focuses on the control mechanism of the TEA5767HN digital radio chip and explains the design method of embedding FM digital radio into smart electronic products through this chip and C51 single-chip microcomputer.

1 Overall system design ideas
The design goal of this stereo FM digital radio is to control the FM receiving chip TEA5767HN through the single-chip microcomputer AT89S52, so as to realize automatic search and storage of more than 10 radio programs (radio programs can also be searched and stored manually). The frequency, station number and clock of the radio station can be displayed on the LCD in the display module, and the volume can be controlled autonomously through the volume plus and minus buttons, and the data set when shutting down and the alarm function can be stored. The specific system design block diagram is shown in Figure 1.

a.JPG


This system mainly consists of seven parts: AT89S52 microcontroller control module, TEA5767HN radio module, volume control module, ROM storage module, display module, button module and power module. The key to the hardware design of this system lies in the analog parts such as FM reception and audio processing; the key to the software design lies in the communication between the control module and the radio module.
As can be seen from Figure 1, the control module is only connected to the radio module through the I2C bus and controls the radio. This design uses the two I/O pins of the P3 port of the microcontroller to simulate the SDA and SCL timing of the I2C bus and communicate with the TEA5767HN; the left and right channel audio signals output by the TEA5767HN can be pre-amplified and volume controlled through the volume control module, and then input to the TDA7057 for post-amplification, and finally output to the speaker. The microcontroller can adjust the volume through the I2C bus; the ROM storage module is mainly used to store radio data, volume data and clock data, which brings convenience to storing and reading data. The system can be operated by buttons. The MCU detects the button signals and implements manual channel search, automatic channel search, volume control, clock adjustment and other functions through the single chip microcomputer. All operation prompts and operation results can be displayed on the LCD. The 5 V and 3.3 V voltages generated by the voltage regulator power supply module can be used to power each module device respectively.

2 Hardware system circuit design
Since the key to the hardware design of this system lies in the analog circuit parts such as FM reception and audio processing, and the rest of the circuits are conventional circuits, the design of its hardware system focuses on the analysis of the two circuits of the radio module and the volume control module.
2.1 Radio module circuit analysis
The FM receiving circuit is one of the core parts of the system hardware circuit. This hardware system uses the single chip TEA5767HN as the core component of the FM receiving circuit. The TE-A5767HN chip provided by Philips is a low-voltage, low-power and low-cost fully integrated single-chip stereo radio product. It requires very few peripheral components and basically does not require external manual adjustment of high-frequency signals. In addition, its frequency band is wide and can be tuned to the FM bands of Europe, the United States and Japan completely free of charge.

b.JPG


Figure 2 shows the connection diagram of the FM application circuit of TEA5767HN. In the figure, VCC is connected to the 3.3 V power supply in the voltage regulator module, and interference is suppressed through the magnetic bead FB and capacitor. The 22μF capacitor uses a tantalum capacitor, and the two 0.1μF capacitors can use ceramic capacitors with high dielectric constant and good high-frequency performance to ensure that the power supply system of the entire radio module is more stable. R_OUT and L_OUT are the FM audio signal outputs. DATA and CLK are the data line and clock line of I2C communication. The system's MCU controls the FM Module through the I2C interface. The W/READ pin on the chip is not used in this system, so it is left unconnected. CLK and DATA are used to realize serial communication with the system's MCU. BUS-ENABLE is the bus enable signal. When BUS-ENABLE is low, the FM-Module pin on the chip enters the power saving mode, so it is left unconnected. RF is the antenna interface of the FM radio module, that is, the RF signal input pin.

2.2 Volume Control Module
The single chip PT2257 used in the volume control circuit is a 2-channel volume control IC made of CMOS technology. It can be controlled by I2C, has an attenuation range of 0 to 79 dB, and has low noise, high stereo separation, and uses fewer peripheral components. It is a popular volume control component for AV video products.
The volume control circuit adopts I2C control, and its volume is controlled by MCU, thus eliminating the potentiometer and avoiding the noise generated by the potentiometer interfering with the audio signal. However, its disadvantage is that the IC has poor overload capacity and cannot drive speakers with slightly higher power. Therefore, this design places the volume control circuit at the front signal input end, and then connects to TDA7057 for post-amplification.

3 System software design
The software design of the TEA5767HN digital radio based on the AT89S52 single-chip control platform mainly includes six parts: I2C bus communication protocol, TEA5767HN radio module control, PT2257 volume control, clock alarm module interrupt service, AT24C02 storage module control, keyboard scanning and status display. The software system design of this paper should focus on analyzing the working principles and programming ideas of the two parts of TEA5767HN radio module control and PT2257 volume module.
This system program is written in C language, and the main program consists of five modules: startup, initialization, keyboard scanning, key processing, and LCD display. Among them, system initialization includes AT89S52 initialization, TEA5767HN initialization, and LCD initialization; key processing realizes key multiplexing function by calling function method, which can realize manual channel search, automatic channel search, volume control, time adjustment, alarm adjustment and other operations; the display module can display the various working states of the system.
3.1 Software Design of TEA5767HN Module
3.1.1 TEA5767HN Read and Write Registers
TEA5767HN has 5 write registers and 5 read registers, each register can store 8 bits of data.
Write registers can store control information, including software mute, mode selection, PLL programmable counter settings, upward and downward search mode selection, mute left/right audio, programmable port settings, standby energy saving mode, Europe/Japan frequency band selection, crystal frequency selection, ADC threshold settings, de-emphasis settings, etc.
Read registers can detect the status of the receiving circuit and feedback control information, including the flag bit of searching for a valid radio station, the status of the PLL programmable counter after searching for a valid radio station, the output of the 4b ADC, and the 7b IF intermediate frequency output, etc.
3.1.2 Data Transmission of TEA5767HN
The data order of TEA5767HN is: address, byte 1, byte 2, byte 3, byte 4, byte 5, and data transmission must follow this order. Each byte will control a different function.
The seventh bit of each byte is the highest bit and is transmitted as the first bit of the byte. At the falling edge of the clock, the data becomes a valid signal. Adding a stop signal after each byte can shorten the transmission time. Before the entire transmission is completed, a stop condition is sent, and the retained byte will contain the previous information. If a byte is not transmitted, the new byte will be used, but the new tuning cycle will not start.
3.1.3 Read and write process of TEA5767HN
According to the read and write protocol of TEA5767HN, the read and write functions of TEA5767HN can be written by calling the public I2C driver: radio_write(), radio_read(). They can be called for FM functions such as manual station search and automatic station search to realize the modularization of the program and optimize the program structure. The read and write process of TEA5767HN is shown in Figure 3. Among them, I2C_Start(FM) and I2C_Stop(FM) represent the start and stop of the I2C bus respectively, and Check_(FM) is the response signal.

c.JPG


3.1.4 Initialization of the radio module
When the TEA5767HN is reset on power-on, the mute bit is set to "1" and all other bits are set to "0". In order to initialize the integrated block, all bits must be reset. Therefore, after power-on, data must be rewritten to the TEA5767HN to initialize the radio module.

d.JPG

The initialization flow chart of TEA5767HN is shown in Figure 4. The radio_write_data[] in the figure are the 5 bytes of data to be written to TEA5767HN. This system writes data to make TEA5767HN receive a frequency of 88100 kHz, select the European standard and 32.768 MHz crystal oscillator, and use stereo output. The function get_pll() is a function that calculates the PLL value based on the current frequency. After calling the get_pll() function to calculate the PLL value, the upper 6 bits of PLL should be sent to the lower 6 bits of byte 1, and then the lower 8 bits of PLL should be sent to byte 2. The frequency display can be completed by directly calling the fm_disp() function.
3.1.5 Manual channel search
Manual channel search is mainly completed by key scanning and calling functions such as radio_write(). The two keys (down, up) can be used to adjust the channel downward and upward. When the up key is pressed, the current frequency will increase by 100 kHz, and then the get_pll() function is called to convert the decimal frequency value into a 14-bit PLL value, and then the PLL value is further converted into two binary values ​​and written into the first and second bytes of the write register of TEA57 67HN. The frequency display can be completed by directly calling the fm_disp() function.
3.1.6 Automatic station search and station reading
The automatic station search mainly enables the system to start the full frequency search from the lowest frequency of 87.5 MHz, with a step of 100 kHz each time, and continuously write and read, while calling the frequency display function to continuously refresh the frequency. When the highest frequency of 108MHz is searched, the station search mode is automatically exited. During the automatic station search process, the ADC and intermediate frequency IF in the register can be read to determine whether a valid station is found. If ADC>3, and the intermediate frequency IF is in the range of 0x30~0x3E, it means that a valid radio station is found. At this time, byte 1 and byte 2 in the TEA5767 read register are read, and then the data of these two bytes are converted into PLL. Finally, the radio station information found, that is, the PLL value, is stored in the chip address of AT24C02 by writing ROM to facilitate the use of station reading.
Station reading is an operation of reading ROM and writing TEA5767. Read the radio station information in ROM, and then write the information to TEA5767 again. In automatic station search, since the stored information is a 14-bit PPL value, a function must be called to convert PLL into a decimal frequency, and then send it to the LCD for display.
3.2 PT2257 volume control design
This system uses PT2257 to control the volume of the radio output to realize digital volume control. The address of PT2257 is 88H. The microcontroller can communicate with PT2257 through I2C. The write operation of PT2257 is firstly started by the microcontroller sending a start signal to write the chip address 0x88 of PT2257, and then the PT2257 sends back a response signal. After receiving the response signal, the microcontroller sends the volume attenuation data to PT2257. After receiving the response signal again, the microcontroller sends a stop signal, so that a control process can be completed.
The attenuation data Vol of PT2257 consists of two parts, the tens digit and the ones digit. The data transmission order is to send the tens digit data first, and then send the ones digit data. The written tens digit data is (Vol/10)|TenDB, and the ones digit data is (Vol%10)|OneDB. Among them, TenDB=0xe0, OneDB=0xd0. The attenuation value is the combination of the tens digit and the ones digit values. Figure 5 shows the write process and volume control process of PT2257.

e.JPG



4 Circuit Design Description
This design is based on classic circuits in terms of hardware, so it is not difficult to design conventional circuits. However, since this design involves the processing of high-frequency and low-frequency signals, special attention should be paid to the design of anti-interference circuits. In the process of debugging the design sample, in order to improve the anti-interference ability, the author has drawn the following experience:
(1) I2C bus wiring skills
When designing the TEA5767HN radio module, because the I2C bus and the 32.768 kHz wiring are too close, the signal-to-noise ratio and sensitivity may be very poor. Therefore, when making the PCB board, the author connected the I2C bus to the lower layer through a jumper.
(2) Application of magnetic beads
Magnetic beads are generally used to suppress high-frequency noise and spike interference on signal lines and power lines, and also have the ability to absorb electrostatic pulses. The magnetic beads in this design are used to absorb ultra-high frequency signals (such as some RF circuits, PLLs, oscillation circuits, ultra-high frequency memory circuits, etc.). In order to minimize the interference of the power supply to the radio module, this design uses a magnetic bead string with a characteristic frequency of 100 MHz to connect to the 3.3 V circuit.
(3) Processing of "current noise" in circuits
There is often "current noise" in circuits. This is because the circuit generates a certain amount of oscillation. As long as the current changes, there will be noise. In this way, the current noise can be processed in a targeted manner according to its frequency. There are two specific suppression measures: one is to use inductors or resistors to isolate the interference outside the sensitive area; on the other hand, capacitors can be used to discharge the noise to the ground.
Therefore, based on design practice and relevant information, the author summarizes the three-word formula for improving the circuit's anti-interference ability, which is "avoid", "block", and "disperse". Avoid refers to reasonable layout, avoiding sensitive areas, such as setting jumpers or shielding sensitive areas; blocking means using inductors/resistors to isolate interference outside sensitive areas; dispersing means using capacitors to release noise to the ground. In addition, two major principles must be followed, namely: "High-frequency signals touch the ground; low-frequency signals are grounded everywhere."

5 Conclusion
Compared with traditional radios, the stereo FM digital radio with TEA5767HN and microcontroller as the hardware core has a small PCB layout, simpler hardware debugging, and is more reliable in terms of sound processing and performance. Through the combination of software and hardware, this system can realize manual channel search, automatic channel search, digital volume control and alarm clock functions. In software design, the single-chip microcomputer can communicate with multiple ICs through the public I2C, and the key multiplexing function can be realized through software, thus greatly reducing the product size.

Keywords:TEA5767HN Reference address:Design of FM radio system based on single chip microcomputer and TEA5767HN

Previous article:Application of CPCI Single Board Computer in Airbus Inflight Entertainment System
Next article:Design and Proteus simulation of multi-channel servo control PWM generator

Latest Industrial Control Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号