Design of Oscilloscope Monitoring Program Based on C8051F020

Publisher:大酉幽华1Latest update time:2012-06-27 Source: 21ic Keywords:DS18B20  AT89C2051  USB Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Design Overview

This design uses the USB port as the power supply port, uses the DS18B20 temperature sensor to collect temperature information, uses the AT89C2051 single-chip microcomputer for control, and uses a four-digit common anode digital tube display to achieve temperature measurement and display (the system block diagram is shown in Figure 1). This design can cultivate students' interest in learning single-chip microcomputers and improve their production and programming capabilities.

System Block Diagram

Figure 1 System Block Diagram

2. Circuit Principle

The PROteUS simulation software is used for schematic design and program simulation. The circuit is shown in Figure 2.

Figure 2 Circuit diagram

Figure 2 Circuit diagram

1. Power supply

The USB port is used for power supply. The USB adapter can be connected to the USB port of the circuit board or directly to the USB port of the computer . In this way, resources can be saved and a more ideal working voltage can be obtained. The appearance of the USB port and the definition of the power port are shown in Figure 3.

USB port appearance and power port definition

Figure 3 USB port appearance and power port definition

2. Temperature signal acquisition

The DS18B20 (see Figure 4 for appearance) intelligent digital temperature sensor is used as the temperature signal acquisition device.

DS18B20 Appearance

Figure 4 DS18B20 appearance

(1) Working principle of DS18B20

The read/write timing and temperature measurement principle of DS18B20 are the same as those of DS1820, except that the number of bits of the obtained temperature value is different, and the delay time of temperature conversion is reduced from 2s to 750ms. The temperature measurement principle of DS18B20 is shown in Figure 5. Among them, the oscillation frequency of the low temperature coefficient crystal oscillator is little affected by temperature, and is used to generate a fixed frequency pulse signal to counter 1. The oscillation frequency of the high temperature coefficient crystal oscillator changes significantly with temperature, and the generated signal is used as the pulse input of counter 2. Counter 1 and the temperature register are preset to a base value corresponding to -55℃. Counter 1 subtracts the pulse signal generated by the low temperature coefficient crystal oscillator. When the preset value of counter 1 is reduced to 0, the value of the temperature register will be increased by 1, counter 1 will be re-preset, and the pulse signal generated by the low temperature coefficient crystal oscillator will be counted again. This cycle continues until counter 2 counts to OH and stops accumulating the temperature register value. At this time, the value in the temperature register is the measured temperature. The slope accumulator in FIG5 is used to compensate and correct the nonlinearity in the temperature measurement process, and its output is used to correct the preset value of counter 1.

Figure 5 DS18B20 temperature measurement schematic

Figure 5 DS18B20 temperature measurement principle diagram [page]

(2) Main features of DS18B20

1) The adaptable voltage range is 3.0V~5.5V, and it can be powered by the data line in parasitic power supply mode.

2) Only one line is needed between DS18B20 and microprocessor for two-way communication.

3) Support multi-point networking function, multiple DS18B20 can be connected in parallel on the only three wires to achieve multi-point temperature measurement in networking.

4) No peripheral components are required, all sensor elements and conversion circuits are integrated in a circuit that looks like a transistor.

5) The temperature measurement range is -55℃~+125℃, and the accuracy is ±0.5℃ at -10℃~+85℃.

6) The programmable resolution is 9 to 12 bits, and the corresponding resolvable temperatures are 0.5°C, 0.25°C, 0.125°C and 0.0625°C, respectively, which can achieve high-precision temperature measurement.

7) At 9-bit resolution, it takes a maximum of 93.75ms to convert the temperature to digital, and at 12-bit resolution, it takes a maximum of 750ms to convert the temperature value to digital.

8) Directly output digital temperature signal and transmit it serially to CPU via a one-wire bus . CRC check code can also be transmitted at the same time, which has strong anti-interference and error correction capabilities.

9) When the power polarity is reversed, the chip will not burn out due to heat, but it will not work normally.

DS18B20 follows the single bus protocol. Each temperature measurement must go through four processes: initialization, transmission of ROM commands, transmission of RAM commands, and data exchange.

3. AT89C2051 microcontroller

The AT89C2051 microcontroller is used as the main control component (see Figure 2).

4. Digital tube display

A four-digit common anode digital tube is used for dynamic display, and the temperature display is retained to one decimal place. When programming, P3.2~P3.5 is used as the bit selection end of the dynamic display of the digital tube, and Pl.0~Pl.7 is used as the segment selection bit of the dynamic display of the digital tube. When P3.2 outputs a high level, the "1" digital tube is selected, and when P3.3 outputs a high level, the "2" digital tube is selected, and so on. In the circuit, P3.2~P3.5 are connected to 4 NPN transistors as drivers. Pl.0~Pl.7 are connected to 8 resistors for current limiting.

3. Reference Program

This design uses the microcontroller C language for programming. Due to space limitations, the reference programs are not listed here one by one.

4. Production and debugging

The design is relatively simple to debug. As long as the installation and welding are correct and the program is written accurately and completely, it is generally easy to realize the function.

The debugged object is shown in Figure 6.

Figure 6 Actual picture

Figure 6 Actual picture

Keywords:DS18B20  AT89C2051  USB Reference address:Design of Oscilloscope Monitoring Program Based on C8051F020

Previous article:Application design of contactless IC card reader for public transportation
Next article:Development of Fixed Telephone Short Message Terminal Based on 80C31

Recommended ReadingLatest update time:2024-11-16 16:33

Atmospheric temperature acquisition and recording system designed using AT89C2051 microcontroller for system coordination and control
1 Introduction The measurement of atmospheric temperature is of great significance. Generally, various thermometers are used for manual measurement, and the measurement results are recorded regularly. This method is time-consuming, labor-intensive, and very inconvenient. This article proposes a very compact atmospheri
[Microcontroller]
Atmospheric temperature acquisition and recording system designed using AT89C2051 microcontroller for system coordination and control
USB communication code based on 51 single chip microcomputer 372
#include include.h #include "INTRINS.h" #define OP_CMD 1 // Command opcode #define OP_DATA 0 // Data opcode #define DELAY_TIMES 8 // Delay 2 microseconds #define DELAY_CNT_NUMS 2*DELAY_TIMES // Number of clock cycles required for a delay of 2 microseconds (for a 22.1184MHz crystal, each microsecond contains 22.1184
[Microcontroller]
DS18B20 temperature sensor + 12864 LCD serial port display
Program header file #include reg52.h #include intrins.h #include math.h sbit CS=P1^0; sbit SCK=P1^2; sbit SID=P1^1; sbit Key=P1^3; sbit DQ = P2 ^ 7;  //定义端口DQ unsigned char code AC_TABLE ={ 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87, 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97, 0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f, 0x98,0
[Microcontroller]
AT89C2051 simple sine wave, triangle wave, square wave generator
/********************************************************************                   Simple sine wave, triangle wave, square wave generator                   using keil C51, 12MHz crystal oscillator, AT89C2051  ******************************************************************/  #include "reg51.h"  #define uchar un
[Microcontroller]
Realization of Data Transmission between ATMAGE128 and Host Microcomputer Using USB Interface
    The data communication between the lower computer and the upper computer can meet the requirements of the synchronous phasor measurement unit for high data transmission rate, low latency and high reliability. The main problem to be solved here is the USB interface driver. By writing the hardware drivers of the upp
[Microcontroller]
Design of ISP1362OTG based on AVR microcontroller
0 Introduction With the popularity of consumer products such as PDAs, mobile phones, digital cameras, printers, etc., the high-speed data transmission technology used for these devices and computers, or between devices, has attracted more and more attention. In the past, the data transmission structure with
[Microcontroller]
STM32 USB Learning Notes 6
Host environment: Windows 7 SP1 Development environment: MDK5.14 Target board: STM32F103C8T6 Development library: STM32F1Cube library and STM32_USB_Device_Library Now let's analyze the USB device library code. Let's look at the usbd_core file first. Its header file only has some function declarations. There is nothing
[Microcontroller]
AT89C2051 single chip microcomputer drives stepper motor circuit and source code
  program stepper.c stepper.hex /* * STEPPER.C * sweeping stepper''s rotor cw and cww 400 steps * Copyright (c) 1999 by W.Sirichote */ #include c:\mc51\8051io.h /* include i/o header file */ #include c:\mc51\8051reg.h register unsigned char j,flag1,temp; register unsigned int cw_n,ccw_n; unsigned
[Microcontroller]
AT89C2051 single chip microcomputer drives stepper motor circuit and source code
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号