introduction
With the development of computer technology, most of the domestic science and engineering colleges have opened single-chip courses. In order to learn this course well, experiments related to the principle and technology of single-chip microcomputers are indispensable, and the tool of the experiment is the learning board. At present, most of the learning boards use 51 series single-chip microcomputers, parallel interfaces and some old devices. Nowadays, some enhanced single-chip microcomputers have been produced, which are faster and have more functions, such as serial port programming, etc., and many serial interface chips and some serial port standards have also appeared. This article proposes a hardware circuit design based on the STC microcontroller learning platform, using a new type of microcontroller STC12C5410AD, and adding 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: ISP programmable, LCD screen display, calendar clock (IIC interface chip), temperature measurement (1-wire interface chip), FLAH memory (SPI interface chip), buttons (wax scan button), voltage measurement (AD conversion).
1 hardware system overview
The learning platform takes STC12C5410AD as the core, and the structure diagram is shown in Figure 1.
1.1 Introduction to STC12C5410AD microcontroller
The STC12C5410AD single-chip microcomputer is an enhanced single-chip microcomputer launched by Hongjing Technology after major improvements on the basis of the standard 8051 single-chip core. It is an enhanced 8051 single-chip microcomputer, single clock/machine cycle, operating voltage 5.5V to 3.5V, operating frequency range 0~35MHz, 512 bytes on-chip data memory, 10K bytes on-chip Flash program memory, ISP (in System programmable)/IAP (programmable in application), program can be downloaded directly through serial port, EEPROM function, 6 16-bit timer/counters, PWM (4 channels)/PCA (programmable counter array, 4 channels), 8 channels 10-bit A/D conversion, SPI synchronous communication port.
2 hardware system design
2.1 Crystal oscillator, power supply and reset circuit
Figure 2, Figure 3 and Figure 4 are the reset circuit, power supply circuit and crystal oscillator circuit respectively. The RST network label in the reset circuit is connected to the pin 3 of the STC12C5410AD microcontroller, and the circuit is powered on and reset. Because the working voltage of STC12C5410AD one-chip computer is between 5.5~3.5V, what the power source uses is 5V switching power supply, in order to AD change accurately, join a LM7805 voltage regulator chip.
2.2 Burning and writing the 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 end-user code, and it is unnecessary to wipe from the power removal or circuit board programming. It is more complicated to use a programmer or an emulator for the machine adjustment test that has 80 warp 51 programmed single-pass chips. It is more cumbersome to use a programmer or an emulator, and STC12C5410AD supports ISP, just add it to Figure 5. For the circuit, you can use the STC MCU PC end ISP to download the system software through the serial port to write the program to be debugged into the MCU on the circuit board. The network labels RxD and TxD in the figure below are respectively connected to the P3.0 port and P3.1 port in the STC12C5410AD one-chip computer.
2.3 Button circuit
Because Io port resources are limited, and STCl2C5410AD comes with AD conversion, so AD conversion is used for key scanning. The key circuit is shown in Figure 6. Among them, the BUTTON network label is connected to the P1.0 AD conversion port of the one-chip computer.
2. 4 liquid crystal display circuit
The liquid crystal display circuit is shown in Figure 7. Because the Io port of the STC12C5410AD microcontroller is limited, and the 1602 LCD screen needs 8 data ports, a 74HC164 chip is used to convert the input of the serial port to the output of the parallel port, and a 74LS273 latch is added. The chip prevents the unwanted data from being sent to the 1602 LCD screen during the serial movement, causing display errors.
2. 5 calendar clock circuit
The calendar clock circuit is shown in Figure 8. It uses the DS1302 chip introduced by Dallas, which is an IIC interface chip. The STC12C5410AD single-chip microcomputer does not have an IIC communication port, and uses two IO ports 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 one-chip computer, and a 10K pull-up resistor is added to each of the two u. RST_DS1302 network label is connected to P0. 0, used to reset DS1302 chip.
2. 6 temperature measurement circuit
The temperature measurement circuit is shown in Figure 9. It uses a single-bus digital temperature sensor DS18B20 from Dallas. Therefore, it is necessary to add an analog-to-digital conversion circuit and directly connect its DQ pin to an IO port of the single-chip microcomputer.
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 the P1.7, P1.6, P1.5 and P0.3 ports of the microcontroller respectively, and a 10K pull-up resistor is added.
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.
3 concluding remarks
This article proposes a hardware circuit design based on the learning platform of the STC12C5410AD single-chip microcomputer. Compared with the traditional 8051 single-chip microcomputer, the method of designing the circuit with the STC12C5410AD single-chip microcomputer is somewhat different. It does not have the 8051 ALE (address latch) pin, etc., Therefore, 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. Use LCD screen instead of digital tube for display, add FLASH memory chip, use STC12C5410AD PWM function to realize DA conversion, make full use of STC12C5410AD single-chip microcomputer resources, and at the same time, the chip has its own watchdog hardware circuit and M function of Section II, which is suitable for Used as a learning platform for teaching experiments.