Application of sound chip CS4235 in DSP embedded system

Publisher:岭南布衣Latest update time:2012-07-14 Source: 单片机与嵌入式系统应用 Keywords:CS4235 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

introduction

Sound card technology is one of the key technologies of multimedia computer technology. Its emergence makes computers more expressive. At present, the sound quality of embedded systems is relatively poor due to the simple structure and low sampling rate of the recording and playback chips used, which is far from meeting people's requirements for high-end embedded systems for life and learning. If sound card technology can be applied to embedded systems, the sound quality of the entire system will surely rise to a new level due to the powerful functions of the sound card. Through analysis, the interface principle of WSS (Windows Sound System) compatible sound card and PC ISA bus, we apply the sound effect chip CS4235 in it to the embedded system based on DSP. The reason for not using the ready-made sound card but using the sound effect chip on it is that it is more flexible and convenient to design, and the corresponding functions can be added or deleted according to the needs of the system; the reason for not using the MCS51 series but using DSP is that the sound card operation requires too many system resources, and MCS51 does not have this ability, otherwise the hardware interface circuit will be quite complicated.

1 CS4235 Principle and Structure

1.1 How Sound Cards Work

Figure 1 shows the basic working principle of a sound card: the host sends the digitized sound signal to the digital-to-analog converter (D/A) in PCM format through the bus, which converts the digital signal into an analog audio signal; at the same time, the input signal from the microphone or CD can be converted into a digital signal through the analog-to-digital converter (A/D) and sent to the computer for various processing. 1.2 CS4235 Functional Structure

WSS is an audio subsystem standard defined by multimedia extensions in the Windows environment proposed by Microsoft to unify the sound card standard and ultimately provide convenience for applications. It includes hardware platform and software interface [1]. CS4235 is a sound card core chip that adapts to WSS and provides an ISA bus interface. Except for sound acquisition and playback, all other controls rely on the host; it takes up more host time, but the cost is relatively low. The functional block diagram of CS4235 is shown in Figure 2. As can be seen from Figure 2, CS4235 is a complete audio subsystem integrated circuit that provides 16-bit stereo ADC and DAC, on-chip reconfigurable digital filters, analog and digital mixers with programmable gain and attenuation values, optional serial interfaces, and full-duplex channels with simultaneous recording and playback capabilities. For the documentation of CS4235, see Reference [2].

Due to space limitations, the analog hardware of CS4235 is not introduced here, but the digital hardware interface between CS4235 and DSP is mainly studied. Since TMS320F206 (F206 for short) is a low-cost, high-performance 16-bit fixed-point digital signal processor (DSP), it has a very high cost-performance ratio and has become an ideal substitute for high-end single-chip microcomputers. It has been widely used in the fields of communication, voice processing, military, instrumentation, image processing, etc. [3], so F206 is selected as DSP in the system. The 8-bit parallel interface provided by CS4235 is compatible with the ISA bus. Is it also compatible with the external expansion bus of DSP? Table 1 lists the signal pins and brief descriptions of the CS4235 and ISA bus interfaces, and also lists the corresponding pins of F206. As can be seen from Table 1, in order to realize the direct operation of DSP on CS4235, the DSP system must provide the above-mentioned ISA bus signals. DSP chips generally provide data signal lines, address signal lines, I/O read/write signal lines, and READY signal lines, and also have multiple interrupt input pins; but they do not directly have DMA function pins, which brings inconvenience to the interface between DSP and CS4235, and is also the main problem to be solved in this paper. Table 1 Signal pins of CS4235 and ISA bus interface

Signal pin Brief description DSP (F206) corresponding pins
SD<7:0> Bidirectional system data bus D<7:0>
SA<11:0> System address bus A<11:0>
IOR I/O Read Command Decoding IS and RD yields IQW=IS+WR
IOW I/O write command none
AEN Address enable signal READY
IOCHRDY I/O channel ready INT2 (In actual application, only one interrupt line needs to be selected to connect to DSP)
IRQ Interrupt request signal: IRQA=IRQ5, IRQB=IRQ7 IRQC=IRQ9, IRQC=IRQ11, IRQD=IRQ11
IRQE=IRQ12, IRQF=IRQ15, IRQG=IRQ10
none
DRQ DMA request signal: DRQA=DRQ0
DRQB=DRQ1 DRQC=DRQ3
none
DACK DMA response signal: DACKA=DACK0 DACK1=DAC, DACKC=DACK3 RS
RESET Sound card reset signal

2 Hardware interface between DSP and CS4235

2.1 F206 Direct Memory Access Using HOLD Operation

The key to F206 realizing DMA function is that this type of chip provides two signal pins: HOLD/INT1 and. The HOLD operation process controlled by these two signals is as follows. [page]

①. An external device can drive this pin to a low level to request control of the external bus. If the HOLD/INT1 interrupt line is enabled, this will trigger an interrupt.

