1. Overview: The block diagram of the single-chip microcomputer controlled motor circuit is shown below. It is a time controller. Users can program the time by pressing buttons. The time value can be set to 00-99 minutes (or seconds). The timing time is used to control two outputs.
The entire timing control circuit is: use any three I/O ports of the microcontroller as key input ports, use two I/O ports as motor outputs, one port can be used as the main motor, and the other port can be used as a cooling fan, etc. The display of the time value is realized by a two-digit seven-segment digital tube LED. The driver chip we use is a 74LS164 serial input and parallel output register (the new version omits the decoding chip 74LS164 and directly uses the 7 IO ports of the microcontroller to drive, and the LED bit driver is multiplexed with the key IO port). The microcontroller uses two I/O port lines to simulate the serial port, one is the RXD line and the other is the TXD line. The program uses software simulation to realize the communication with the 74LS164. In order to obtain a better display circuit, we use a dynamic scanning circuit, that is, the program is constantly and dynamically refreshing the display content, and the refresh frequency is required to be no less than 30Hz to avoid visual flickering.
The control process is: use the "UP" and "DOWN" buttons to set the motor start time. After setting, press the "START" button, the timing starts, and the value displayed on the time starts to flash at a frequency of 1 time per second to indicate that the work has started. The time value gradually decreases. When it decreases to "00", the motor output I or II stops (or starts), completing a working cycle. Press "START" again to continue the second work.
If the motor needs to be controlled only by the "START" button, press it once to start, and press it again to stop. If the time is set to "00", the fan motor stops immediately and the buzzer prompts. After 5s, the main motor stops working and there are 5 long beeps to prompt.
There are short beeps when the button is pressed, started or stopped. When the timing time is up, 5 long beeps are set to prompt.
Function expansion: Since the HT48R05A-1 has 13 I/O ports, only 7 are currently used, and several outputs can be added. Or increase the time range. For example, it can be expanded to 6 digits (the longest time can reach 999999 minutes or seconds), and only four I/O lines of the microcontroller are needed. However, the time control range is increased many times to meet different requirements. In short, the limited resources of the microcontroller can be fully utilized to achieve the purpose of making the best use of them.