Design of Ultra-low Frequency Signal for AT89C52 Single Chip Microcomputer

Publisher:BlissfulMomentsLatest update time:2014-10-22 Source: 21icKeywords:AT89C52 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    Low-frequency and ultra-low-frequency signals are widely used in medicine, electrochemical research and experimental teaching. Especially in the field of electrochemistry, ultra-low-frequency signal generators have become an indispensable part of electrochemical instruments. Electrochemical instruments equipped with square wave, triangle wave and sine wave generators can study various transient behaviors of electrochemical systems; equipped with slow linear scanning signals or step wave signals, steady-state (or near-steady-state) polarization curve measurements can be automatically performed. However, there are few signal generators suitable for the field of electrochemistry on the market. Traditional signal generators cannot meet professional needs and the purchase cost is too high. This paper introduces a signal generator controlled by a single-chip microcomputer, which can output square waves, triangle waves and sine waves. The frequency range of the generated waveform signal is 0.125 mHz (millihertz) to 80 Hz, the output analog signal voltage range is -10 to +10 V, and the amplitude and frequency of the output signal have a certain adjustment range. Compared with the traditional signal generator, this signal generator has the following characteristics: this signal generator can meet the requirements of the electrochemical field for signal generators, the lowest frequency can reach 0.125 mHz, reaching the advanced level in China, and the signal generator has high precision, low distortion, stable performance, simple circuit structure and small size at ultra-low frequency.

1 Working principle
    The input parameters of the ultra-low frequency signal generator include scanning mode, upper and lower limit levels, and waveform frequency. Among them, the scanning mode has three options: single, round trip, and continuous; the upper and lower limit levels are between -10 and +10 V, and the upper limit level is greater than the lower limit level; the waveform frequency range is 0.125 mHz to 80 Hz. There are three output waveforms: square wave, triangle wave, and sine wave. When the signal generator is powered on, it is reset and cleared first, and then the system is initialized. The user inputs parameters such as scanning frequency, upper and lower limit levels, and scanning mode into the single-chip microcomputer through the keyboard, and displays them through the LCD. According to a certain algorithm, each functional module is accurately adjusted, and the analog switch that controls the instrument in the integral circuit module is disconnected to start the signal generator to output the required signal waveform.

2 Waveform Generation Principle
    The signal generator can generate continuous square waves, triangle waves and sine waves with adjustable frequency and peak-to-valley values. The following is a detailed introduction to the generation principles of the three waveforms.
2.1 Sine Wave Generation Principle
    Since the lowest frequency of the signal generator can reach 0.125 mHz, the traditional sine wave generation circuit can no longer meet the requirements. The instrument uses a 16-bit digital/analog converter DAC8532 to generate sine waves. Compared with the RC bridge sine wave oscillation circuit and the LC sine wave oscillation circuit, this method is simple, reliable and has high stability.
2.2 Square Wave Generation Principle
    The traditional square wave generation circuit consists of a hysteresis comparator with an inverting input and an RC circuit. The RC loop serves as both a delay link and a feedback network, and the automatic conversion of the output state is achieved through RC charging and discharging. However, the generated square wave cannot meet the requirements of ultra-low frequency, and the amplitude and frequency of the waveform are difficult to adjust. The square wave generating circuit of this system is generated by the continuous conversion of CMOS analog switch. The circuit uses ADG201A as the analog switch. When the switch is open, the circuit outputs a high level; when the switch is closed, the circuit outputs a low level. The amplitude of the square wave
is determined , and the period is determined by the frequency of the analog switch conversion. The circuit is simple and can meet the requirements of ultra-low frequency. Moreover, the square wave generated by the circuit is a continuous analog waveform, and the amplitude and frequency are easy to adjust.
2.3 Principle of triangular wave generation
    The triangular wave of this signal generator is generated by an integration circuit. Unlike the traditional triangular wave generating circuit, the generation process of this triangular wave is a closed-loop control system, as shown in Figure 1. The square wave generating circuit controls the integration direction of the integration circuit. The output of the integration circuit is sent to the comparator for comparison with the upper and lower limit levels input by the user, and the comparison result is sent to the RS trigger. When the output of the integration circuit is higher than the upper limit level input by the user (or lower than the lower limit level), the RS trigger controls the square wave generating circuit to reverse its output voltage, and continues to send the output of the integration circuit and the upper and lower limit levels input by the user to the comparator for comparison, and repeats the process over and over again, thereby outputting the waveform of the required signal.

 

3 Hardware Circuit Design
3.1 Hardware Circuit Design Based on AT89C52
    The circuit block diagram is shown in Figure 2.

 


3.2 LCD display circuit
    Previously, LEDs were commonly used in display terminals, but they were gradually eliminated because they could not conveniently display Chinese characters and graphics. This signal generator uses the OCM4X8C LCD display module for display. OCM-4X8C is a graphic dot matrix LCD display module with a serial/parallel interface and a Chinese character library inside. The control driver of this module adopts the ST7920 of Taiwan Silicon Creation Electronics Company, so it has a strong control and display function.
     The LCD screen of OCM4X8C is 128×64 dot matrix, which can display 4 lines, 8 Chinese characters per line. In order to facilitate the simple and convenient display of Chinese characters, the module has a 2 Mb Chinese font CGROM, which contains 8 192 16×16 dot matrix Chinese font libraries; at the same time, in order to facilitate the display of English and other commonly used characters, it has a 16 Kb 16×8 dot matrix ASCII character library. The LCD display circuit is shown in Figure 3. LEDA is the positive pole of the backlight source of the LCD display module, connected to the +5 V power supply; LEDK is the negative pole of the backlight source, connected to the ground; PSB controls the serial/parallel connection mode. When the PSB pin of the module is connected to a low level, the module enters the serial interface mode. The serial mode uses the serial data line R/W, the serial clock line E and the chip select terminal RS to transmit data, which constitutes a 3-wire serial mode. According to the serial operation timing programming, the display can be displayed. [page]


3.3 E2PROM circuit
    Serial E2PROM is an online electrically erasable and writable memory, with small size, simple interface, reliable data storage, online rewrite, low power consumption, and low voltage writing. It is widely used in single-chip microcomputer systems. E2PROM can be used to store the initialization state table of the signal generator. After the single-chip microcomputer is reset and cleared, the table is directly called to initialize the system. The connection circuit between AT24C64 and single-chip microcomputer is shown in Figure 4.

 



4 System Software Design
    The software program is the core of realizing the ultra-low frequency signal generator. It accurately adjusts the digital potentiometers that control the upper and lower limits of the level and the DAC8532 that controls the input voltage according to the keyboard input parameters, so that the signal generator can work normally. The software flow is shown in Figure 5.

Keywords:AT89C52 Reference address:Design of Ultra-low Frequency Signal for AT89C52 Single Chip Microcomputer

Previous article:Traffic light design based on single-chip multi-computer communication
Next article:A Design Scheme of Digital Voice Thermometer

Recommended ReadingLatest update time:2024-11-16 21:24

Design of Data Collector Based on Small-RTOS51
introduction   With the development of embedded systems, embedded software design is moving closer to software platforms. Microcontroller software design is no longer a single-threaded structure, but gradually adopts a multi-tasking design concept. The real-time kernel is also called a real-time operating system or
[Microcontroller]
Design of Data Collector Based on Small-RTOS51
Important knowledge map of AT89C52 microcontroller
Memory space distribution diagram Internal RAM distribution diagram So the special function registers SFR Reset value of SFR PSW Program Status Word Register Power Control Register PCON TCON (Timer Control): Mainly for timer/counter interrupt flag control and external interrupt control   T2CON SCON (
[Microcontroller]
Important knowledge map of AT89C52 microcontroller
Design of Digital Controlled DC Current Source Based on AT89C52
The digitally controlled DC current source designed in this paper can effectively reduce the output error caused by aging of components, temperature drift, etc., and has the functions of output current between 20-2000mA (adjustable), preset output current, and direct display of output current signal. The hardwar
[Microcontroller]
Design of Digital Controlled DC Current Source Based on AT89C52
AT89C52 single chip eight-way voltage meter C program
/************************************************************************/  // Eight-way voltmeter C program  /************************************************************************/  /*Use AT89C52 single-chip computer, 12MHz crystal oscillator, P0 port reads AD value, P2 port is used for AD control, use common anod
[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号