EM78P447S MCU/Application in DC Motor Infrared Remote Control System

Publisher:BlissfulMomentsLatest update time:2013-10-16 Source: dzscKeywords:EM78P447S Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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

Keywords:EM78P447S Reference address:EM78P447S MCU/Application in DC Motor Infrared Remote Control System

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

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号