MSM7512B is a single-chip FSK modem. It complies with the ITUT V.23 standard and can support two data transmission modes: 1200 b/s half-duplex or 1 200 b/s receive/75 b/s transmit full-duplex. MSM7512B is convenient for control or one-way data communication. Such systems are often composed of a small microcontroller at the execution end and a computer at the processing and control end. Such as remote meter reading, remote alarm, remote detection and remote in-system programming through the network. However, if remote two-way data communication through an analog access network is required, the problem is not simple. This leads to the question of how to use MSM7512B for remote communication between PC and microcontroller.
1 Communication scheme and mode
The communication scheme should be determined by the specific application. When the PC and the MCU communicate through the public telephone exchange network, since the MSM7512B has no additional functional circuits, a dialing circuit needs to be added to the initiating connection end and a ring detection circuit needs to be added to the answering connection end. If the connection request is initiated by the computer, the communication scheme can be shown in Figure 1.
Figure 1 Communication block diagram
The MOD1 and MOD2 pins 14 and 15 of MSM7512B are used to control the communication working mode. When MOD2=0 and MOD1=0, the chip is in the sending mode and can only send data at 1200 b/s; when MOD2=0 and MOD1=1, it is in the receiving mode and can receive data at 1200 b/s or send data at 75 b/s. Unfortunately, there is no mode for MSM7512B to receive data at 75 b/s, so when both the PC and the microcontroller use MSM7512B, full-duplex sending and receiving data is not possible.
However, the data transmission between the computer and the microcontroller is bidirectional. If there is no response confirmation, the communication process will be difficult to continue. This leads to the question of how to use two MSM7512Bs to achieve bidirectional communication at the link layer in half-duplex mode at the physical layer. In other words, one party uses MOD2=0, MOD1=0, and the other party uses MOD2=0, MOD1=1, and these two modes need to be continuously switched during the communication process.
2 Issues that must be paid attention to during mode conversion
According to the design scheme proposed above, it is found that the simplex mode in both directions is feasible through one-way communication test. But this does not mean that half-duplex communication is necessarily feasible. When the modem mode is changed during the communication process after the connection is established, thereby changing the direction of sending and receiving, the received data will be sometimes correct and sometimes incorrect. Obviously, changing the mode during the communication process is an issue worth exploring. After repeated tests and analysis, it was found that when the MSM7512B of both machines are in the receiving state, that is, when neither of them sends data, one party can actually receive some strange data. This means that if one party has switched from the sending mode to the receiving mode and the other party has not had time to switch, the two communicating parties will be in the receiving state at the same time (see Figure 2), and at this time the signal on the analog channel is zero, and the noise on it is mistakenly regarded as a signal by the MSM7512B and received, resulting in the generation of some interference data and affecting normal communication. [page]
Figure 2 General communication sequence
For this reason, a new communication sequence needs to be formulated to ensure that both parties cannot be in the receiving state at the same time during the communication process, that is, both parties are either in the sending state, or one sends and the other receives. Figure 3 shows the situation in this new communication sequence where the PC sends data and the MCU sends a response. Among them, Td is the data transmission delay, Tc is the MSM7512B mode conversion delay, and T1 and T2 are artificial delays set to avoid both parties being in the receiving state at the same time. The MCU saves data only after receiving the correct frame, and does not operate when waiting to receive the retransmitted frame, and the required time is Tsave. Similarly, the PC loads data when sending a new frame, and does not need to operate when retransmitting the frame, and the required time is Tload.
Figure 3: Send and receive
Under normal transmission and reception conditions (no retransmission), for the MCU, once it receives data from the computer, it immediately changes to the transmission mode, but after changing to the transmission mode, it does not immediately send a response, but waits for the computer to be ready to receive the response after a delay of T1. The MCU cannot immediately switch to the receiving mode after sending the response, but should delay T2 time to ensure that the computer has transferred to the transmission mode before that. If it is a confirmation response, save the data and then switch to the receiving mode. If it is a negative response, directly switch to the receiving mode. For the computer side, the state transfer process is similar. That is, the computer immediately changes to the transmission mode after receiving the response from the MCU. If it is a confirmation response, load the next set of data, and then delay T1 time to wait for the MCU to be ready to receive the data before sending the data. If it is a negative response, directly delay T1 time to wait for the MCU to be ready to receive the state, and then resend the data. The computer cannot immediately switch to the receiving mode after sending the data, but should delay T2 time to ensure that the MCU has transferred to the transmission response mode before that. Obviously, in the case of symmetric links, assuming that the time to load data and save data is the same, T1>T2 should be true.
So how do we determine T1 and T2? In order to ensure that both parties cannot be in the receiving state at the same time during the communication process (that is, both parties are either in the sending state, or one is sending and the other is receiving), it is not difficult to derive the following relationship:
Because both Tsave and Tload are related to the specific frame length, that is, the machine rate. For example, the microcontroller processes data slower than the PC. Therefore, the longer the frame, the longer the data saving time is. The longer the data loading time, to ensure the correct mode conversion, T1 increases accordingly. Therefore, the delay value, that is, the value of T1 and T2, also depends on the specific data length when the data transmission rate is constant. Through experiments, it is found that when the frame length is 54 bytes, the values of T1 and T2 are 100 ms and 50 ms, which are more reasonable. When the frame length is 100 bytes, the values of T1 and T2 are 200 ms and 100 ms, which are more reasonable. For other lengths of T1 and T2, the trial and error method can be used to test multiple groups of data to compare and select the better one. The principle of selection is to select a smaller value under the premise of ensuring that data transmission can proceed normally.
3 Transmission efficiency
The following relationship can be seen from the timing diagram of Figure 3:
Assume that the frame length is N1 bytes, the response length is N2 bytes, and the data transmission rate is Rb/s. When there are 10 code elements per byte, the total time required to transmit a piece of data is Ts.
Ts≈2T1+2Tc+2Td+[(N1+N2)×10/R]×1 000 (ms)?(3)
Among them, Td is related to the path length and the medium, and Tc is related to the modulation and demodulation chip, and they are generally small. Since the transmission efficiency is inversely proportional to the transmission time, when N1, N2, and R are constant, formula (3) shows that the transmission efficiency is mainly determined by T1, that is, the smaller T1 is, the higher the transmission efficiency. Note that the delay T2 is to ensure that the sender is still in the sending mode before the receiver changes to the sending mode during the communication process, and also to ensure that it changes to the receiving mode before the other party sends the data. Its selection only needs to satisfy the relationship (1). On the surface, it has nothing to do with the transmission efficiency, but because T1 is restricted by T2, it implies the requirement for T2. It can be seen that the reasonable selection of the artificial delay time T1 and T2 for mode conversion is the key to improving transmission efficiency.
Using the above solution, the MSM7512B can be used to correctly send and receive remote data between the PC and the microcontroller.
Previous article:Describe how to achieve communication between microcontroller and touch screen
Next article:Motor and PFC control based on 8-bit microcontroller
Recommended ReadingLatest update time:2024-11-16 22:25
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Siemens Motion Control Technology and Engineering Applications (Tongxue, edited by Wu Xiaojun)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
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
- "Recommend Chinese chips" + domestic FPGA
- [Rawpixel RVB2601 Creative Application Development] Running Routine HELLOWORLD
- EEWORLD University ---- Microwave Technology Basics
- How to deploy and install docker service on arm platform
- [SAMR21 New Gameplay] 6. Graphical Programming - Breathing Light 2
- MS3142 can replace A3906
- FPGA implementation of parallel fast FIR filter.pdf
- Sensor selection
- [Atria AT32WB415 series Bluetooth BLE 5.0 MCU] + IAP (Bootloader)
- 【Radio Waves】What is the source of Bluetooth? Does it have any radiation that may affect your health? Is it safe?