Hardware circuit design based on STC microcontroller

Publisher:ByteChaserLatest update time:2011-04-11 Keywords:stc Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

This paper proposes a hardware circuit design based on the STC single-chip microcomputer learning platform, which uses a new single-chip microcomputer model STC12C5410AD, and adds some serial interface chips to the learning platform. The interface standards include RS-232, SPI, IIC, 1-wire, etc. The design goals of the learning platform are: ISP programmable, LCD display, calendar clock (IIC interface chip), temperature measurement (1-wire interface chip), FLAH memory (SPI interface chip), button (wax change scan button), voltage measurement (AD conversion).

1 Hardware System Overview

The learning platform is based on STC12C5410AD, and the structure diagram is shown in Figure 1.

Structure diagram

1.1 Introduction to STC12C5410AD MCU

The STC12C5410AD microcontroller is an enhanced microcontroller launched by Hongjing Technology after major improvements on the standard 8051 microcontroller core. It is an enhanced 8051 microcontroller with a single clock/machine cycle, an operating voltage of 5.5V to 3.5V, an operating frequency range of 0 to 35MHz, 512 bytes of on-chip data memory, 10K bytes of on-chip Flash program memory, ISP (in-system programmable)/IAP (in-application programmable), can directly download programs through the serial port, EEPROM function, 6 16-bit timers/counters, PWM (4 channels)/PCA (programmable counter array, 4 channels), 8 channels of 10-bit A/D conversion, and SPI synchronous communication port.

2 Hardware System Design

2.1 Crystal oscillator, power supply and reset circuit

Figures 2, 3 and 4 are the reset circuit, power circuit and crystal oscillator circuit respectively. The RST network in the reset circuit is connected to pin 3 of the STC12C5410AD microcontroller, and the circuit is reset when powered on. Since the operating voltage of the STC12C5410AD microcontroller is between 5.5 and 3.5V, a 5V switching power supply is used for the power supply. In order to ensure accurate AD conversion, an LM7805 voltage regulator chip is added.

Reset Circuit 2.2 Burning program circuit

ISP (In-System Programming) is programmable in the system, which means that the blank devices on the circuit board can be programmed to write the end-user code without the need to erase or reprogram the circuit board. To download the device, the 8051-programmed single-chip machine can also be programmed with ISP. It is more complicated to use a programmer or emulator, but STC12C5410AD supports ISP. As long as the circuit in Figure 5 is added, the program to be debugged can be written to the microcontroller on the circuit board by using the ISP download software on the PC side of the STC microcontroller through the serial port. The network labels RxD and TxD in the figure below are connected to the P3.0 port and P3.1 port of the STC12C5410AD microcontroller respectively.

Programming circuit

2.3 Button Circuit

Since the Io port resources are limited and STCl2C5410AD has its own AD conversion, AD conversion is used for key scanning, and the key circuit is shown in Figure 6. The BUTTON network label is connected to the P1.0 AD conversion port of the microcontroller.

Button circuit

2.4 LCD display circuit

The LCD display circuit is shown in Figure 7. Because the Io port of the STC12C5410AD microcontroller is limited, and the 1602 LCD screen requires 8 data ports, a 74HC164 chip is used to convert the serial port input into the parallel port output, and a 74LS273 latch chip is added to prevent unnecessary data from being sent to the 1602 LCD screen during the serial shift-in process, resulting in display errors.

LCD display circuit

2.5 Calendar clock circuit

The calendar clock circuit is shown in Figure 8. It uses the DS1302 chip launched by Dallas, which is an IIC interface chip. The STC12C5410AD microcontroller does not have an IIC communication port, so two IO ports are used to simulate the IIC interface through software. The two network labels DS1302_SCLK and DS1302_DATA are connected to the P2.2 and P2.3 ports of the STC12C5410AD microcontroller, and a 10K pull-up resistor is added to each of these two u. The RST_DS1302 network label is connected to P0.0 to reset the DS1302 chip.

Calendar clock circuit

2.6 Temperature measurement circuit

The temperature measurement circuit is shown in Figure 9. It uses the single-bus digital temperature sensor DS18B20 from Dallas Company. Therefore, it is not necessary to add an analog-to-digital conversion circuit and directly connect its DQ pin to an IO port of the microcontroller.

Temperature measurement circuit

2.7 FLASH Circuit

