Menu English Ukrainian russian Home

Free technical library for hobbyists and professionals Free technical library


ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING
Free library / Schemes of radio-electronic and electrical devices

MP3 player - set-top box for PC. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Computers

Comments on the article Comments on the article

The MP3 player brought to the attention of readers is a device that is an MP3 decoder connected to the parallel (LPT) port of a computer. It can be used in a stationary music center or in a car (when used to control and store information of any type of computer or device on a microcontroller), to expand the functionality of "slow" computers, etc.

MP3, MPEG-1* Layer 3, MPEG Audio names of a compression technique for a digitized audio stream or file. The fundamental feature of MPEG encoding is lossy compression. After packing and unpacking an audio file using the MP3 method, the result is not identical to the original "bit for bit". On the contrary, packing deliberately excludes non-essential components from the packed signal, which leads to an extreme increase in the compression ratio. Depending on the required sound quality, the MP3 method is capable of compressing a digital audio signal by ten or more times. Thanks to this, the musical compositions of one audio CD in compressed form with acceptable sound quality occupy only 60 ... 70 MB.

Today, this format is becoming more and more popular. Dozens of devices from various companies are mass-produced using a wide variety of information carriers: memory cards, CDs, hard drives. There are many amateur devices, descriptions of which, for example, can be found on the Internet [1], ranging from computers with software data decoding to devices with hardware decoding and the ability to work with several different media simultaneously.

However, the use of an MP3 player with a laptop computer, even with a low-performance processor (286, 386, 486), which can be purchased on the radio market for a small fee, compares favorably with all other devices. Firstly, for the price - the cost of the microcontroller, LCD display and other parts is more than an old laptop. Secondly, in terms of functionality - a screen with a high resolution and grayscale (or even color), a large set of control keys, the ability to simultaneously use the computer for other purposes (for example, as a clock, to control various devices). Thirdly, in terms of flexibility - the software is written in a high-level programming language and can be easily and quickly changed without using a programmer using the computer itself.

The block diagram of the MP3 player is shown in fig. 1. As you can see, it is connected to the parallel port of the computer and consists of a signal level converter U1, a hardware MP3 decoder U2 and a power supply A1.

MP3 player - set-top box for PC

The bottleneck in the device is the low bandwidth of the parallel port of the computer. When tested on a computer with an SPP (Standard Parallel Port) port based on an Intel 486DX-33 processor, the maximum data stream at which musical compositions were played without stuttering was 128 Kbps. On a computer with an EPP parallel port (improved parallel port), where the exchange rate reaches 0,5.. 2 MB / s (the exchange rate with the device is much lower, since data is exchanged only along one of the signal lines, and data strobe is performed by software ) stream of 192 Kbps and higher is normally played back.

If desired, to interface the device with a computer, you can use the interface for connecting to the ISA bus, described in [2], with a slight modification of the software. However, in this case, the scope of the device will narrow - it can only be connected to desktop computers, since laptops usually do not have such a bus.

The schematic diagram of the device is shown in fig. 2. The logic level converter is implemented on NOT elements with an open collector (microcircuits DD1, DD2) and transforms TTL levels into logic ones with a high level of 3 V and vice versa.

MP3 player - set-top box for PC

Chip DD3 (VS1001k Finnish company VLSI Oy) is a digital signal processor (Digital Signal Processor - DSP) for hardware decoding MPEG layers 1, 2 and 3 [3, 4]. Its block diagram is shown in fig. 3. The chip contains a high-performance low power DSP core (VS_DSP), working memory, program (4Kbytes) and data (0,5Kbytes) RAM for user applications, serial control and data interfaces, a high-quality DAC and a 3-frequency amplifier for head phones.

MP3 player - set-top box for PC

The VS1001k accepts the input data stream via the serial bus, which is connected as a slave in the system. The input stream is decoded and passed through a hybrid A/D volume control to an 18-bit delta-sigma DAC. Decoding is controlled via the serial control bus. In addition to simple decoding, you can add special applications - DSP effects, which are located in the user's RAM.

