1. What are the main functional components inside the MCS-51 microcontroller? What are their functions?
The MCS-51 microcontroller integrates basic functional components such as CPU, RAM, ROM, timer/counter, multi-function I/O port and interrupt control in one chip. The core part of the microcontroller is the CPU, which is the brain and heart of the microcontroller. The program memory is used to store the compiled program or table constants. The data memory is used to store intermediate operation results, data temporary storage and buffering, flags, etc. The timer/counter is essentially an adder counter. When it counts the internal machine cycle with a fixed time interval, it is a timer; when it counts external events, it is a counter. The main functions of the I/O interface include: buffering and latching data, address decoding, information format conversion, transfer status (peripheral status) and issuing commands. Interrupt control can solve the problem of speed matching between the CPU and peripherals, so that the microcontroller can process many random parameters and information in the system in a timely manner. At the same time, it also improves its ability to handle faults and adaptability.
2. What are the functions of the EA, ALE and PSEN terminals of the MCS-51 microcontroller?
Answer: ALE - ALE is the address latch enable signal. When accessing the external memory, ALE is used to latch the low 8-bit address signal sent by P0. PSEN - the read select signal of the external program memory. When accessing the external ROM, PSEN generates a negative pulse as the select signal of the external ROM; when accessing the external RAM or the on-chip ROM, no valid PSEN signal is generated. PSEN can drive 8 LSTTL gate inputs. EA - the control signal for accessing the external program memory. For 8051 and 8751, they have 4KB of program memory on chip. When EA is high, there are two situations when the CPU accesses the program memory: one is that the address space accessed is within the range of 0 to 4K, and the CPU accesses the on-chip program memory; the other is that when the address accessed exceeds 4K, the CPU will automatically execute the program in the external program memory. For 8031, EA must be grounded and can only access the external ROM.
3. What functions does the P3 port of the MCS-51 microcontroller have?
Answer: P3 port is a dual-function port. In addition to being used as a quasi-bidirectional general-purpose I/O port, each port line also has a second function. If each bit of P3 port is not set to the second function, it will automatically be in the first function. The second function of P3 involves the serial port, external interrupt, timer, and is related to the special function register.
4. How many interrupt sources does the 89C51 microcontroller have? What are their interrupt flags? How are these interrupt flags generated? How are they cleared to "0"?
Answer: 5, external interrupt 0: IE0, after the interrupt is enabled, it is generated when the INTO pin has a falling edge or a low level, and it is naturally cleared to 0 after responding to the interrupt
Timer 0: TF0 external interrupt 1: IE1 opens interrupt, when INT1 pin has a falling edge and a low level, it is automatically cleared to 0 after responding to the interrupt
Timer 1: After TF1 opens the interrupt, when the timing or counting time is reached, it will be automatically cleared to 0 after responding to the interrupt. In addition, if the interrupt is not opened, the software judgment is used, and the software needs to be cleared to 0.
Serial port: RI/TI, generated after receiving or sending a frame after communication starts, and needs to be cleared by software after responding to the interrupt.
5. If the frequency of the crystal oscillator is 3MHz, what is the maximum timing time of the timer/counter in working mode 0, 1, or 2?
Answer: Internal timing pulse cycle = machine cycle = 12/3Mhz = 4us
Working mode 0: Tmax
=8192*4us=32.768ms
Working mode 1: Tmax
=65536*4us=262.144ms
Working mode 2: Tmax
=256*4us=1.024ms[page]
6. When a timer/counter is used as a timer, who provides its counting pulses? What factors are related to the timing time?
Answer: Its counting pulse is provided by the machine cycle pulse output by the 12-divided frequency of the microcontroller oscillation pulse. The timing time is related to factors such as the working mode, crystal oscillator frequency and preset number.
VII. What are the characteristics of the working mode 2 of the timer/counter? What applications is it suitable for?
Answer: Working mode 2 has the characteristics of automatic reloading of initial values and cyclic operation. It is suitable for generating pulse signals with fixed pulse width and used as a serial port baud rate generator.
8. The timing time of a timer is limited. How to implement serial timing of two timers to achieve longer timing?
Answer: Method 1: Let one timer time first, and after it overflows, start another timer to time;
Method 2: Add a counter to the first interrupt handling subroutine. When the counter is full, start another timer and put the event to be processed in the second interrupt handling subroutine.
9. Briefly describe the process of receiving and sending data through the serial port.
Answer: The MCS-51 microcontroller has a full-duplex asynchronous serial communication port, namely the serial receive and transmit buffer (SBUF). These two physically independent receivers and transmitters can both receive and send data. The serial port sending process is: first read 8 bits of data from accumulator A into SBUF, then the hardware at the serial port automatically adds the start bit and stop bit to form a complete frame format, and then under the control of the shift pulse, it is serially output from the TXD terminal. After a character frame is sent, the TXD output line is maintained in the 1 state, and the TI of the SCON register is set to 1 to notify the CPU that the next character frame can be sent. The process of serial port reception is: the REN bit of SCON should be in the reception-allowed state (REN=1). Under this premise, the serial port samples the RXD end. When the sampled state changes from 1 to 0, it is determined that the start bit is received. Then, under the control of the shift pulse, the data bits received through the bit sampling pulse are shifted into the receive register until the stop bit arrives, and the stop bit is sent to RB8, and the interrupt flag RI is set to notify the CPU to take a received character from SBUF.
10. Why should mode 2 be used when timer/counter T1 is used as a serial port baud rate generator? If the clock frequency and communication baud rate are known, how to calculate their initial values?
Answer: Because mode 2 has the function of automatically reloading the count value, it can generate an accurate baud rate. The baud rate of serial working mode 0 and mode 2 is fixed, so there is no need to set the initial value; when serial working mode 1 and mode 3: Baud rate: BR = (2SMOD×Td)/32 Overflow time: 1/ Td = (256-TH1)*12/ fosc Overflow rate: Td = fosc/[12×(256-TH1)] Initial value: TH1 = 256- fosc/(12* Td)
11. Why is system expansion required in microcontroller application systems?
Answer: 8031, 8032 and other single-chip microcomputers do not provide user program memory, and the program memory must be expanded to store control programs, data tables, etc.; although 8751 and other single-chip microcomputers provide users with EPROM program memory, the program memory space capacity is not large. When the program storage space is insufficient, the external program memory must be expanded. The MCS-51 series single-chip microcomputer usually has 128B to 256B of on-chip data memory, which is sufficient for general control and calculation, but if it is used for data storage, its capacity is insufficient. In this case, the data memory must be expanded. The MCS-51 series single-chip microcomputer provides 32 I/O lines to the outside, but its P0 port is used as an address/data multiplexing port, P2 port is used to provide the high 8-bit address, and its P3 port has a second function. If the program memory or data memory is expanded, the I/O port of the single-chip microcomputer is often not enough, and sometimes the I/O port must be expanded. Sometimes, the application system also involves interface issues such as data input, output, and human-computer interaction information, and the relevant interface circuit expansion must be carried out.
12. What is the meaning of A/D and D/A conversion?
Answer: A/D conversion refers to the conversion of analog signals into digital signals, which is mainly used for analog signal data acquisition in microcomputer control systems. D/A conversion refers to the conversion of digital signals into analog signals, which is mainly used to restore analog signals or perform analog control.
13. What are the main technical indicators of the DAC0832 device? What do they mean?
Answer: DAC0832 is a device that converts digital signals into analog signals. Its main technical indicators and meanings are as follows: Resolution: 8 bits, which can convert 8-bit digital quantities into analog quantities; Settling time: 1μS, that is, the time from the digital quantity being written into the 8-bit DAC register to the generation of the analog output corresponding to the input digital quantity; Input signal: a binary signal compatible with TTL level; Output signal: a current signal corresponding to the input binary signal; Power supply: a single +5V power supply;
14. What are the main technical indicators of ADC0809 device? What do they mean?
Answer: ADC0809 is an AD device that converts analog signals into digital signals. Its main technical indicators and meanings are as follows: Resolution: 8 bits, which can convert the input analog quantity into the corresponding 8-bit digital quantity; Signal input range: 0-5V; Conversion time: the time required to complete an A/D conversion, which is related to the frequency of the external clock signal. When the external clock signal is 500KHz, the conversion time is 128μS; Output signal: 8-bit binary digital quantity corresponding to the input analog signal, and the signal level is compatible with the TTL level; Power supply: single +5V power supply;
Previous article:What is a 51 single-chip microcomputer? What are the main products of 51 single-chip microcomputer?
Next article:Hardware Design of Digital Sensor System Based on C8051F060 MCU
Recommended ReadingLatest update time:2024-11-16 15:56
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
- SIwave Chinese Training Manual
- Job hunting after the epidemic
- What are the advantages of machine vision defect detection systems?
- Happy New Year to everyone!
- How can a car's keyless entry system be hacked?
- What is a battery monitoring system (BMS)? What are its main functions? What is the BMS architecture? This article explains
- I want to learn quantum mechanics by myself. What kind of mathematics books should I read first? Thank you.
- What books are there on the desk for reading? [Show it]
- Actual development and experience of the second phase
- Problems with using modelsim