The circuit is shown in Figure 10. AT25F512 is a Flash chip with SPI interface. STC12C5410AD has its own SPI communication port. SCK, MISO, MOSI and Ss network labels are connected to P1.7, P1.6, P1.5 and P0.3 of the microcontroller respectively, and a 10K pull-up resistor is added to each.

2.8 DA conversion circuit

The DA conversion circuit is shown in Figure 11, which uses the PWM function of the microcontroller to achieve DA conversion.

DA conversion circuit

3 Conclusion

This paper proposes a design of hardware circuit for a learning platform based on STC12C5410AD microcontroller. Compared with the traditional 8051 microcontroller, the method of designing circuits with STC12C5410AD microcontroller is somewhat different. It does not have the ALE (address latch) pin of 8051, so its PoEl cannot be used as an address data multiplexing port. Most of the hardware circuits of the learning platform use serial port chips, including most mainstream serial port standards. LCD screen is used instead of digital tube for display, FLASH storage chip is added, and PWM function of STC12C5410AD is used to realize DA conversion, making full use of the resources of STC12C5410AD microcontroller. At the same time, the chip has its own watchdog hardware circuit and M function of II subject, which is suitable for use as a learning platform for teaching experiments.

Keywords:stc Reference address:Hardware circuit design based on STC microcontroller

Previous article:Design of Ethernet-CAN conversion circuit based on C8051F040
Next article:Design of a simple music circuit using a buzzer and a single-chip microcomputer

Recommended ReadingLatest update time:2024-11-16 22:40

Serial port communication (STC89C52+MAX232): Detailed explanation of serial port communication hardware design
1. Schematic diagram of connection between STC89C52 and MAX232 2. Principle of cross-port communication 1. Basic communication method a. Parallel communication Definition: To transmit each bit of a data byte simultaneously using multiple data lines, each bit of data requires a transmission line, a signal line,
[Microcontroller]
Serial port communication (STC89C52+MAX232): Detailed explanation of serial port communication hardware design
STC89C52 MCU internal EEPROM driver
The STC89C52 microcontroller has 4K storage space, which is divided into 8 sectors, each sector is 512 bytes. The starting address of the first sector is 0x2000 and the ending address is 21FF. The starting address of the eighth sector is 0x2E00 and the ending address is 2FFF. #include reg52.h #include intrins.h #de
[Microcontroller]
STC 12C5A60S2 serial port 2 communication main code example
Friends who have used the stc12C5A60S2 microcontroller know that the microcontroller has two serial ports available. There are also many program comments on the official website, so I wrote a program for using serial port 2. Since the code is relatively simple, only the initialization, sending and receiving functions
[Microcontroller]
GPS positioning and track recorder made of stc51 single chip microcomputer
GPS positioning and track recorder based on C3-370C! I bought a C3-370C GPS from 51hei and prepared to do GPS track recording, because I always wanted to add coordinate information to travel photos... I started to use M48 as the control MCU, but when I was writing, I found that the Flash space was insufficient. I wa
[Microcontroller]
GPS positioning and track recorder made of stc51 single chip microcomputer
Arduino+STC89C52RC+nRF24L01 to make a remote temperature measurement system
After using it intermittently for 3 days, I finally figured out the principle of the nRF24L01 wireless transmission chip, which allows two chips of different models to exchange data remotely. The picture below uses this chip for temperature transmission. 89C52RC+DS18B20 is used as the temperature acquisition te
[Microcontroller]
Arduino+STC89C52RC+nRF24L01 to make a remote temperature measurement system
STC89C52 series MCU internal resources - interrupt system
Interrupts are set up to enable the microcontroller to process random external or internal events in real time. The existence of the interrupt function greatly improves the microcontroller's ability to handle external or internal events. It is also one of the most important functions of the microcontroller, and we mus
[Microcontroller]
STC89C52 series MCU internal resources - interrupt system
STC89C52 single chip microcomputer relay experiment
///////////////////////////////////////////////////// /////////////////////////   Function: Turn on the buzzer on the experiment board for 0.3 seconds, then turn off for 0.3 seconds, and then cycle like this.                     At the same time, the light emitting diode next to the relay on the experiment board will
[Microcontroller]
STC MCU PCA capture interrupt function
/***************************************************/ **Function name: void PCA_Capture_Int(); **Function description: PCA capture interrupt function, extended 32-bit count ** Note: After an interrupt occurs, the counter writes the high bit of the 32 count result into /*************************************************
[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号