I applied for a job as a lecturer on the Lichuang EDA campus and planned to offer a training course on PCB design. The teaching software used was the domestic Lichuang EDA. The content of the course was from beginners to making some real projects. After all, Jilichuang’s free shipping is 0 yuan. PCB proofing is still very delicious.
The first project should not be too difficult, and it should be interesting enough to stimulate students' interest in learning. So I chose to use a 51 microcontroller to make a heart-shaped running water lamp.
The main control chip uses STC89C52RC401, the LEDs use 2.5MM plug-in light-emitting diodes, and the microcontroller pins are driven at a high level.
Professional presentation:
STC89C52RC:
STC89C52RC is a low-power, high-performance CMOS 8-bit microcontroller produced by STC Company with 8K bytes of system programmable Flash memory. STC89C52 uses the classic MCS-51 core, but has made many improvements to make the chip have functions that traditional 51 microcontrollers do not have. On a single chip, it has a smart 8-bit CPU and in-system programmable Flash, making the STC89C52 a highly flexible and ultra-effective solution for many embedded control application systems. Has the following standard functions: 8k bytes Flash, 512 bytes RAM, 32-bit I/O port line, watchdog timer, built-in 4KB EEPROM, MAX810 reset circuit, 3 16-bit timers/counters, 4 external interrupts , a 7-vector 4-level interrupt structure (compatible with the traditional 51-vector 2-level interrupt structure), full-duplex serial port. In addition, STC89C52 can reduce to 0Hz static logic operation and supports 2 software-selectable power-saving modes. In idle mode, the CPU stops working, allowing RAM, timers/counters, serial ports, and interrupts to continue working. In the power-down protection mode, the RAM contents are saved, the oscillator is frozen, and all work of the microcontroller stops until the next interrupt or hardware reset. The maximum operating frequency is 35MHz, 6T/12T optional.
Crystal oscillator circuit:
There is a crystal oscillator in every single-chip computer system. The full name is crystal oscillator. The crystal oscillator plays a very important role in the single-chip computer system. It combines with the internal circuit of the single-chip computer to generate the necessary clock frequency for the single-chip computer and executes all instructions of the single-chip computer. It's all based on this. The higher the clock frequency provided by the crystal oscillator, the faster the microcontroller will run.
The crystal oscillator uses a crystal that can convert electrical energy and mechanical energy into each other to work in a resonance state to provide stable and accurate single-frequency oscillation. Under normal working conditions, the absolute accuracy of the ordinary crystal oscillator frequency can reach 50 parts per million. Advanced accuracy is higher. Some crystal oscillators can also adjust the frequency within a certain range by an external voltage, called a voltage-controlled oscillator (VCO).
The role of the crystal oscillator is to provide the basic clock signal for the system. Usually a system shares a crystal oscillator to facilitate the synchronization of various parts. Some communication systems use different crystal oscillators for the base frequency and radio frequency, and maintain synchronization by electronically adjusting the frequency.
LED light:
LED (Light Emitting Diode), light-emitting diode, is a solid-state semiconductor device that can convert electrical energy into visible light. It can directly convert electricity into light. The heart of the LED is a semiconductor chip. One end of the chip is attached to a bracket, one end is the negative electrode, and the other end is connected to the positive electrode of the power supply, so that the entire chip is encapsulated in epoxy resin.
The semiconductor wafer is composed of two parts. One part is a P-type semiconductor, in which holes dominate, and the other end is an N-type semiconductor, where electrons are mainly present. But when these two semiconductors are connected, a PN junction is formed between them. When current acts on the wafer through the wire, the electrons will be pushed to the P region, where the electrons will recombine with holes, and then energy will be emitted in the form of photons. This is the principle of LED light emitting. The wavelength of light, also known as the color of light, is determined by the material forming the PN junction.
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet