CN107239422A - A kind of lossless method for receiving bursty data of TTL serial ports under low-power consumption mode - Google Patents

A kind of lossless method for receiving bursty data of TTL serial ports under low-power consumption mode Download PDF

Info

Publication number
CN107239422A
CN107239422A CN201710451086.3A CN201710451086A CN107239422A CN 107239422 A CN107239422 A CN 107239422A CN 201710451086 A CN201710451086 A CN 201710451086A CN 107239422 A CN107239422 A CN 107239422A
Authority
CN
China
Prior art keywords
pin
chip microcomputer
ttl serial
serial port
pins
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.)
Pending
Application number
CN201710451086.3A
Other languages
Chinese (zh)
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.)
Weihai Ploumeter Co Ltd
Original Assignee
Weihai Ploumeter 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 Weihai Ploumeter Co Ltd filed Critical Weihai Ploumeter Co Ltd
Priority to CN201710451086.3A priority Critical patent/CN107239422A/en
Publication of CN107239422A publication Critical patent/CN107239422A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Communication Control (AREA)

Abstract

The present invention relates to a kind of lossless method for receiving bursty data of TTL serial ports under low-power consumption mode, the technical problem of bursty data frame of main website can not effectively be received under low-power consumption mode by which solving existing single-chip microcomputer.Its Tx for including TTL serial ports sends pin, Rx with receiving pin, Gnd pin and the I/O pin with Rx reception pins in parallel, serial port module is in initialization, interrupting input pin is set to the Rx I/O pins for receiving pins in parallel and enables trailing edge interruption, when receiving bursty data, the start bit trailing edge of first character section can trigger I/O pin and interrupt wake-up single-chip microcomputer, single-chip microcomputer enables the receive capabilities that Rx receives pin, the complete data frame for receiving main website burst immediately.The present invention is widely used in serial data communication technical field.

Description

A kind of lossless method for receiving bursty data of TTL serial ports under low-power consumption mode
Technical field
The present invention relates to a kind of serial data communication technical field, gone here and there in particular to TTL under a kind of low-power consumption mode The lossless method for receiving bursty data of mouth.
Background technology
The measuring instruments such as intelligent calorimeter, water meter, are battery-powered equipment, with the use longevity up to 5 to 10 years Life.In order to which the single-chip microcomputer reduced in electric quantity consumption, equipment can periodically enter into low-power consumption mode.It is single under low-power consumption mode The master clock of piece machine is generally in halted state, and now most of peripheral circuit is also at resting state, it is necessary to called out in single-chip microcomputer It could start normal work after waking up.For the widely used Transistor-Transistor Logic level serial port circuit in single-chip microcomputer, how in low-power consumption The bursty data frame of intact reception main website is always the technological difficulties of single chip application under pattern.
The TTL serial datas of current single-chip microcomputer, which are received, typically following several schemes:
1st, communication two party increases an I/O pin and waken up for main website.This mode is simple and reliable, but is not for prominent The situation of hair, I/O pin is waken up in advance before communication.Turn TTL serial ports in for example long-range RS485 of many application scenarios to read There was only two lines in table, additional wires can not be increased, this serial ports with standard is incompatible, so using being restricted.
2nd, increase lead data, special wake-up association or particular address.It is actually to utilize loss to increase lead data Lead data ensure the integrality of follow-up data, special wake-up association or particular address be mainly each hardware chip and make by oneself The function of justice.The data content of many application scenarios is uncontrollable, and user is possible to self-defined and sends any data value, so This is not general solution.
3rd, part single-chip microcomputer is designed with special low-power consumption serial ports.But this serial ports is once enabled, power consumption still has Increased, requirement can not be met for power consumption requirements very harsh occasion.
The content of the invention
The present invention be exactly in order to solve existing above-mentioned technical problem there is provided a kind of communication line that need not increase both sides or Person increases extra data frame, and the lossless reception bursty data of TTL serial ports under the low-power consumption mode of any data byte is not lost Method.
The present invention provides TTL serial ports under a kind of low-power consumption mode the lossless method for receiving bursty data, including single-chip microcomputer and Main website, single-chip microcomputer is provided with TTL serial port modules and I/O pin, and the Tx of TTL serial port modules sends pin and the Rx pins of main website are connected, The Rx of TTL serial port modules receives pin and the Tx pins of main website are connected, the Gnd pins of TTL serial port modules and the Gnd pins of main website Connection, the Rx reception pins of TTL serial port modules are in parallel with I/O pin;
The lossless method for receiving bursty data of TTL serial port modules includes:
Step 1, TTL serial port modules are initialized;
Step 2, set the I/O pin of single-chip microcomputer to be input, and enable the trailing edge of I/O pin and interrupt;
Step 3, single-chip microcomputer enters low-power consumption mode, and it is high level, the IO of single-chip microcomputer that the Rx of TTL serial port modules, which receives pin, Pin is high level;
Step 4, main website sends bursty data frame, start bit one bit wide of generation of the first character section of bursty data frame I/O pin of the low level to single-chip microcomputer, the I/O pin of single-chip microcomputer is from high level into low level trailing edge saltus step, and triggering IO draws Pin is interrupted, and single-chip microcomputer is waken up, into interrupt handling routine;
Step 5, in interrupt handling routine, single-chip microcomputer enables TTL serial port module receive capabilities, starts to receive complete dash forward Send out data frame.
The present invention also provides TTL serial ports under a kind of low-power consumption mode the lossless method for receiving bursty data, including single-chip microcomputer And main website, single-chip microcomputer is provided with TTL serial port modules, and the Tx of TTL serial port modules sends pin and the Rx pins of main website are connected, TTL strings The Rx of mouth mold block receives pin and the Tx pins of main website are connected, and the Gnd pins of TTL serial port modules and the Gnd pins of main website are connected;
The lossless method for receiving bursty data of TTL serial port modules includes:
Step 1, TTL serial port modules are initialized, and wherein Rx pins are set to IO input functions;
Step 2, the trailing edge for enabling Rx pins is interrupted;
Step 3, single-chip microcomputer enters low-power consumption mode, and it is high level that the Rx of TTL serial port modules, which receives pin,;
Step 4, main website sends bursty data frame, start bit one bit wide of generation of the first character section of bursty data frame Rx pin of the low level to TTL serial port modules, the Rx pins of TTL serial port modules are from high level to low level trailing edge saltus step In, triggering Rx pins are interrupted, and single-chip microcomputer are waken up, into interrupt handling routine;
Step 5, in interrupt handling routine, single-chip microcomputer closes the I/O interrupt function of Rx pins, enables TTL serial port modules and connects Function is received, starts to receive complete bursty data frame.
Preferably technical scheme is, when serial communication baud rate is more than 2400bps, if interrupt pin wakes up single Piece machine receives the judgement of pin start bit to the time for enabling serial ports reception more than Rx, then receives bit width of the pin according to baud rate Simulation has received first complete bytes, and serial ports receive capabilities are enabled since second byte, receives complete bursty data Frame.
The beneficial effects of the invention are as follows communication line or the extra data frame of increase without increasing communication two party should It is real-time to bursty data, any data byte, the serial equipment of compatibility standard are not lost, it is adaptable to various low-power consumption monolithics Machine.
Further aspect of the present invention, by the description of detailed description below, is clearly stated that.
Brief description of the drawings
Fig. 1 is Principle of Communication figure between the TTL serial port modules and I/O pin of single-chip microcomputer and outside main website;
Fig. 2 is the method flow diagram that single-chip microcomputer receives bursty data using the TTL serial port modules of I/O pin;
Fig. 3 is the method flow diagram that single-chip microcomputer receives bursty data without using the TTL serial port modules of I/O pin;
Fig. 4 is the system number 0x55 of 2400bps communication baud rates 16 bursty data frame schematic diagram.
Symbol description in figure:
10. single-chip microcomputer, 20. main websites;Bursty data frame in Fig. 4 stops including 1 start bit, 8 data bit, 1 even parity bit, 1 Stop bit.
Embodiment
Referring to the drawings, the present invention is described in further detail with specific embodiment.
Embodiment 1
As shown in figure 1, single-chip microcomputer 10 is provided with TTL serial port modules and I/O pin, the Tx of TTL serial port modules sends pin and master Stand 20 the connection of Rx pins, the Rx of TTL serial port modules receives pin and is connected with the Tx pins of main website 20, the Gnd of TTL serial port modules Pin is connected with the Gnd pins of main website 20, and the Rx reception pins of TTL serial port modules are in parallel with I/O pin.
As shown in Fig. 2 under single-chip microcomputer low-power consumption mode, the method that TTL serial port modules receive bursty data includes:
Step S201:Single-chip microcomputer power-up initializing.
Step S202:TTL serial port modules are initialized, enable respectively Tx send pin and Rx receive pin serial ports send and Serial ports receive capabilities.
Step S203:It is input to set the I/O pin of single-chip microcomputer, and enables the interruption of I/O pin trailing edge.Rx receive pin with I/O pin is not interfere with each other.
Step S204:Single-chip microcomputer normal work, into low-power consumption mode, when no data is communicated, the Rx of TTL serial port modules connects Spasm pin is high level, and the I/O pin of single-chip microcomputer is high level.
Step S205:Main website 20 sends bursty data frame, the starting of the first character section of bursty data frame as shown in Figure 4 Position produces I/O pin of the low level of a bit wide to single-chip microcomputer, and the I/O pin of single-chip microcomputer is from high level to low level trailing edge In saltus step, triggering I/O pin is interrupted, and single-chip microcomputer is waken up, into interrupt handling routine.
Step S206:In interrupt handling routine, single-chip microcomputer enables TTL serial port module receive capabilities immediately, receives complete Bursty data frame.When serial communication baud rate is 2400bps, starting bit width is 417us.I/O pin wakes up single-chip microcomputer to opening Received with serial ports generally in 20us or so, the start bit for not influenceing Rx to receive pin judges.It is higher for serial communication baud rate, surpass 2400bps situation is crossed, is sentenced if I/O pin wake-up single-chip microcomputer receives pin start bit to the time for enabling serial ports reception more than Rx Disconnected time, I/O pin has received first character section according to the bit width simulation of baud rate, and string is enabled since second byte Mouth receive capabilities.
Embodiment 2
As shown in figure 1, single-chip microcomputer 10 is provided with TTL serial port modules and I/O pin, the Tx of TTL serial port modules sends pin and master Stand 20 the connection of Rx pins, the Rx of TTL serial port modules receives pin and is connected with the Tx pins of main website 20, the Gnd of TTL serial port modules Pin is connected with the Gnd pins of main website 20.The Rx of TTL serial port modules receives pin and is not connected to I/O pin.
As shown in figure 3, under single-chip microcomputer low-power consumption mode, the method that TTL serial port modules receive bursty data includes:
Step S301:Single-chip microcomputer power-up initializing.
Step S302:TTL serial port modules are initialized, and enable the serial ports sending function that Tx sends pin, and Rx receives pin and set It is set to IO inputs.
Step S303:The trailing edge for enabling Rx pins is interrupted.
Step S304:Single-chip microcomputer normal work, into low-power consumption mode, when no data is communicated, the Rx of TTL serial port modules connects Spasm pin is high level.
Step S305:Main website 20 sends bursty data frame, the starting of the first character section of bursty data frame as shown in Figure 4 Position produces Rx pin of the low level of a bit wide to TTL serial port modules, and the Rx pins of TTL serial port modules are from high level to low electricity In flat trailing edge saltus step, triggering Rx pins are interrupted, and single-chip microcomputer are waken up, into interrupt handling routine.
Step S306:In interrupt handling routine, single-chip microcomputer closes the I/O interrupt function of Rx pins immediately, enables TTL strings Mouth mold block receive capabilities, start to receive complete bursty data frame.
When serial communication baud rate is more than 2400bps, if the Rx of TTL serial port modules receives pin and wakes up monolithic Machine receives the time of pin start bit judgement to the time for enabling serial ports reception more than Rx, then Rx receives pin according to baud rate Bit width simulation has received first complete bytes, and serial ports receive capabilities are enabled since second byte, receives complete dash forward Send out data frame.
Above method is applied to the communication modes that single-chip microcomputer its own interfaces use TTL circuits, while being also applied for single-chip microcomputer The communication modes of other circuits, other communication modes such as RS232, RS485 are converted to using TTL between main website.
It is described above to be not intended to limit the invention only to the preferred embodiments of the present invention, for the skill of this area For art personnel, the present invention can have various modifications and variations.