To control the chip and transfer the MP3 data stream, two buses are used: SCI (Serial Control Interface) for control and SDI (Serial Data Interface) for data transfer. The purpose of the lines of these tires is given in Table 1.

MP3 player - set-top box for PC

VS1001k contains 15 SCI registers (Table 2). After a hardware "reset" they are all set to 0.

MP3 player - set-top box for PC

The MODE register is used to control the operations of the VS1001. The names of its bits, their functions and descriptions are given in Table. 3.

MP3 player - set-top box for PC
(click to enlarge)

The STATUS register contains information about the current state of the chip. Bits 1 and 0 are used to control the analog output level (0 - 0 dB, 1 = -6 dB, 3 - -12 dB), bit 2 - to turn off the power of the analog part of the microcircuit (when it is set to one, it turns off). Writing to the VOL register (see below) automatically sets the analog output signal level and the user does not have to worry about its state.

The CLOCKF register is used if the clock frequency is other than 24,576 MHz (it must be a multiple of 2 kHz). The value of this register is calculated by the formula CLOCKF = ХТ1/2000 (ХТ1 - clock frequency in hertz). The register can take values ​​from 0 to 32767, however, larger values ​​are limited by the maximum clock frequency of the microcircuit (32 MHz).

Setting the MSB of the register to 1 enables the internal frequency doubler. The clock frequency up to 15 MHz can be doubled. The CLOCKF register must be set before MP3 data is decoded, otherwise it will not play correctly.

The clock frequency determines the maximum sampling rate of audio data and the rate of the input MP3 data stream. For example, at a clock frequency of 12,288 MHz, the microcircuit decodes audio data with a sampling rate of 24 kHz and a stream of up to 96 Kbps, at a frequency of 22,580 MHz - with a sampling rate of 44,1 kHz and a stream of up to 160 kbps, a stream with a variable speed not exceeding 256 kbps. If the clock frequency is 24,576 MHz, all audio data is decoded with a sampling rate up to 48 kHz and a bit rate up to 192 Kbps, at a frequency of 28 MHz - a stream with a maximum rate of up to 320 Kbps The DECODEJTIME register, when processing the correct stream, contains the current time decoding in seconds.

Bits 8-0 of the AUDATA register contain the value of the data rate in kilobits per second (if it is variable, they contain the current rate of the stream), bits 12-9 contain the sampling rate index (Table 4). Bits 14 and 13 are not used and are always set to 0. Bit 15 characterizes the type of audio data (0 - mono, 1 - stereo).

MP3 player - set-top box for PC

Using the WRAM WRAMADDR AIADDR registers, you can load and run user-written applications on the chip, for example, mixing channels, creating stereo effects when playing a mono signal, introducing a digital equalizer. Examples of such applications and tools for developing them can be found on the website of the chip manufacturer. However, it should be remembered that all this increases the load on the digital signal processor, and its performance is limited. For example, with a clock speed of 24,576 MHz and decoding of a 128 Kbps data stream at a sampling rate of 44,1 kHz, there is only about 28% of free processor time. When the frequency response expander is enabled (by the SM_BASS bit of the MODE register), an additional 6,5% of the DSP performance is spent.

The HDAT0 and HDAT1 registers contain information about the title of the piece of music being extracted from the current MPEG data stream.

The VOL register is for volume control. In each channel, the value can vary from 0 to 255 (corresponding to signal attenuation from the maximum level to zero in 0,5 dB steps). For the left channel, the value is multiplied by 256 and added to the value of the right channel. Thus, to get the maximum volume, the register must contain 0, and complete silence - 65535. After a hardware "reset", the maximum volume is set, a software "reset" does not change the set volume.

