8-bit microcontroller S3CK215 with CalmRISC and its application

Publisher:静心静气Latest update time:2013-04-12 Source: dzscKeywords:CalmRISC  Tuner  S3CK215 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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 (MXINPMYINP), result registers (MRHMRL) 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 MXINPMYINP

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 (P2CONHP2CONL) 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.

Keywords:CalmRISC  Tuner  S3CK215 Reference address:8-bit microcontroller S3CK215 with CalmRISC and its application

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?

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号