Application of EM78 series microcontroller in infrared remote control system

Publisher:暗里著迷Latest update time:2006-11-28 Source: 国外电子元器件Keywords:watchdog Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Main features of EM78P447S

  The EM78 series microcontroller is an 8-bit cost-effective microcontroller manufactured by Taiwan Elan Electronics Co., Ltd. using CMOS technology. This series of microcontrollers generally have built-in watchdog counter (WDT), RAM, ROM, programmable timer/counter, prescaler and 5-layer stack. Most instructions of this series of devices only require two oscillation cycles, and it also has functions such as internal and external interrupts, low-voltage detection reset, programmable I/0, internal pull-up resistor, open-collector output, and SLEEP mode. In addition, the EM78P447S microcontroller 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 is DC-4MHz at 5V;

The range at 3V is DC-4MHz;

●One-time programmable ROM up to 4K X 13bit;

●Internal RAM is 148 X 8bit;

●With 5-layer stack;

●Contains a watchdog timer (WDT) that can be programmed by itself 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 boost resistance and wake-up CPU;

●There are two I/O pins with R-Option function. Through the R-Option function, when the same microcontroller is placed in two or more application programs, 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 certain two I/0 pins of EM78P447S, so that the status of the pin can be judged by whether the user connects an external pull-down resistor (usually 510kΩ), and then the running direction can be determined. a program;

●There are two output pins that can be programmed as open collectors;

●The signal source and trigger source can be selected through an 8-bit timer/counter (TCC), and 8-bit prescaler can be performed;

●With overflow interrupt function;         

●Has functions such as power-on reset, low-level detection reset, RESET pin input low-level reset, WDT timeout overflow reset, etc.;

●Most instructions only require two oscillation cycles;

●Has low-level sleep mode;

●Has TCC overflow interrupt, external INT pin input pulse interrupt and INT instruction execution software interrupt functions;

●Using 32-pin DIP package.

2 Pin functions and registers of EM78P447S

2.1 Pin arrangement of EM78P447S

  Figure 1 shows the pin arrangement of 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 terminal, active low level;

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 with internal boost resistors through software;

P70-P77: Bidirectional I/O pins, among which P74 and P75 can be programmed with internal boost 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 Enter the pin.

2.2 Registers in EM78P447S

  EM78P447S contains 9 operation purpose registers. Among them, 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), The addresses of the eight registers including R6 (PORT6) and R7 (PORT7) are 00H-07H in sequence, while the address of the interrupt status register R3F (1SR) is 3FH.

  Among the 148 general-purpose registers (RAM) of EM78P447S, there are 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).

  In addition, there are 7 special function registers in EM78P447S. These include accumulator A, control register CONT, input/output control registers IOC5, IOC6, and IOC7 (controlling the input/output modes of port5, port6, and port7 respectively), WDT control register IOCE, and interrupt mask register IOCF.

2.3 Introduction to instructions of EM78P447S

  The EM78P447S microcontroller has a total of 45 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 according to their functions.

  The instructions of the EM78P447S microcontroller mainly have the following features:

●Except for the instruction that changes the program counter, which requires two instruction cycles, the other instructions are all single instruction cycles;

●Each bit of the register can be directly set, cleared or tested by bit-type instructions;

●The I/O register corresponding to the IO pin can also be accessed as a general register. In other words, the instructions used to access general registers and I/O are exactly the same.

3 Application in DC motor remote control system

  The remote control system designed using EM78P447S as the main controller can realize remote control of forward, reverse and stop of DC motor. The remote control system consists of three parts: a transmitting module, a receiving input module and a microcontroller processing output module.

3.1 Launch module

  The transmitting 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 chip PT2248 for transmitting and the peripheral amplifier circuit are used to amplify the signal, and then infrared transmission can be carried out. The schematic diagram of its hardware circuit is shown in Figure 2.

3.2 Receive input module

  The receiving module in this remote control system uses a 5V working voltage, and there is a receiver on the circuit board that can be used 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 process it through 74LS04 before sending it to the microcontroller. Three light-emitting diodes can be used to respectively correspond to the three buttons of the transmitting module to display operations. When a key is pressed, the corresponding light-emitting diode emits light. The hardware circuit is shown in Figure 3.

