CN111198776A - Method for preventing UART (universal asynchronous receiver/transmitter) from receiving lost data during deep sleep of MCU (microprogrammed control unit) - Google Patents

Method for preventing UART (universal asynchronous receiver/transmitter) from receiving lost data during deep sleep of MCU (microprogrammed control unit) Download PDF

Info

Publication number
CN111198776A
CN111198776A CN201911359020.7A CN201911359020A CN111198776A CN 111198776 A CN111198776 A CN 111198776A CN 201911359020 A CN201911359020 A CN 201911359020A CN 111198776 A CN111198776 A CN 111198776A
Authority
CN
China
Prior art keywords
uart
mcu
deep sleep
pll
clock
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911359020.7A
Other languages
Chinese (zh)
Other versions
CN111198776B (en
Inventor
吴亮
汪成喜
詹胜林
邓敏
徐栋麟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Lightning Semiconductor Technology Co ltd
Original Assignee
Shanghai Lightning Semiconductor Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Lightning Semiconductor Technology Co ltd filed Critical Shanghai Lightning Semiconductor Technology Co ltd
Priority to CN201911359020.7A priority Critical patent/CN111198776B/en
Publication of CN111198776A publication Critical patent/CN111198776A/en
Application granted granted Critical
Publication of CN111198776B publication Critical patent/CN111198776B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0745Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in an input/output transactions management context
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0721Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment within a central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4418Suspend and resume; Hibernate and awake

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Communication Control (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

The invention discloses a method for preventing UART (universal asynchronous receiver/transmitter) from receiving lost data during deep sleep of an MCU (microprogrammed control unit), which comprises the following steps of: s1, the MCU enters a deep sleep mode, the PLL is closed, the system main Clock is closed, the UART is in an awake on power domain, and the Clock source APB Clock of the UART is switched to the crystal from the PLL; s2, UART receives the first data frame and then initiates a wake-up signal to CPU; and S3, after the MCU is awakened, the PLL is opened, the Clock source APB Clock of the UART is switched from the crystal to the PLL, and the software system enters a normal operation mode. The invention is characterized in that: the MCU is directly awakened through the UART without additional GPIO, the MCU uses the UART to receive data in the deep sleep process, the other side does not need to wait, dummy data does not need to be sent, GPIO interruption resources are not additionally occupied, and the UART is guaranteed to receive data without loss.

Description

Method for preventing UART (universal asynchronous receiver/transmitter) from receiving lost data during deep sleep of MCU (microprogrammed control unit)
Technical Field
The invention relates to the technical field of computer communication, in particular to a method for preventing UART (universal asynchronous receiver/transmitter) from receiving lost data during deep sleep of an MCU (microprogrammed control unit).
Background
A UART (Universal Asynchronous Receiver/Transmitter) Universal Asynchronous Receiver/Transmitter is a peripheral interface commonly used in a Universal MCU and various wireless SOCs, the MCU/SOC needs to save power consumption in some battery-powered application scenarios to prolong the service cycle of the device battery, so that it can enter a deep sleep mode (PLL off, system master off, 32.768KHz low-power low-speed clock on) in a period without task, and in the deep sleep mode, the MCU/SOC can only be awakened by RTC and GPIO interrupt, so that the MCU/SOC cannot be awakened in time in the process of receiving external burst data frames of indefinite length, resulting in data loss, and there are two commonly used methods for waking up the MCU at present:
as shown in fig. 1, a GPIO is used to firstly awaken the MCU/SOC, then wait for a period of time until the MCU/SOC is stable, and then communicate with the MCU/SOC through a UART;
as shown in fig. 2, a GPIO of the MCU/SOC is configured to be in an interrupt mode and connected to the Rx pin of the UART, the UART transmitter first transmits a Dummy data, so that the GPIO connected to the UART Rx pin generates an interrupt to wake up the MCU/SOC, the Dummy data is long enough to ensure that the MCU/SOC can be completely woken up and the UART can normally receive data during the time of transmitting the data.
Disclosure of Invention
The present invention is directed to overcome the above-mentioned disadvantages and to provide a method for preventing UART from receiving lost data during deep sleep of MCU.
The technical scheme adopted by the invention for realizing the purpose is as follows: a method for preventing UART (Universal asynchronous receiver transmitter) from receiving lost data during deep sleep of an MCU (microprogrammed control Unit) comprises the following steps:
s1, the MCU enters a deep sleep mode, the PLL is closed, the system main Clock is closed, the UART is in an awake on power domain, and the Clock source APB Clock of the UART is switched to the crystal from the PLL;
s2, UART receives the first data frame and then initiates a wake-up signal to CPU;
and S3, after the MCU is awakened, the PLL is opened, the Clock source APB Clock of the UART is switched from the crystal to the PLL, and the software system enters a normal operation mode.
The UART writes the received data frame into the FIFO during the period from when the first data frame is received from the UART to when the software system enters the normal operating mode.
The invention is characterized in that: the MCU is directly awakened through the UART without additional GPIO, the MCU uses the UART to receive data in the deep sleep process, the other side does not need to wait, dummy data does not need to be sent, GPIO interruption resources are not additionally occupied, and the UART is guaranteed to receive data without loss.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention and not to limit the invention.
Fig. 1 is a schematic diagram of waking up an MCU through GPIO in the prior art.
Fig. 2 is a schematic diagram of the prior art waking up the MCU by configuring the GPIO to interrupt mode.
FIG. 3 is a schematic diagram of the present invention for directly waking up the MCU through UART.
Detailed Description
As used herein, the term "comprising" is used in the present specification and claims to mean that the term "comprises" or "comprising" is used in the present specification and claims to mean that the term comprises, or that the term "comprises" or "comprises" comprising "or" comprises, the scope of the present invention is defined by the appended claims.
The present invention will be described in further detail with reference to fig. 3, but the present invention is not limited thereto.
The invention discloses a method for preventing UART (universal asynchronous receiver/transmitter) from receiving lost data during deep sleep of an MCU (microprogrammed control unit), which comprises the following steps of:
s1, the MCU enters a deep sleep mode, the PLL is closed, the system main Clock is closed, the UART is in an awake on power domain, and the Clock source APB Clock of the UART is switched to the crystal from the PLL;
s2, UART receives the first data frame process to identify the start signal, the start directly awakens the CPU;
and S3, after the MCU is awakened, the PLL is opened in a software mode, the Clock source APB Clock of the UART is switched from the crystal to the PLL, and the software system enters a normal operation mode.
In order to prevent data loss during a time period from when the UART receives a first data frame identification start signal to when the software system enters a normal operation mode, the UART preferentially writes the data frames received during the time period into the FIFO, and the FIFO depth supports software configuration so as to ensure that data cannot be lost under different baud rates.
The invention can directly awaken the MCU through the UART without additional GPIO, the MCU uses the UART to receive data in the deep sleep process, the other party does not wait, the dummy data does not need to be sent, the GPIO interruption resource is not occupied additionally, and the UART can be ensured not to receive the data.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art should be able to cover the technical solutions and the inventive concepts of the present invention within the technical scope of the present invention.

Claims (2)

1. A method for preventing UART from receiving lost data during deep sleep of an MCU is characterized by comprising the following steps:
s1, the MCU enters a deep sleep mode, the PLL is closed, the system main Clock is closed, the UART is in an awake on power domain, and the Clock source APB Clock of the UART is switched to the crystal from the PLL;
s2, UART receives the first data frame and then initiates a wake-up signal to CPU;
and S3, after the MCU is awakened, the PLL is opened, the Clock source APB Clock of the UART is switched from the crystal to the PLL, and the software system enters a normal operation mode.
2. The method of claim 1, wherein the UART receives lost data during deep sleep of the MCU, the method comprising: the UART writes the received data frame into the FIFO during the period from when the first data frame is received from the UART to when the software system enters the normal operating mode.
CN201911359020.7A 2019-12-25 2019-12-25 Method for preventing UART (universal asynchronous receiver/transmitter) from receiving lost data during deep sleep period of MCU (micro controller Unit) Active CN111198776B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911359020.7A CN111198776B (en) 2019-12-25 2019-12-25 Method for preventing UART (universal asynchronous receiver/transmitter) from receiving lost data during deep sleep period of MCU (micro controller Unit)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911359020.7A CN111198776B (en) 2019-12-25 2019-12-25 Method for preventing UART (universal asynchronous receiver/transmitter) from receiving lost data during deep sleep period of MCU (micro controller Unit)

Publications (2)

Publication Number Publication Date
CN111198776A true CN111198776A (en) 2020-05-26
CN111198776B CN111198776B (en) 2024-06-07

Family

ID=70747077

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911359020.7A Active CN111198776B (en) 2019-12-25 2019-12-25 Method for preventing UART (universal asynchronous receiver/transmitter) from receiving lost data during deep sleep period of MCU (micro controller Unit)

Country Status (1)

Country Link
CN (1) CN111198776B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090096924A1 (en) * 2005-11-30 2009-04-16 Fengshaun Zhou Method and Apparatus for Providing a Stable Clock Signal
CN202126688U (en) * 2011-02-21 2012-01-25 山东力创科技有限公司 Universal MCU (Microprogrammed Control Unit) chip based on ARM Cortex M0
WO2012106973A1 (en) * 2011-02-10 2012-08-16 中兴通讯股份有限公司 Uart-based wake-up from sleep method and device
CN103323683A (en) * 2013-06-09 2013-09-25 中国科学院深圳先进技术研究院 Portable electromagnetic wave strength detecting device and method
CN104143017A (en) * 2014-07-07 2014-11-12 燕山大学 FPGA (field programmable gate array)-based UKF (unscented Kalman filter) algorithm and filtering on brain dynamics model by FPGA-based UKF algorithm
CN104950775A (en) * 2015-06-29 2015-09-30 小米科技有限责任公司 Circuit, method and device for waking up main MCU (micro control unit)
US20170003728A1 (en) * 2015-07-01 2017-01-05 Xiaomi Inc. Method and device for waking up a controller
CN108282186A (en) * 2018-03-07 2018-07-13 杭州先锋电子技术股份有限公司 A kind of UART communication systems, method, equipment and computer storage media
CN109947226A (en) * 2019-04-03 2019-06-28 深圳芯马科技有限公司 A kind of UART wake-up circuit of MCU chip
CN110413558A (en) * 2019-07-15 2019-11-05 广芯微电子(广州)股份有限公司 A kind of realization low-power consumption serial port module dynamic dividing method

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090096924A1 (en) * 2005-11-30 2009-04-16 Fengshaun Zhou Method and Apparatus for Providing a Stable Clock Signal
WO2012106973A1 (en) * 2011-02-10 2012-08-16 中兴通讯股份有限公司 Uart-based wake-up from sleep method and device
CN202126688U (en) * 2011-02-21 2012-01-25 山东力创科技有限公司 Universal MCU (Microprogrammed Control Unit) chip based on ARM Cortex M0
CN103323683A (en) * 2013-06-09 2013-09-25 中国科学院深圳先进技术研究院 Portable electromagnetic wave strength detecting device and method
CN104143017A (en) * 2014-07-07 2014-11-12 燕山大学 FPGA (field programmable gate array)-based UKF (unscented Kalman filter) algorithm and filtering on brain dynamics model by FPGA-based UKF algorithm
CN104950775A (en) * 2015-06-29 2015-09-30 小米科技有限责任公司 Circuit, method and device for waking up main MCU (micro control unit)
US20170003728A1 (en) * 2015-07-01 2017-01-05 Xiaomi Inc. Method and device for waking up a controller
CN108282186A (en) * 2018-03-07 2018-07-13 杭州先锋电子技术股份有限公司 A kind of UART communication systems, method, equipment and computer storage media
CN109947226A (en) * 2019-04-03 2019-06-28 深圳芯马科技有限公司 A kind of UART wake-up circuit of MCU chip
CN110413558A (en) * 2019-07-15 2019-11-05 广芯微电子(广州)股份有限公司 A kind of realization low-power consumption serial port module dynamic dividing method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
PUMIN DUANGMANEE 等: "Clock-Frequency Switching Technique for Energy Saving of Microcontroller Unit (MCU)-Based Sensor Node", 《ENERGIES》, vol. 11, no. 5, pages 1 - 13 *
蒋建武 等: "Kinetis系列MCU时钟系统结构与配置研究", 《电子器件》, vol. 37, no. 6, pages 1172 - 1176 *

Also Published As

Publication number Publication date
CN111198776B (en) 2024-06-07

Similar Documents

Publication Publication Date Title
US10684670B2 (en) Methods and apparatus for managing power with an inter-processor communication link between independently operable processors
US7898994B2 (en) Power saving in multi-processor device
US8332676B2 (en) Methods of preparing a power saving state, universal serial bus device and universal serial bus host
CN106372012A (en) Serial port awakening system not using handshake control line and serial port communication method
CN107295615B (en) Method for waking up wireless equipment
CN110568919B (en) Device for reducing chip power consumption
WO2010037330A1 (en) Method for reducing the power consumption of rf sim card on the waiting mode
CN110568921B (en) Method for reducing chip power consumption
WO2012106973A1 (en) Uart-based wake-up from sleep method and device
KR20160027981A (en) Method for sending heartbeat message and mobile terminal
CN105225316A (en) A kind of dormancy of electron key low-power consumption power supply plan and awakening method
CN104267992A (en) Method and device for shielding wake-up program of mobile terminal
CN110572869A (en) equipment awakening method and device based on BLE and Hall switch
CN106598193B (en) Power consumption control method and device
CN114430542A (en) Energy saving method and terminal equipment
US8825917B2 (en) Method, system and device for enabling USB data card with USB flash drive function to hibernate
CN111198776A (en) Method for preventing UART (universal asynchronous receiver/transmitter) from receiving lost data during deep sleep of MCU (microprogrammed control unit)
CN108282186B (en) A kind of UART communication system, method, equipment and computer storage medium
CN202806677U (en) Keyless entry system and microprocessor arousing unit
CN110999417B (en) Low power supporting programmable hardware sleep cycle controller for 802.11 wireless devices
CN115002881A (en) Upper computer awakening method, device and system, electronic equipment and storage medium
CN205566298U (en) A BLE4. 0 module for UART communication sleep awakens up
CN110278602A (en) A kind of low-power consumption can external MUC NBIOT application method
CN110362351A (en) A kind of execution method of the NBIOT application process system of low-power consumption
CN109901696B (en) USB integrated circuit power saving method and USB integrated circuit

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant