7wcwE5pnI

STC89C52RC displays temperature and line segment sequence

 
Overview

Project Introduction
        An accidental work opportunity allowed me to try to draw schematic diagrams and PCBs. I designed this with reference to some materials and microcontroller principles. It simultaneously read the temperatures of three DS18B20s and realized the sequence of six line segments through button switching and measured whether they were connected or not. .
The schematic diagram shows
       that STC89C52 is used as the main control. 1. The temperature of the DS18B20 sensor is read through the three I/O ports P1.5, P1.6, and P1.7 and displayed on the OLED. 2. Use the button to switch to the line measurement program, and use the six wires connected to the terminals to determine whether the six wires cross and whether the connectors are open due to poor contact. The serial port programming circuit and crystal oscillator circuit are modified based on the actual needs on the Internet.
PCB description
      The PCB adopts the default wiring rules of Lichuang. The line width and layout are completed by querying cnds and learning the open source projects of Lichuang friends, and are drawn based on the knowledge learned.
In the software description,
     I quoted the routine c52 microcontroller to read the ds18b20 basic change.
#include "reg52.h" //This file defines some special function registers of the microcontroller #include "temp.h" #include "temp1.h" #include "temp2.h" #include "oled.h"
typedef unsigned int u16; //Declare and define the data type
#define led1 P2#define led2 P0sbit k1=P3^1; //Define the P31 port as k1sbit k2=P3^2; //Define the P31 port as k1sbit test=P0^0 ;//char num=0;u8 DisplayData[8];u8 DisplayData1[8];u8 DisplayData2[8];
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-04 04:45:41

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

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号