3.3 Microcontroller processing output module

  The single-chip microcomputer 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 transmitting module, which can be used to control the forward, reverse, and reverse rotation of the motor. stop. These three keys can replace KO, K1 and K2 for operation when the remote control has problems or is lost, so it is very convenient and practical.

  The P5.0-P5.2 pins on the microcontroller are respectively used as the signal input terminals for the motor's forward rotation, reverse rotation and stop. The P6.0 and P6.1 pins are respectively used as the signal output terminals for the motor's forward rotation and reverse rotation. To stop the motor, just send the invalid signal to P6.0 and P6.1. After the output signal of the microcontroller is reversed by the 74LS04 and sent to the ULN2003A for amplification, the relay can be driven to make the DC motor operate accordingly.

  In addition, two light-emitting diodes can be used to display the operation. This way, when the motor is running forward or reverse, one of the diodes will light up, and when the stop button is pressed, neither will light up. Its hardware circuit is shown in Figure 4.

4 System software design

  This design uses the development tool EMC that comes with the EM series microcontroller as the programming tool, and the main program continuously monitors the status of the ping-pong keys in a loop. When a button is pressed and released, its corresponding motor is started, and then the system returns to detect the status of the button to determine whether to maintain the operating state or transfer to other states.

  It should be noted that when the mechanical switch is pressed or released, the button will bounce on the contact due to mechanical elasticity. This rapid jump will be completely detected by the CPU, so there will be an error situation where the user only presses the switch once, but is considered by the CPU to have been pressed many times. In order to avoid this misjudgment phenomenon, a delay can be used to deal with this bouncing problem during design. When the software detects that the switch is pressed, it delays the detection for a period of time and then detects it again to avoid the bounce time. This bounce usually occurs between 20ms and 50ms after the switch is pressed, so as long as it avoids Just turn on this period of time without reading the signal of the input pin. The software process is shown in Figure 5.

references

1. Deng Jincheng. Introduction and implementation of EM78447
2. Wu Jiansheng. EM78154/x56/x57 series 8-bit microcontroller principles and applications. Fuzhou Xinyuan Electronic Technology Research Institute, 1998, 3

Keywords:watchdog Reference address:Application of EM78 series microcontroller in infrared remote control system

Previous article:Research and application examples of rapid printing method of electrocardiogram based on thermal printer
Next article:Design of single-phase multiple rate electric energy meter using M68HC908LJ12

Recommended ReadingLatest update time:2024-11-16 22:01

Design of CMOS Pseudo-Differential Class E RF Power Amplifier
AbstractThe non-ideal factors of class E power amplifier are analyzed, especially the influence of parasitic inductance on system performance. The pseudo-differential class E power amplifier structure is used to effectively suppress the influence of parasitic inductance. Finally, based on the ideal design equation a
[Industrial Control]
Design of CMOS Pseudo-Differential Class E RF Power Amplifier
OV launches new CMOS: 50-megapixel 1/1.55-inch sensor to be launched in the second quarter
     OmniVision Technologies today released a 50-megapixel 1/1.55” mobile phone CMOS - OV50A, revealing only that the sensor will be available in the second quarter of 2021, but did not specify specific customers.      IT Home learned that this sensor is built using OmniVision's PureCel Plus-S stacked chip technology,
[Mobile phone portable]
Implementation of fingerprint recognition device based on USB transmission and CMOS image sensor
Introduction CMOS image sensor is a new type of solid-state image sensor that has been rapidly developed in recent years. It integrates the image sensing part and the control circuit in the same chip, which significantly reduces the volume and power consumption, and meets the requirements for highly min
[Analog Electronics]
Detailed explanation of s3c2410 watchdog
1. What is a watchdog? Watchdog, the Chinese name is "watchdog", the full name is watchdog timer. From the literal meaning, we can know that it is actually a timer. However, it is different from the timers we usually come into contact with in terms of function. Ordinary timers generally play a role in timekeeping. Tim
[Microcontroller]
Testing Principles and Cases of CMOS Integrated Circuit Tester
The electronic control circuit of electronic technology often adopts CMOS logic control system. Through years of maintenance practice, we have designed and installed a simple integrated logic gate circuit tester. As long as we master the logical relationship between the input and output of various logic gate circuits,
[Test Measurement]
Testing Principles and Cases of CMOS Integrated Circuit Tester
WINCE6.0+S3C6410 watchdog restart
// File: watchdog_sw_rst.c // // Samsung SMDK6410 SW_RST using watchdog timer support code. // #include windows.h #include ceddk.h #include oal.h #include s3c6410.h // WTCON - control register, bit specifications #define WTCON_PRESCALE(x) (((x)&0xff) 8) // bit 15:8, prescale value, 0
[Microcontroller]
Long-term CMOS timing circuit that can be set from 10 to 100 seconds
Function of the circuit If you want to use the 555 chip to form a long-time timing circuit, you can use a high resistance value for R to lengthen the CR time constant. However, since the input bias current of the internal comparator is large, it is difficult to charge to the threshold voltag
[Analog Electronics]
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号