Claims (3)

1. a kind of lossless method for receiving bursty data of TTL serial ports under low-power consumption mode, it is characterised in that:
Including single-chip microcomputer and main website, the single-chip microcomputer is provided with TTL serial port modules and I/O pin, and the Tx of the TTL serial port modules is sent out The Rx pins of pin and main website are sent to connect, the Rx of TTL serial port modules receives pin and the Tx pins of main website are connected, TTL serial ports moulds The Gnd pins of block and the Gnd pins of main website are connected, and the Rx reception pins of TTL serial port modules are in parallel with I/O pin;
The lossless method for receiving bursty data of the TTL serial port modules includes:
Step 1, TTL serial port modules are initialized;
Step 2, set the I/O pin of single-chip microcomputer to be input, and enable the trailing edge of I/O pin and interrupt;
Step 3, the single-chip microcomputer enters low-power consumption mode, and it is high level, the IO of single-chip microcomputer that the Rx of TTL serial port modules, which receives pin, Pin is high level;
Step 4, the main website sends bursty data frame, start bit one bit wide of generation of the first character section of bursty data frame I/O pin of the low level to single-chip microcomputer, the I/O pin of single-chip microcomputer is from high level into low level trailing edge saltus step, and triggering IO draws Pin is interrupted, and single-chip microcomputer is waken up, into interrupt handling routine;
Step 5, in interrupt handling routine, single-chip microcomputer enables TTL serial port module receive capabilities, starts to receive complete burst number According to frame.
2. a kind of lossless method for receiving bursty data of TTL serial ports under low-power consumption mode, it is characterised in that:
Including single-chip microcomputer and main website, the single-chip microcomputer is provided with TTL serial port modules, the Tx of the TTL serial port modules send pin with The Rx pins connection of main website, the Rx of TTL serial port modules receives pin and the Tx pins of main website are connected, and the Gnd of TTL serial port modules draws The Gnd pins connection of pin and main website;
The lossless method for receiving bursty data of the TTL serial port modules includes:
Step 1, TTL serial port modules are initialized, and wherein Rx pins are set to IO input functions;
Step 2, the trailing edge for enabling Rx pins is interrupted;
Step 3, the single-chip microcomputer enters low-power consumption mode, and it is high level that the Rx of TTL serial port modules, which receives pin,;
Step 4, the main website sends bursty data frame, start bit one bit wide of generation of the first character section of bursty data frame Rx pin of the low level to TTL serial port modules, the Rx pins of TTL serial port modules are from high level to low level trailing edge saltus step In, triggering Rx pins are interrupted, and single-chip microcomputer are waken up, into interrupt handling routine;
Step 5, in interrupt handling routine, single-chip microcomputer closes the I/O interrupt function of Rx pins, enables TTL serial port modules and receives work( Can, start to receive complete bursty data frame.
3. the lossless method for receiving bursty data of TTL serial ports, its feature under low-power consumption mode according to claim 1 or 2 Be, for serial communication baud rate be more than 2400bps in the case of, if interrupt pin wake up single-chip microcomputer arrive enable serial ports receive Time receives the judgement of pin start bit more than Rx, then receives pin and received first completely according to the bit width simulation of baud rate Byte, enables serial ports receive capabilities since second byte, receives complete bursty data frame.
CN201710451086.3A 2017-06-15 2017-06-15 A kind of lossless method for receiving bursty data of TTL serial ports under low-power consumption mode Pending CN107239422A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710451086.3A CN107239422A (en) 2017-06-15 2017-06-15 A kind of lossless method for receiving bursty data of TTL serial ports under low-power consumption mode

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710451086.3A CN107239422A (en) 2017-06-15 2017-06-15 A kind of lossless method for receiving bursty data of TTL serial ports under low-power consumption mode

Publications (1)

Publication Number Publication Date
CN107239422A true CN107239422A (en) 2017-10-10

Family

ID=59987776

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710451086.3A Pending CN107239422A (en) 2017-06-15 2017-06-15 A kind of lossless method for receiving bursty data of TTL serial ports under low-power consumption mode

Country Status (1)

Country Link
CN (1) CN107239422A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111624915A (en) * 2020-06-01 2020-09-04 上海移柯通信技术股份有限公司 Method for awakening microcontroller by upper computer through serial port
CN113660714A (en) * 2021-07-30 2021-11-16 烟台东方威思顿电气有限公司 Low-power consumption awakening method based on specific feature code
CN113721958A (en) * 2021-08-30 2021-11-30 易事特集团股份有限公司 Method for upgrading program by sharing port between rectifying side DSP and inverting side DSP
US11816060B2 (en) 2021-03-31 2023-11-14 Nuvoton Technology Corporation UART interface circuit and UART data capturing method
CN117591452A (en) * 2023-10-13 2024-02-23 广州沃风科技有限公司 External wake-up circuit of equipment and external wake-up method thereof

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101350995A (en) * 2008-08-26 2009-01-21 青岛海信移动通信技术股份有限公司 Awakening method between mobile terminal modules and multi-mode terminal using the same
CN101504565A (en) * 2009-03-04 2009-08-12 上海闻泰电子科技有限公司 Method for awakening chip module
CN102096649A (en) * 2011-02-10 2011-06-15 中兴通讯股份有限公司 UART-based sleep wakeup method and device
CN105225316A (en) * 2015-09-23 2016-01-06 曾松峰 A kind of dormancy of electron key low-power consumption power supply plan and awakening method
CN106372012A (en) * 2016-08-25 2017-02-01 长沙丰灼通讯科技有限公司 Serial port awakening system not using handshake control line and serial port communication method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101350995A (en) * 2008-08-26 2009-01-21 青岛海信移动通信技术股份有限公司 Awakening method between mobile terminal modules and multi-mode terminal using the same
CN101504565A (en) * 2009-03-04 2009-08-12 上海闻泰电子科技有限公司 Method for awakening chip module
CN102096649A (en) * 2011-02-10 2011-06-15 中兴通讯股份有限公司 UART-based sleep wakeup method and device
CN105225316A (en) * 2015-09-23 2016-01-06 曾松峰 A kind of dormancy of electron key low-power consumption power supply plan and awakening method
CN106372012A (en) * 2016-08-25 2017-02-01 长沙丰灼通讯科技有限公司 Serial port awakening system not using handshake control line and serial port communication method

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111624915A (en) * 2020-06-01 2020-09-04 上海移柯通信技术股份有限公司 Method for awakening microcontroller by upper computer through serial port
US11816060B2 (en) 2021-03-31 2023-11-14 Nuvoton Technology Corporation UART interface circuit and UART data capturing method
CN113660714A (en) * 2021-07-30 2021-11-16 烟台东方威思顿电气有限公司 Low-power consumption awakening method based on specific feature code
CN113660714B (en) * 2021-07-30 2024-04-26 烟台东方威思顿电气有限公司 Low-power consumption awakening method based on specific feature code
CN113721958A (en) * 2021-08-30 2021-11-30 易事特集团股份有限公司 Method for upgrading program by sharing port between rectifying side DSP and inverting side DSP
CN113721958B (en) * 2021-08-30 2024-04-02 易事特集团股份有限公司 Method for upgrading program of common port of rectifying side DSP and inverting side DSP
CN117591452A (en) * 2023-10-13 2024-02-23 广州沃风科技有限公司 External wake-up circuit of equipment and external wake-up method thereof
CN117591452B (en) * 2023-10-13 2024-06-14 广州沃风科技有限公司 External wake-up circuit of equipment and external wake-up method thereof

Similar Documents

Publication Publication Date Title
CN107239422A (en) A kind of lossless method for receiving bursty data of TTL serial ports under low-power consumption mode
CN106372012B (en) A kind of serial ports wake-up system and serial port communication method without using control line of shaking hands
KR20150120444A (en) Device, method and system for operation of a low power phy with a pcie protocol stack
CN208188815U (en) BMC module system
CN102088444A (en) PROFIBUS DP and PROFIBUS PA protocol conversion gateway module
CN107423239A (en) Low-power scm complete data frame method of reseptance under Halt patterns
CN203929881U (en) A kind of electric energy computation chip and intelligent electric meter card spacer assembly
CN110764585A (en) Universal independent BMC board card
CN101369948B (en) Communication system implementing low-power consumption
CN204229397U (en) RS232 serial ports and ethernet interface converter
CN101493806B (en) Data-transmission method of communication adapter
CN203632688U (en) Multifunctional communication interface machine device based on PowerPC embedded system
CN208013946U (en) A kind of generic server mainboard
CN208128284U (en) A kind of Ethernet based on S698PM turns Multi-path synchronous serial interface communication apparatus
CN108628793B (en) SPI communication circuit and method
CN206584185U (en) A kind of remote server power of computer room control system
CN210927649U (en) Gigabit dual-redundancy network card based on Compact PCI bus
CN201378316Y (en) Universal input/output interface extension circuit and mobile terminal with same
CN203930814U (en) A kind of CPU board card based on PCIE interface and configurable switch
CN103218334A (en) Computer peripheral cascade device based on USB (Universal Serial Bus) and RS485 bus
CN106227691A (en) A kind of based on the reciprocity bi-directional single-wire serial communication protocol between MCU
CN215264784U (en) Remote debugging system based on Feiteng S2500 server
CN206490682U (en) CAN and 422/485 common interface circuit
CN205983819U (en) Teletransmission water gauge M connection structure of BUS communication chip and singlechip
CN206114048U (en) Little consumption morning and evening tides liquid level changer

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20171010

RJ01 Rejection of invention patent application after publication