Hardware flow control of serial communication between MSP430 and GPRS module[Copy link]
The GPRS module selected is Siemens' MC52I. In order to reduce power consumption, the module's sleep mode is used (AT+CFUN=set the specific sleep mode). The sleep mode must first enable RTS/CTS flow control (set by AT\Q3). The RTS and CTS pins of MC52I are directly connected to the I/O port of MSP430F149. I don't quite understand how to implement flow control. Please give me more advice. After my own research, I finally figured out what's going on. Now I post it. If there are any mistakes, please correct me. MC52I can use AT\Q[num] (num=0/1/2/3) to select four modes: disabling flow control (num=0), XON/XOFF software flow control (num=1), only the module's CTS is valid (num=2) and RTS/CTS hardware flow control. It is worth noting that MC52I does not need to be set in this regard under normal circumstances, and the default is to disable the flow control mode. However, when you need to use the sleep mode of MC52I, you must set it to RTS/CTS hardware flow control, that is, send the AT command AT\Q3. At this time, send the AT command AT+CFUN=[num] (num=0/5/6/7/8/9 for sleep mode, 1 for full function mode) to set it to the relevant sleep mode. If you only do this, you will find that the microcontroller serial port cannot receive the data sent by MC52I during debugging, that is, communication is impossible. This is related to the RTS/CTS not being set properly. The following is the definition of RTS and CTS under the modem: RTS is valid (low level) means that DTE (here is the microcontroller) can receive, and CTS is valid means that the modem can receive. These two signals are independent of each other and represent the traffic situation in one direction respectively. The specific processing is as follows (borrowed from someone else's description dengm posted on 2005-1-14 07:52 Talking about single-chip microcomputers) Single-chip microcomputer side: Sending data - When it is found (not necessarily found in time) that CTS is invalid, stop sending; When it is found (not necessarily found in time) that CTS is valid, resume sending; Receive data - 0N, give RTS an invalid signal; Modem side: Same as above, but we don’t need to process the exchange of RTS and CTS on the modem side here, we only need to monitor the level of CTS. For the problem that the microcontroller serial port cannot receive data mentioned above, make the I/O port connected to RTS output a low level (if it is always set to a low level, it means that the microcontroller is always allowed to receive data. When the transmitted data is very large, it will cause data loss. Therefore, it is necessary to make RTS invalid when bytes>N given above), and then debug to find that the microcontroller receives the data returned by the modem.