EMC MCU learning one

Source: Date: 2020-11-25

The internal structure of Elan Microcontrollers is the same as that of PIC microcontrollers. The bus structure of MCS-51 microcontrollers is a von Neumann type. The computer fetches instructions and data in the same storage space, and the two cannot be performed simultaneously; while the bus structure of PIC microcontrollers It is a Harvard structure, the instruction and data spaces are completely separated, one for instructions and one for data. Since the program and data can be accessed at the same time, the data throughput rate is improved. It is precisely because of the Harvard dual bus structure that is used in the PIC microcontroller, the difference from common microcontrollers is that the program and data buses can have different widths. The data buses are all 8-bit, but the command bus bits are 12, 14, and 16 bits respectively.

A summary of the basic functions:

① Three interrupt sources: timer interrupt, I/O wake-up interrupt, external signal input interrupt (only falling edge trigger)
② R-OPTION function: If there are several versions of the user program and hope to be stored in the same ROM, this idea can be realized through the R-OPTION function.
The setting is to pull up or pull down resistors on the relevant I/O, and select which version of the internal program to execute by judging the status of the relevant I/O.
③ Built-in voltage detector: When the power supply voltage drops below a rated value, the microcontroller is always in the reset state to improve the reset performance of the system.
④ Low power consumption design: normal working current 2mA, sleep state current 1μA
⑤ Multi-function I/O port: It can be set to I/O pull-up, pull-down, open circuit etc.
⑥ I/O wake-up function: wake up the MCU in sleep state through I/O changes
⑦ Built-in watchdog timer: improve the anti-interference ability of the MCU

The EM78 series single-chip microcomputers integrate many functions, including ALU, ROM, RAM, I/O, stack, interrupt controller, timer/counter, watchdog,
Voltage detector, reset circuit, oscillating circuit, etc., become a small single-chip system in the true sense. Superior data processing performance.

EM78 series single-chip microcomputer adopts RISC structure design, single cycle, single byte and pipeline instructions, five-level stack, the number of RAM ranges from 32 to 157, and the shortest instruction cycle is 100ns.
The program page is 1K (up to 4 pages)


The basic EMC command syntax is 57/58

The EMC instruction set is divided into several categories:
1. Data transmission
mov This is the most basic data transfer instruction, there are also several addressing methods
swap One byte high and low nibble exchange each other
Write operation group of iow IO address space
Read operation of ior IO address space
bs set operation
bc clear operation
2. Arithmetic operations
add instruction
sub subtraction instruction
inc plus one instruction
dec minus one instruction
daa decimal adjustment command
3. Logic operations
and operation
or operation
xor XOR operation
com negated
rlc rotate left
rrc rotate right
4. Control statements
call subroutine call
jmp jump directly
ret subroutine return
reti interrupt return
Jump if djz minus one to zero
jbc test bit is zero jump
jbs test bit is a jump
page modify the current page
bank modify the current bank
tbl pc=pc+A
5. Other instructions
disi off interrupt
eni open interrupt
wdtc clear watchdog
nop empty instruction

register:

R0 IAR Indirect Address Register
R2 PC program counter
R3 STATUS status register
R4 RSR RAM select register
A accumulator
The functions of each BIT of TUS:
0 C Carry flag
1 DC auxiliary carry flag
2 Z zero flag
3 P low power bit
4 T time overflow bit
7 RST reset type bit
0 cooperates with R4 to complete indirect addressing, R4 points to the address, and R0 maps the memory unit
A and CONT are not memory-mapped, they can only be addressed directly by instructions

To

Development strength

Professional and experienced software and hardware

Global channels

Provide customers with cost-effective products and services

Quality Assurance

The professional test guarantee team guarantees the stability

After-sales service

Professional technical service team, 24 hours to provide customers