When you set the minimum volume (255 in both channels), the power of the analog part is turned off, which is accompanied by a click. You can exclude it if you use the maximum value of 254 in both channels (0xFEFE) to turn off the sound.

The PQ3VZ1 chip from SHARP is used in the device as a 20 V supply voltage regulator (DA51). The output voltage Uout (within 1,5 ... 20 V at a load current of up to 0,5 A) is calculated by the formula Uout = Uobr (1 + R3 / R4), where R4 = 1 kOhm, and the reference voltage Uobr = 1,25, 3 V. In this case, R1,5 \u1,25d 1 kOhm and Uout \u1,5d 1 (3,125 + XNUMX / XNUMX) \uXNUMXd XNUMX V.

Filtering chokes L1-L3 and capacitors C3-C6 are used to separate the power circuits of the analog and digital parts. The microcircuit has a built-in power on / off function, which can be used in a portable version of the device.

The device management software is written in C and must be compiled and placed on a computer. The author used the Borland C compiler.

For control, the following functions are used, which are defined in the vs1001.h file:

void SCIWrite(int aress, int data) - write to SCI;

int SCIRead(int aress) - read SCI;

void SDIWrite(int data) - write to SDI;

void xReset(void) - hardware "reset";

int DREQ(void) - read the value of the DREQ signal.

