1 Overview
S3CK215 is a high-performance microcontroller produced by Samsung in South Korea. It uses the newly developed 8-bit CPU╟╟CalcRISPC as the core. The chip not only includes ROM, RAM, timer, I/O interface and interrupt control unit, but also integrates very useful functional units such as LCD control driver, amplifier and A/D, D/A converter (for example, LCD control driver can directly drive LCD display screen with up to 120 dots). Since these units expand the functions of the single-chip microcomputer, when designing circuits using this single-chip microcomputer, only simple external circuits need to be added to form a complete single-chip microcomputer system, and it has low power consumption, small size and high system reliability. In addition, Samsung also provides a set of effective development tools and online simulators for the application of S3CK215, which facilitates the designer's software and hardware design based on S3CK215.
This article introduces a tuner circuit designed using S3CK215. After collecting the sound signal produced by the instrument, the tuner can calculate the sound frequency and display its deviation from the ideal frequency, which can then be used as the basis for adjusting the instrument to make it produce standard sound.
2. Introduction of S3CK215
Figure 1 is the internal structure module diagram of S3CK215. As can be seen from Figure 1, the microcontroller has the following characteristics:
●Use Calm RISC as the central processing unit;
●Contains eight-bit multiplier;
●Hardware stack with a depth of 16 levels, each level is 16-bit wide;
●With LCD drive controller;
●With 10-bit A/D converter and 9-bit D/A converter;
●Contains two operational amplifiers.
2.1 Calm RISC Processor
Calm RISC is a new 8-bit low-power RISC microprocessor developed by Samsung. It meets the Harvard architecture and has independent program memory and data memory. Its instructions and data can be accessed simultaneously through their own paths.
The internal structure of CalmRISC includes an 8-bit ALU, 16 general registers, 11 special registers, 16-level hardware stack, program memory address generation unit, and data memory address generation unit. The 16 general registers are divided into four groups (Bank 0-Bank 3), each group includes four 8-bit registers (R0, R1, R2, R3). The special registers include status registers, link registers, and data memory index registers. In addition to being used as a temporary data storage space, the 16-level hardware stack in CalmRISC can also be used for low-power stack operations.
CalmRISC has a three-stage pipeline. Figure 2 shows a three-stage pipeline diagram of the Calm-RISC processor. The operation of CalmRISC can be carried out using the register-memory instruction set. When operating, first fetch the instruction (IF) and point the program counter (PC) to the instruction address, then put the instruction into the instruction register (IR), then perform instruction decoding and data memory reading (ID/MEM), and execute the instruction and write back (EXE/WB) at the same time. Finally, the ALU executes the instruction and writes the instruction execution result into the target register.
The schematic diagram of CalmRISC using pipeline operation is shown in Figure 3. In the figure, the next instruction can be fetched immediately after the previous instruction is fetched, without waiting for the previous instruction to be executed. In fact, most CalmRISC instructions are single-byte instructions, and the instruction fetch operation only takes one clock cycle to complete; however, jump instructions such as "CALL" and "JP" are double-byte instructions, and their instruction fetch operations require two clock cycles.
2.2 8-bit multiplier
S3CK215 integrates an 8-bit multiplier. By setting the multiplier control register (MULCON), it can support 8-bit signed or unsigned multiplication operations, and only two clock cycles are needed to output the operation result. It consists of operand registers (MXINPMYINP), result registers (MRHMRL) and 8-bit multiplier. The program segment that calls the multiplier to implement multiplication is as follows:
LD R0,#01H
LD MULCON,RO ; ation
LD R0,#32H
LD R1, # 0 CE H
LD MXINP,R0
LD MYINP,R1 ;Multiple automatic after loa ding MXINPMYINP
NOP
NOP
LD R2,MRH ;The multiplication process is fineshed aft er 2 cycles
LD R3,MRL ;MRH/MRL=28H/3CH[page]
2.3 Operational Amplifier
There are two operational amplifiers in S3CK215, MIC amplifier and filter amplifier. One is used to filter noise from the input signal to improve the signal-to-noise ratio, and the other is used to amplify the input signal for subsequent signal processing. Of course, these amplifiers can be defined according to user needs. In fact, the amplifier module includes a filter amplifier, a MIC amplifier, an amplifier control register, and a reference voltage generator.
2.4 A/D and D/A Converters
S3CK215 integrates a 10-bit analog-to-digital converter (A/D) and a 9-bit digital-to-analog converter (D/A). The conversion process of the A/D converter requires 50 clock cycles. The analog signal input port is multiplexed with I/O Port 2 (8-bit I/O port). The control register of Port 2 (P2CONHP2CONL) can determine whether Port 2 is used for the analog signal input of the A/D converter, and the control register of the A/D converter (ADCON) can control the selector to determine which bit of Port 2 is used as the A/D input port. The analog level value of the input signal should be between AVREF and AVSS.
The main body of the 9-bit D/A converter is an R-2R array structure, which consists of an R-2R array structure, a D/A control register, a D/A data register, a D/A output port, etc.
3 Application of S3CK215 in Tuner
The application circuit of S3CK215 microcontroller in the tuner is shown in Figure 4. As can be seen from the figure, using S3CK215 only requires a simple circuit design to achieve the required functions. First, the sound analog signal is collected through the MIC, and the signal is filtered and amplified using the on-chip operational amplifier; then the digital signal is obtained through the A/D converter and processed to obtain the frequency information of the sound signal, and at the same time it is converted into the corresponding note name, scale and cent value, and finally the result is output to the LCD for display through the on-chip LCD control driver.
This circuit design makes full use of the on-chip special function modules provided by S3CK215. It can move the signal amplification and A/D conversion that previously needed to be implemented outside the chip to the chip, thereby greatly simplifying the circuit design, improving the system integration, reducing power consumption, and making the system more stable and easier to maintain.
Figure 5 shows the software design flow chart of the tuner. The software uses interrupts to perform data sampling, which greatly simplifies program design. The specific method is that after the main program is initialized, the timer is set according to the data sampling rate and the timer generates an internal interrupt. Then, the input port is read in the interrupt handler as the data sampling value. After obtaining enough sampling points, the interrupt is turned off to return to the main program. The main program then processes the sampled data and finally displays the effective processing results on the LCD.
4 Conclusion
The tuner system implemented by the author using the S3CK215 simulator has achieved relatively good results after actual testing. Actual use has proved that the tuner based on the S3CK215 chip has the characteristics of simple circuit, low power consumption and low cost compared with similar products, and has certain practical development value.
Previous article:Chipsea microcontroller external interrupt program
Next article:Taking DAC0832 as an example, explain the difference between single buffering and double buffering of D/A?
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Brief analysis of the application principles of common protective devices in security products
- In the LM5118 datasheet, Application and Implementation section, "Minimum load current (CCM operation) = 600mA", what does it mean?
- Autonomous low-power Tesla coil "Experimental"
- What medium is used to start the pins when they are all low level?
- Is ADI technology still here?
- Hot topic: 2019 College Entrance Examination: What impact will the arrival of the 5G era have on the college entrance examination and universities?
- 12/06 @Shanghai World Peace Group ADAS-NXP S32V in-depth technical seminar invites you to participate!
- Showing off my products + the boards I have played with over the years + DIY boards
- EEWORLD University Hall----Live Replay: The coming is coming, typical applications in the era of the Internet of Things: Maxim's easy-to-understand low-power MCU
- Free trial: ST dual-core wireless MCU STM32WB55 development board