Digital recording and playback using SPIO061A's SIO

2018-08-05 08:01:13

This article refers to the address: http://

Author EMAIL:

SPCE061A is a new type of 16-bit single-chip microcomputer produced by Taiwan Lingyang Co., Ltd. This MCU is rich in resources and has a very high cost performance. SPCE061A has programmable audio processing function, and has serial port input and output port SIO (it provides a 1-bit serial interface for data communication with other devices). This article introduces these two resources using SPCE061A and Serial interface FLASH (SPR1024) to develop digital recording and playback systems.

This system uses only 5 IO ports, and there are many resources that are not used. Therefore, developers can extend the system's functions based on this, for example, using the SPCE061A universal asynchronous serial interface UART to communicate with the PC, or using other IO ports to external USB devices to achieve USB communication with the PC. , making complex recording and playback systems.

3.1 System Structure

The system block diagram is shown in Figure 3.7. It is mainly composed of four parts: key input, audio input, audio output and SPR1024 storage expansion.

This system mainly uses SPCE061A MCU and SPR1024 FLASH chip. SPR1024 is also produced by Taiwan's Lingyang Technology Co., Ltd. It is a serial interface FLASH, which is a 40-pin DIP package IC. Its operating voltage range is 2.7V~3.6V, the storage capacity is 128K * 8 bits, and the internal structure of FLASH is 1k byte for one page, a total of 128 pages. The pin connected to IOC0 and IOB1 of SPCE061A is 21pin SCLK and 4pin ADPAD.

SPCE061A is a 16-bit single-chip microcomputer with high cost performance and abundant resources. It can be used to realize the voice recording and playback system very conveniently. The SPCE061A's A/D converter has eight channels, one of which is the MIC-IN input, which is specifically designed to sample speech signals. The voice signal is converted into an electrical signal by Mic, and the DC component is separated by a DC blocking capacitor, and then input to the SPCE061A internal preamplifier. SPCE061A internal automatic gain control circuit AGC can track and monitor the audio signal level of the preamplifier output at any time. When the input signal increases, the AGC circuit automatically reduces the gain of the amplifier; when the input signal decreases, the AGC circuit automatically increases the amplifier. The gain is such that the signal entering the A/D is maintained at an optimum level, which in turn minimizes clipping. 2-way 10-bit precision DA, only need external power amplifier (LM386) circuit to complete the voice playback.

The hardware connection diagram of the system is shown in Figure 3.8. The three buttons in the figure control the three processes of recording, stopping and playing the system. Press the Record button to collect voice data, and then store the voice data to SPR1024 after encoding; press the Stop button to stop recording; press the Play button to play the recorded voice.

Figure 3.8 Hardware Connection Diagram

3.3 software design

The system software design flow chart is shown in Figure 3.9:

The codec of the recording and playback is done by calling the library function, and we do not need to design the hardware circuit. Sunplus provides a wealth of library functions, we can easily complete the voice recording and playback as long as we understand the use of library functions. This system uses the audio format SACM_A2000 provided by Sunplus. Its compression coding rate is 16Kbit/s, so it can be calculated that 1Mbit memory can store 1M/16K = 64 seconds of voice data. There are many kinds of audio formats in Sunplus. Due to the length of the text, we will not elaborate on them here. Please refer to the relevant materials.

The underlying driver of the system includes IO port initialization, SPR1024 read and write, and erase using the assembly language. The upper layer program including voice recording and playback is written in C language. The program encapsulates the operation of the SPR1024 chip in the form of functions. The upper layer program can easily call these functions to implement SPR1024 read/write and erase operations. These are mainly from the Lingyang 16-bit MCU with a set of efficient instruction system and integrated development environment that is easy to learn and use. In this environment, the standard C language is supported, and the C language and the Sunplus assembly language can be called each other.

3.4 Summary

The 16-bit single-chip microcomputer SPCE061A of Lingyang Company is a novel MCU with novel style and high cost performance. It has a 16-bit Ã— 16-bit multiply operation instruction with higher operation speed; an inner product operation instruction with DSP function; has audio processing function; has 8-bit machine price, 16-bit single-chip performance â€¢â€¢â€¢â€¢â€¢â€¢

This system is only a basic application of SPCE061A. Designers can implement functions such as voice repeater, follower, answering machine, and telephone recorder as long as the system's circuit and program are slightly modified.

Upon receiving the package, please open the lid to find the power cord and measuring cup. â€¢ Featuring a large 300 ml water tank, the Essential Oil Diffuser can work continuously for 8 hours straight and provide a whole night of cool misting. â€¢ One convenient button sets the oil diffuser timer to 1 hour, 3 hours, 6 hours, or continuous on. â€¢ Seven pleasant colors of LED lights in warm, cool, and soft hues give your ambience an elegant, vibrant, and refreshing touch. â€¢ The Aromatherapy Diffuser shuts off automatically when detecting low water to protect both you and the device. â€¢ With strong and light mist output, the Aroma Diffuser can be used however you want. â€¢ Turn off the light to enjoy pure misting while having a full night`s carefree sleep.