The program works like this:

  • a hardware "reset" is performed by executing the xReset() function;
  • a pause of 100 ms is maintained;
  • a software "reset" is performed by writing the value 0x0004 to the SCI MODE register;
  • a pause of 100 ms is maintained again;
  • the CLOCKF register is set. For example, if a 14,31818 MHz crystal is used (the chip's clock runs at 28,63636 MHz when frequency doubling is used), this is done by the following function: SCIWrite(0x03, 0x8000+(14318180/ /2000)); //Clock freq + doubler (conditional transfer).

If desired, set the remaining registers, for example, VOL, MODE, etc. Then the state of the DREQ output is checked by the DREQQ function. If it is set to 0 (the DREQQ function returns 0), then you can send data from an MP3 file.

* The abbreviation MPEG is an abbreviation for the Moving Picture Expert Group - the name of the ISO (International Organization for Standardization) expert group, acting in the direction of developing standards for encoding and compressing video and audio data. Often the abbreviation MPEG is used to refer to standards developed by this group.

In the simplest case, the program looks like this (mp3play.cpp):

MP3 player - set-top box for PC

When playing the next file, it is necessary to perform a software "reset" of the VS1001k chip (by setting the SMRESET bit of the SCI MODE register to 1).

Checking the performance of the device begins with the analog part of the DD3 chip. On all UDDA, UDDD pins. and xRESET and TEST0 should be about +3 V, and the RCAP pin should be about +1,3 V. If the latter is 0 or UD DA, the analog part of the VS1001 is faulty.

When the decoder is "hard reset" by applying a low level to the xRESET pin, the following should happen: after 4096 clock cycles after the voltage at xRESET returns to a unity level, a low level should appear on the DREQ pin, which after 6000 clock generator cycles should change to a high level . If the signal levels on this pin do not change in the order shown, the chip's internal software is faulty.

Then check the operation of the SCI bus. To do this, the maximum volume value is written to the VOL register, and then the value OxFFFF, which turns off the analog part of the Vsl001k chip. As a result, a click should be heard in the headphones connected to the XS2 socket. The following program snippet (scitest.cpp) demonstrates this: five clicks will be heard at the output with a period of 0,5 s:

MP3 player - set-top box for PC

Now you need to check the reading of the SCI registers. To do this, write some value to the VOL register, for example 12345, and then read the information from this register and compare the result. On the computer display, if the test is successful, the message "SCI Read Test Passed" is displayed, otherwise - "SCI Read Failed" (sciread.cpp).

MP3 player - set-top box for PC

Next, check the record in SDI. It is convenient to use a special test built into the microcircuit that produces a sinusoidal signal at the analog output. To enable the test, it is necessary to transmit via SDI an eight-byte sequence 0x53 OxEF Ox6E n 0 0 0 0, where n = 48... 119 (selected by the user). The signal parameters are determined from the table. 5, where the sampling rate index is Fsldx = (n - 48)mod9 and the number of samples index is FSin = (n - 48)/9. For example, at n = 62 (in this case n - 48 = 14) Fsldx = 5 and FSin = 1. The value Fsldx = 5 corresponds to the sampling frequency of 16000 Hz, and the value FSin = 1-16 samples. Thus, at the output we will get a sinusoidal signal with a frequency of 16000/16 = 1000 Hz.

MP3 player - set-top box for PC

To exit the test mode, the byte sequence 0x45 0x78 0x69 0x74 0 0 0 0 is transmitted via SDI.

The following program snippet (sinetest.cpp) demonstrates this test: on the analog output, you can listen to a signal with a frequency of 1 kHz for 5 seconds:

MP3 player - set-top box for PC

To test the memory of the VS1001k chip, an eight-byte sequence 0x4D OxEA 0x6D 0x54 0 0 0 0 is sent to SDI. After this command, you must wait 500 clock cycles. The test result can be read from the HDAT000 SCI register. The received data is interpreted as follows: if the bit is set to 0, then the memory test is passed (Table 1).

MP3 player - set-top box for PC

On the computer display, if the test is successful, the message "Memory test completed successfully" is displayed, otherwise - "Memory error xxxxx", where xxxxx is the value read from the HDATO register.

Here is a fragment of the memory testing program (memtest.cpp):

MP3 player - set-top box for PC

To check the SCI registers, it is necessary to send the eight-byte sequence 0x53 0x70 0xEE n 0 0 0 0 to the SDI, where n is the register number for the test. The contents of the specified register are read and copied into the HDAT0 register. If it is necessary to check the HDAT0 register, then its value is copied into the HDAT1 register.

The device is mounted on a printed circuit board made according to the drawing shown in Fig. 4. During installation, insert pieces of tinned wire into the holes framed by the contact pads of the minimum diameter and solder them to the printed conductors on both sides of the board. Instead of PQ20VZ51, you can use any microcircuit voltage regulator that allows you to get 3 V at the output (for example, LM317). Inductors L1-L3 any with an inductance of 10 μH. Inverters with open collector output DD1.1-DD1.6, DD2.1-DD2.3 can be K155, KR531, K555, KR1533 series. It is undesirable to replace the VS1001k chip with devices with other letter indices (previous versions), since they have a number of flaws.

Project files

Literature

  1. .
  2. Vasiliev N. PC interface expander. - Radio, 1994, - 6, p. 20, 21.
  3. VS1001k - MPEG AUDIO CODEC. - .
  4. VS1001 Frequently Asked Questions. - .

Author: V. Kardapolov, village Tbilisskaya, Krasnodar Territory

See other articles Section Computers.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

Artificial leather for touch emulation 15.04.2024

In a modern technology world where distance is becoming increasingly commonplace, maintaining connection and a sense of closeness is important. Recent developments in artificial skin by German scientists from Saarland University represent a new era in virtual interactions. German researchers from Saarland University have developed ultra-thin films that can transmit the sensation of touch over a distance. This cutting-edge technology provides new opportunities for virtual communication, especially for those who find themselves far from their loved ones. The ultra-thin films developed by the researchers, just 50 micrometers thick, can be integrated into textiles and worn like a second skin. These films act as sensors that recognize tactile signals from mom or dad, and as actuators that transmit these movements to the baby. Parents' touch to the fabric activates sensors that react to pressure and deform the ultra-thin film. This ... >>

Petgugu Global cat litter 15.04.2024

Taking care of pets can often be a challenge, especially when it comes to keeping your home clean. A new interesting solution from the Petgugu Global startup has been presented, which will make life easier for cat owners and help them keep their home perfectly clean and tidy. Startup Petgugu Global has unveiled a unique cat toilet that can automatically flush feces, keeping your home clean and fresh. This innovative device is equipped with various smart sensors that monitor your pet's toilet activity and activate to automatically clean after use. The device connects to the sewer system and ensures efficient waste removal without the need for intervention from the owner. Additionally, the toilet has a large flushable storage capacity, making it ideal for multi-cat households. The Petgugu cat litter bowl is designed for use with water-soluble litters and offers a range of additional ... >>

The attractiveness of caring men 14.04.2024

The stereotype that women prefer "bad boys" has long been widespread. However, recent research conducted by British scientists from Monash University offers a new perspective on this issue. They looked at how women responded to men's emotional responsibility and willingness to help others. The study's findings could change our understanding of what makes men attractive to women. A study conducted by scientists from Monash University leads to new findings about men's attractiveness to women. In the experiment, women were shown photographs of men with brief stories about their behavior in various situations, including their reaction to an encounter with a homeless person. Some of the men ignored the homeless man, while others helped him, such as buying him food. A study found that men who showed empathy and kindness were more attractive to women compared to men who showed empathy and kindness. ... >>

Random news from the Archive

Smartphones outsell conventional cell phones 21.08.2013

Gartner analysts summed up the results of the second quarter of 2013 in the cell phone market. The most important conclusion they reached is that smartphones have outsold conventional cell phones for the first time.

Overall, cell phone sales to end consumers from April to June totaled 435 million units. This is 3,6% more than in the same period of 2012. At the same time, sales of smartphones reached 225 million units, which corresponds to an increase of 46,5% over the year. Naturally, sales of conventional phones declined - by 21%. In absolute terms, they amounted to 210 million pieces.

Leadership among smartphone manufacturers is held by Samsung, which owns 31,7% of the market in the quarter. A year ago, the share of the South Korean manufacturer was 29,7%. In real terms, these figures correspond to 71,38 million units and 45,60 million units.

Apple for the year also managed to increase sales, but not so much: from 28,94 to 31,90 million units. As a result, the market share owned by this company decreased from 18,8% to 14,2%.

In third place is the company LG Electronics. In the second quarter of 2013, it shipped 11,47 million smartphones, securing 5,1% of the market. A year ago, LG Electronics' figures were 5,83 million units and 3,8%, respectively.

Fourth place belongs to Lenovo. During the year, this manufacturer was able to increase deliveries from 4,37 million pieces to 10,67 million pieces, as a result of which its market share increased from 2,8% to 4,7%.

Closes the top five largest manufacturers of smartphones, the company ZTE, which with deliveries in the amount of 9,69 million units took 4,3% of the market. A year ago, she managed to sell 6,33 million smartphones, which was then broadcast in 4,1% of the market.

It is easy to calculate that all other manufacturers combined sold 90,21 million smartphones, providing 40% of buyers with them.

Other interesting news:

▪ Chip MediaTek Helio P22

▪ B&K PRECISION Model 2650 Handheld Spectrum Analyzer

▪ head grows

▪ It's raining in the bowels of the earth

▪ Simulating a volcanic eruption

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ section of the site Encyclopedia of radio electronics and electrical engineering. Article selection

▪ biosphere article. History and essence of scientific discovery

▪ article On which side in World War II, besides the Third Reich, did Hitler fight? Detailed answer

▪ Article Responsibility of an employee in the field of labor relations and labor protection

▪ article About connecting apartment calls. Encyclopedia of radio electronics and electrical engineering

▪ article Low ripple rectifier. Encyclopedia of radio electronics and electrical engineering

Leave your comment on this article:

Name:


Email (optional):


A comment:





All languages ​​of this page

Home page | Library | Articles | Website map | Site Reviews

www.diagram.com.ua

www.diagram.com.ua
2000-2024