1 Main features of EM78P447S
The EM78 series of single-chip microcomputers are 8-bit high-cost-effective single-chip microcomputers manufactured by Taiwan Elan Electronics Co., Ltd. using CMOS technology. This series of single-chip microcomputers generally have built-in watchdog counters (WDT), RAM, ROM, programmable timers/counters, prescalers, and 5-layer stacks. Most of the instructions of this series of devices only require two oscillation cycles, and they also have functions such as internal and external interrupts, low voltage detection reset, programmable I/0, internal pull-up resistors and collector open-circuit outputs, and SLEEP mode. In addition, the EM78P447S single-chip microcomputer also has the advantages of simple programming, fast speed, low power consumption, and low cost, and can be widely used in toys, home appliances, industrial control, etc.
The main performance features of EM78P447S are as follows:
●Working voltage range: 2.5-5.5V;
●Allowable temperature range: 0-70°C;
●Operating frequency range:
Quartz oscillation type: The range is DC-20MHz at 5V,
The range at 3V is DC-8MHz;
RC oscillation type: the range at 5V is DC-4MHz;
The range at 3V is DC-4MHz;
●One-time programmable ROM up to 4K X 13bit;
●Internal RAM is 148 X 8bit;
●Has 5 layers of stacking;
●Contains a self-programmable watchdog timer (WDT) and an 8-bit prescaler;
●Has 24 bidirectional three-state I/O pins;
●I/O in sleep state can be planned;
●There are ten I/O pins with pull-up resistors and CPU wake-up function;
● There are two I/O pins with R-Option function. Through the R-Option function, when two or more applications are placed in the same microcontroller, an input pin can be used to determine which program to select. In other words, the R-option function is to set selectable pull-down resistors on two I/O pins of the EM78P447S, so as to determine the state of the pin by whether the user connects an external pull-down resistor (usually 510kΩ), and then determine which program to run;
●There are two output pins that can be configured as open collectors;
●The signal source and trigger source can be selected through an 8-bit timer/counter (TCC), and 8-bit pre-scaling can be performed;
●With overflow interrupt function;
●It has functions such as power-on reset, low-level detection reset, RESET pin input low-level reset, and WDT timeout overflow reset;
● Most instructions only require two oscillation cycles;
●With low-level sleep mode;
●It has TCC overflow interrupt, external INT pin input pulse interrupt and INT instruction execution software interrupt functions;
●Using 32-pin DIP package.
2 EM78P447S Pin Functions and Registers
2.1 EM78P447S Pinout
Figure 1 shows the pinout of the EM78P447S. The functions of each pin are as follows:
TCC: external counting input pin;
OSCO: oscillation output pin;
VDD: positive power input pin;
OSCI: crystal oscillator or RC oscillator input pin;
NC: empty foot;
BESET: reset input, low level is valid;
VSS: ground pin;
INT: External interrupt input pin, falling edge input is valid;
P50-P57: bidirectional I/O pins;
P60-P67: Bidirectional I/O pins, which can be programmed to have internal pull-up resistors through software;
P70-P77: Bidirectional I/O pins, of which P74 and P75 can be programmed to have internal pull-up resistors through software; P76 and P77 can be set as open-collector output pins through software; P70 and P71 can be used as R-Option input pins.
2.2 Registers in EM78P447S
EM78P447S contains 9 operation registers. The addresses of the 8 registers, including indirect addressing register R0 (IAB), timer/counter R1 (TCC), program counter R2 (PC), status register R3 (STATUS), RAM selection register R4 (RSR), I/O port register R5 (PORT5), R6 (PORT6), R7 (PORT7), are 00H-07H in sequence, and the address of interrupt status register R3F (1SR) is 3FH.
The 148 general registers (RAM) of the EM78P447S include registers with addresses 08H-1FH and 4 register groups with addresses 20H-3EH (the 4 page addresses are determined by bits 6 and 7 of R4). [page]
In addition, there are 7 special function registers in EM78P447S, including accumulator A, control register CONT, input/output control registers IOC5, IOC6, IOC7 (control the input/output mode of port5, port6, port7 respectively), WDT control register IOCE and interrupt mask register IOCF.
2.3 Introduction to EM78P447S instructions
The EM78P447S microcontroller has a total of 45 single words and 58 instructions. These 58 instructions include 19 logic instructions, 11 arithmetic operation instructions, 4 bit instructions, 4 transfer instructions, 10 control instructions and 10 jump instructions. Table 1 gives the classification of these instruction words by function.
The instructions of the EM78P447S microcontroller have the following main features:
●Except for the instruction to change the program counter which requires two instruction cycles, all other instructions require a single instruction cycle;
●Each bit of a register can be set, cleared or tested directly by a bit-type instruction;
●The I/O registers corresponding to the IO pins can also be accessed as general registers. In other words, the instructions used to access general registers are exactly the same as those used for I/O.
3 Application in DC motor remote control system
The remote control system designed with EM78P447S as the main controller can realize the remote control of DC motor forward, reverse and stop. The remote control system consists of three parts: transmitting module, receiving input module and single chip processing output module.
3.1 Transmitter Module
The transmitter module in the remote control system designed by the author uses a 3V working voltage. There are three ping-pong keys KO, K1, and K2 on the circuit board, which can be used to control the forward, reverse, and stop operations of the motor respectively. When it is necessary to transmit, the dedicated transmission chip PT2248 and the peripheral amplifier circuit are used to amplify the signal, and infrared transmission can be performed. The hardware circuit schematic diagram is shown in Figure 2.
3.2 Receiving input module
The receiving module in this remote control system uses a 5V working voltage, and there is a receiver on the circuit board to receive the signal transmitted by the transmitting module. An amplifier circuit can be used to amplify the received signal and transmit it to the receiving dedicated chip PT2249A, and then it is processed by 74LS04 and sent to the single-chip microcomputer. Three light-emitting diodes can be used to correspond to the three buttons of the transmitting module to display the operation. When a key is pressed, the corresponding light-emitting diode lights up. Its hardware circuit is shown in Figure 3.
3.3 Single chip microcomputer processing output module
The single-chip processing output module uses a 5V working voltage. The three ping-pong keys K3, K4, and K5 on the module correspond to the three keys KO, K1, and K2 on the transmitter module, which can be used to control the forward, reverse, and stop of the motor. These three keys can replace KO, K1, and K2 to operate when the remote control has problems or is lost, so they are very convenient and practical.
The P5.0-P5.2 pins on the microcontroller are used as the signal input terminals for the motor to rotate forward, reverse and stop respectively, and the P6.0 and P6.1 pins are used as the signal output terminals for the motor to rotate forward and reverse respectively. To stop the motor, just send an invalid signal to P6.0 and P6.1. The output signal of the microcontroller is inverted by 74LS04 and sent to ULN2003A for amplification, which can drive the relay to make the DC motor operate accordingly.
In addition, two LEDs can be used to display the operation. In this way, when the motor is running forward or reverse, one of the diodes will light up, and when the stop button is pressed, both will not light up. The hardware circuit is shown in Figure 4.
4 System software design
This design uses the EMC development tool of the EM series microcontroller as the programming tool. The main program continuously monitors the status of the ping-pong keys. When a key is pressed and released, the corresponding motor is started, and then the system returns to detect the status of the key to determine whether to maintain the operating state or switch to other states.
It should be noted that when the mechanical switch is pressed or released, the key will bounce on the contact due to mechanical elasticity. The CPU will fully detect this rapid bounce, so the user may only press the switch once, but the CPU may think that the switch has been pressed many times. In order to avoid this misjudgment, the design can use delay to deal with this bounce problem. When the software detects that the switch is pressed, it will delay for a period of time and then detect again to avoid the bounce time. This bounce usually occurs between 20ms-50ms after the switch is pressed, so just avoid this period of time and do not read the signal of the input pin. The software flow is shown in Figure 5.
References
[1]. EM78P447S datasheet http://www.dzsc.com/datasheet/EM78P447S_297719.html.
[2]. ROM datasheet http://www.dzsc.com/datasheet/ROM_1188413.html.
[3]. TCC datasheet http://www.dzsc.com/datasheet/TCC_1064984.html.
[4]. PT2248 datasheet http://www.dzsc.com/datasheet/PT2248_1076365.html.
[5]. PT2249A datasheet http://www.dzsc.com/datasheet/PT2249A_1076366.html.
[6]. 74LS04 datasheet http://www.dzsc.com/datasheet/74LS04_772886.html.
[7]. ULN2003A datasheet http://www.dzsc.com/datasheet/ULN2003A_500971.html.
[8]. EMC datasheet http://www.dzsc.com/datasheet/EMC_2342312.html.
[9]. Deng Jincheng. Introduction and implementation of EM78447
[10]. Wu Jiansheng . Principle and application of EM78154/x56/x57 series 8-bit microcontroller. Fuzhou Xinyuan Electronic Technology Research Institute, 1998,3
Previous article:Application Research of PPP Protocol in Embedded Single Chip Microcomputer
Next article:Application of embedded TCP/IP protocol microcontroller technology in network communication
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Why is there a data document in alldatasheet when the official website doesn't have one?
- [AT-START-F403A Review] 1. Unboxing and Environment Setup
- What do dielectric loss and conductance loss mean in capacitor loss?
- Apply for free evaluation! Let's play GigaDevice GD32307E-START
- Distributed parameters of magnetic components in switching power supplies
- Some doubts about participating in online live events with prizes
- [Flower carving DIY] Interesting and fun music visualization project (11) --- WS2812 fantasy light strip
- Prize-winning live broadcast | Application registration for ON Semiconductor's high-efficiency products in smart fast charging is open!
- Draw a SparkRoad RGB LCD expansion board
- Dealing with Rejection Issues: PSRR vs. CMRR of Instrumentation Amplifiers