②, in response to an interrupt, the software logic can cause the processor to send a response signal, indicating that it will give up control of its external bus. According to, the external address signal (A15~A0), data signal (D15~D0) and memory control signal () are set to a high impedance state.

From ① and ②, it can be seen that the HOLD operation of F206 allows direct memory access to external programs, data, and I/O space, but this function is implemented in the INT1 interrupt program, so the interrupt line INT1 should be sensitive to both falling and rising edges. When F206 detects a falling edge, it completes the current instruction being executed, and then forces the program control to the interrupt service subroutine, which executes the IDLE instruction. According to IDLE, it becomes valid and the external bus is set to a high-impedance state. Only after detecting a rising edge on the HOLD/INT1 pin, the CPU exits the IDLE state, becomes invalid, and returns the external bus to a normal state.

From the above analysis, we can see the difference between the DMA operation of F206 and the DMA operation in PC. In PC, after the CPU receives the DMA request signal, it forces the CPU to put its address, data and some control pins in three states after the current bus cycle ends, thereby giving up the control of the bus and giving a DMA response signal; after the DMA operation is completed and the DMA request signal is invalid, the CPU resumes control of the system bus. In C2XX, the DMA request signal will cause F206 to interrupt, and a software instruction is issued in the interrupt program to make the signal pins of F206 in three states, and also give a DMA response signal; after the DMA operation is completed, but F206 detects that the DMA request signal is invalid, although the bus returns to the normal state, F206 is still in the interrupt program. From the above analysis, we can see that although the interrupt needs to protect the breakpoint and the scene, making the DMA processing speed of F206 much lower than that of PC, after all, F206 also implements DMA operation, so it can use the DMA controller 8237 to realize DMA operation access to the sound card.

2.2 Interface circuit between DSP and DMA controller 8237

8237 is a high-performance programmable DMA controller chip that can be easily connected to the CPU to achieve direct data exchange between external devices and memory. Its internal structure and pin signals can be found in reference [4]. The controller can provide various types of control features through programming to optimize system performance and increase data throughput. The maximum data transmission rate can reach 1.6 MB/s. Figure 3 shows the main circuit of the interface between F206 and 8237, in which the DMA request signal HRQ sent by 8237 to DSP to control the bus is sent to the HOLD/INT1 pin of DSP after being decoded by GAL16V8; similarly, the DMA response signal of DSP is also decoded by GAL16V8 and sent back to the HLDA pin of 8237. The function of the address latch 74LS573 is to latch the high 8-bit address A8~15 output by 8237 through data lines D0~7 during the DMA service cycle. Since DSP does not directly provide the , , and signals, these signals can only be obtained by GAL16V8 decoding.

The circuit shown in Figure 3 provides 4 channels of peripheral request DMA service signals, and the 8237 directly has an AEN pin, which meets all the requirements in Table 1, so that the interface between DSP and sound card can be correctly implemented. In actual work, we set DREQ1 and DACK1 of 8237 as the playback channel of the sound card according to the use of the sound card in the PC, and DREQ3 and DACK3 of 8237 as the acquisition channel of the sound card. The interrupt request signal IRQ7 of the sound card is reversed by GAL16V8 and connected to the pin of DSP.

2.3 System working principle and timing

The DMA operation process of the DSP system shown in Figure 3 on the sound card can be described by Figure 4, and the working sequence is shown in Figure 5. Now, in combination with Figures 4 and 5, the system working principle and operation sequence are explained as follows:

① CS4235 sends a DMA request signal DREQ to the DMA controller 8237;

② 8237 sends a bus request signal HRQ to DSP;

③ After the DSP pin detects the falling edge, it enters the INT1 interrupt. After protecting the breakpoint and the scene, it sends the IDLE instruction. The DSP pin level becomes low and responds to the external DMA request.

④ After 8237 takes over the bus, it first sends a DMA request response signal DACK to CS4235, indicating that CS4235 is allowed to perform DMA transfer. Then, according to the pre-set initial address and the number of bytes to be transferred, it sends the address and read and write commands in sequence, so that data can be directly exchanged between RAM CS4235 until all data are exchanged. [page]

⑤After the DMA transmission is completed, the bus request signal HRQ to the CPU is automatically canceled. At this time, the DSP detects the rising edge of the pin, and the DSP returns to the next instruction of the IDLE instruction. The DSP obtains control of the bus and continues to execute the program in INT1.

3 Software Interface between DSP and CS4235

The ISA bus interface of CS4235 is plug-and-play (PnP). The sound card must be activated by programming before the sound card registers can be directly accessed and configured to complete different tasks. In fact, the ISA slot designed for the old ISA card that is not PnP is also suitable for PnP cards. Only the corresponding changes need to be made in the software. The recognition process of DSP for PnP card is exactly the same as the recognition process of microcomputer for PnP card. Figure 6 shows the recognition program flow of DSP for PnP card. From the above PnP card recognition and configuration process, it can be seen that if it is in a PC environment, then this process can be completed automatically; in the system designed by the user, this process is somewhat cumbersome and not very meaningful. Can we bypass the PnP protocol and program each PnP card directly, just like the old ISA card? In fact, most chips do provide this simple and fast method, collectively referred to as the "certain company keyword" interface method. This article introduces this interface technology using CS4235 as an example. After completing the five steps given below, the sound card will operate the same as the old ISA sound card. The only drawback is that this method will not work if two sound cards of this type are used in the system.

① DSP sends 32 bytes of "Crystal Key" to address port 279H, and the PnP card immediately enters the configuration state. The 32 bytes of data are:

96, 35, 9A, CD, E6, F3, 79, BC, 5E, AF, 57, 2B, 15, 8A, C5, E2;

F1, F8, 7C, 3E, 9F, 4F, 27, 13, 09, 84, 42, A1, D0, 68, 34, 1A.

② DSP sends the handle number to 279H.

③ The DSP directly configures the configuration registers of each logic device to set the I/O port base address, interrupt number, and DMA channel selection.

④ DSP sends 79H to 279H to activate CS4235.

⑤ DSP prohibits the PnP card from participating in future PnP cycles.

After the above configuration is completed, CS4235 automatically exits the configuration state and enters normal operation, so that the registers of CS4235 can be directly programmed according to specific functional requirements.

Conclusion

In the fully digital language learning system, we use the sound effect chip CS4235 to replace the previously used voice recording and playback chip MSM6588. Although the hardware circuit design and software operation are much more complicated, the important indicators of the language learning system, such as passband, signal-to-noise ratio and distortion, have reached the sound quality standard of multimedia computers. Practice has shown that many key technologies and excellent design ideas in microcomputers can be transplanted into embedded systems, making embedded systems more colorful.

Keywords:CS4235 Reference address:Application of sound chip CS4235 in DSP embedded system

Previous article:Design of Enhanced Parallel Port EPP and DSP Interface
Next article:Improving the anti-interference of MCU: How to avoid detours in your design

Recommended ReadingLatest update time:2024-11-16 17:37

Design of Interface between High-speed DSP and Serial A/D Converter TLC2558
Abstract: According to the characteristics of high-speed fixed-point DSP chip TMS320F206, it is proposed to use serial A/D converter TLC2558 as the analog input part of DSP system, which solves the problem that the A/D converter based on parallel data transmission can not cooperate well with high-speed DSP. On
[Embedded]
Using DSP to obtain digital images from analog video signals
Introduction   There are many ways to obtain image sources in image processing systems, and there are also various sensors for the same image. The more popular sensors now include CCD, CMOS, CIS, etc. These sensors have different image data output formats. For example, CCD outputs analog signals, which require A/D sam
[Embedded]
DSP implementation of jitter measurement
introduction In recent years, jitter has become a signal characteristic that communication engineers attach great importance to. In digital systems, clock frequencies are becoming higher and higher. As the rate increases, small changes in the rising or falling edge become more and more important. Because clock or da
[Test Measurement]
Design and implementation of a USB and DSP fingerprint recognition system
The immutability and uniqueness of fingerprints make fingerprint recognition technology the most widely used identity authentication. In recent years, with the development of the latest information processing technology, the research of algorithm theory, and the high integration and low cost of computer hardware, the
[Embedded]
Design and implementation of a USB and DSP fingerprint recognition system
Remote Upgrade Method of DSP TMS320F2812 Program
TMS320F2812 (F2812 for short) is the highest performance chip in the C2000 series launched by TI. It is also the most advanced and powerful 32-bit fixed-point DSP chip in the DSP field. It has both digital signal processing capabilities and powerful event management capabilities and embedded control functions. It has a
[Embedded]
Design of a bipedal robot prototype based on TMS32OF2812 DSP
0 Introduction The bipedal robot prototype is an experimental object for studying bipedal walking. In order to carry out the research smoothly, the robot's degrees of freedom, drive mode, weight, height, etc. must be properly configured; this requires a simple and reasonable distribution of degrees of freed
[Embedded]
Design of RS422 communication for dual DSP system of an optoelectronic tracking product
0 Introduction The development of the information society depends to a large extent on the advancement of information and signal processing technology. The emergence of digital signal processing technology has changed the entire face of information and signal processing technology; and as the core technology o
[Embedded]
Design of RS422 communication for dual DSP system of an optoelectronic tracking product
What are the differences between ARM7 and ARM9 and the characteristics and differences between ARM, FPGA, and DSP?
1. Talk about the difference between ARM7 and ARM9: This article is written for beginners who are ready to learn ARM technology, but have not decided whether to learn ARM7 or ARM9 or do not know the difference between ARM7 and ARM9. I hope this article is useful to you. Due to my profession, I often answer questions
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号