CN101833533B - USART (Universal Synchronous Asynchronous Receiver Transmitter) synchronous/asynchronous serial communication transmission display circuit and interruption method - Google Patents

USART (Universal Synchronous Asynchronous Receiver Transmitter) synchronous/asynchronous serial communication transmission display circuit and interruption method Download PDF

Info

Publication number
CN101833533B
CN101833533B CN2010101594155A CN201010159415A CN101833533B CN 101833533 B CN101833533 B CN 101833533B CN 2010101594155 A CN2010101594155 A CN 2010101594155A CN 201010159415 A CN201010159415 A CN 201010159415A CN 101833533 B CN101833533 B CN 101833533B
Authority
CN
China
Prior art keywords
port
chip microcomputer
pic single
interrupt
pic
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.)
Active
Application number
CN2010101594155A
Other languages
Chinese (zh)
Other versions
CN101833533A (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 University of Engineering Science
State Grid Shanghai Electric Power Co Ltd
Original Assignee
Shanghai University of Engineering Science
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 University of Engineering Science filed Critical Shanghai University of Engineering Science
Priority to CN2010101594155A priority Critical patent/CN101833533B/en
Publication of CN101833533A publication Critical patent/CN101833533A/en
Application granted granted Critical
Publication of CN101833533B publication Critical patent/CN101833533B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Control Of El Displays (AREA)

Abstract

The invention discloses a USART (Universal Synchronous Asynchronous Receiver Transmitter) synchronous/asynchronous serial communication transmission display circuit and an interruption method. The USART synchronous/asynchronous serial communication transmission display circuit comprises two PIC (Positive-Impedance Converter) singlechips, wherein each PIC singlechip comprises RD ports, RB ports, RC ports and VSS ports, the two PIC singlechips are divided into a main PIC singlechip and a secondary PIC singlechip, the number of the RD ports is eight, each RD port is connected with an LED light emitting diode in series, and each RB port of the main PIC singlechip and the secondary PIC singlechip is connected with an independent key circuit. The interruption method comprises the following steps of: in the display part of the main PIC singlechip, changing a display state by changing a scattering and rotating command and a cycle index; and realizing display information of the secondary PIC singlechip by directly transmitting port content to a secondary PIC singlechip port in real time by the main PIC singlechip through USART communication. The invention can effectively saves resources, increase the work efficiency of the simglechips and satisfy the quick-response requirement of on-line detection in a real-time monitoring process.

Description

The serial communication of USART synchronous/asynchronous transmits display circuit and interrupt method
Technical field
The present invention relates to a kind of display circuit, relate in particular to a kind of USART synchronous/asynchronous serial communication and transmit display circuit and interrupt method.
Background technology
Generally in real-time system, display circuit all needs to monitor in real time according to the input of keyboard or operation, shows that according to the result who monitors the real-time monitoring of keyboard is all finished by continuous scanning, this exists a shortcoming, is exactly the significant wastage to cpu resource.Therefore, how effectively to economize on resources, the work efficiency that improves single-chip microcomputer is the problem that the present inventor is devoted to study.
Summary of the invention
The objective of the invention is to overcome the defective of prior art and provide a kind of USART synchronous/asynchronous serial communication to transmit display circuit and interrupt method, it can reach when monitoring in real time, effectively aim of saving.
The technical scheme that realizes above-mentioned purpose is:
A kind of USART synchronous/asynchronous serial communication of one of the present invention transmits display circuit, comprise two PIC single-chip microcomputers, every PIC single-chip microcomputer includes the RD port, the RB port, RC port and VSS port, wherein, described two PIC single-chip microcomputers are divided into PIC single-chip microcomputer main frame and PIC single-chip microcomputer slave, the RD port of these two PIC single-chip microcomputers is eight, be respectively the RD0 port to the RD7 port, each RD port all is in series with a LED light emitting diode, the RB port of two PIC single-chip microcomputers includes the RB4 port, the RB5 port, the RB6 port, the RB7 port, each RB port of PIC single-chip microcomputer main frame and PIC single-chip microcomputer slave all is connected with an independent key circuit, the RC port of described PIC single-chip microcomputer main frame and PIC single-chip microcomputer slave comprises RC7 port and RC6 port, wherein, the RC7 port of PIC single-chip microcomputer main frame links to each other with the RC6 port of PIC single-chip microcomputer slave, the RC6 port of PIC single-chip microcomputer main frame links to each other with the RC7 port of PIC single-chip microcomputer slave, the VSS port ground connection of two PIC single-chip microcomputers.
Above-mentioned USART synchronous/asynchronous serial communication transmits display circuit, and wherein, described RD0 port to RD7 port is all connected with described LED light emitting diode by a resistance R.
Above-mentioned USART synchronous/asynchronous serial communication transmits display circuit, and wherein, being set to respectively of described four RB ports: the RB4 port is counting automatically; The RB5 port is single two demonstration; The RB6 port is the height conversion; The RB7 port is that two lamps flow.
The present invention's two a kind of USART synchronous/asynchronous serial communication transmits the interrupt method of display circuit, described USART synchronous/asynchronous serial communication transmits display circuit and comprises continuous PIC single-chip microcomputer main frame and PIC single-chip microcomputer slave, four RB ports of each PIC single-chip microcomputer all are connected with an independent key circuit, and their RD port all is in series with the LED light emitting diode, wherein, the variation that the variation of instruction and cycle index realizes its show state is changeed in the display part of described PIC single-chip microcomputer main frame by loosing, the display message of PIC single-chip microcomputer slave is directly by USART communication the port content to be delivered to the slave port in real time by PIC single-chip microcomputer main frame to realize that its interrupt method comprises:
At first, during initialization, open 2 interrupt responses in the PIC single-chip microcomputer of 14 interrupt sources is arranged, i.e. USART synchronous/asynchronous serial communication receives the data interruption mode and RB port level changes interrupt mode;
When any one interrupt source generation interrupt request of master and slave PIC single-chip microcomputer, in the Interrupt Process process, at first must discern the identity of interrupt source, differentiate and interrupt the generation source;
After judging interrupt source, carry out corresponding break in service, if interrupt causing, then before the master routine that returns the PIC single-chip microcomputer, serial communication must be received the zero clearing of data interruption zone bit by USART communication.
Above-mentioned USART synchronous/asynchronous serial communication transmits the interrupt method of display circuit, wherein,
Described USART synchronous/asynchronous serial communication receives the reception in the data interruption mode and sends data and realizes by USART synchronous/asynchronous serial communication mode, utilize its interrupt request that receives generation that the PIC single-chip microcomputer is entered and interrupt receiving the data that the other side PIC single-chip microcomputer sends over, with the button variable COUNTER in the renewal PIC single-chip microcomputer and the data of PIC single-chip microcomputer slave port;
It is to change by level to interrupt the input of identification keyboard that described RB port level changes interrupt mode, adopt high 4 bit levels of RB port to change interrupt function, realization is to the real-time monitoring of independent key circuit, 4 kinds of display modes are defined into the independent key circuit that RB4, RB5, RB6, RB7 pin are connected respectively, when key was pressed, the PIC single-chip microcomputer caused that by button level changes response and interrupts.
Above-mentioned USART synchronous/asynchronous serial communication transmits the interrupt method of display circuit, wherein, change in the interrupt mode at described RB port level, the independent key circuit that detects 4 button RB4, RB5, RB6, RB7 correspondence successively has or not to be pressed, according to different button inputs button variable COUNTER is set and is respectively 0,1,2,3, before end interrupt is returned master routine, by USART synchronous/asynchronous serial communication mode, the numerical value of present button variable COUNTER is sent to another PIC single-chip microcomputer.
The invention has the beneficial effects as follows: the present invention is in order effectively to economize on resources, improve the work efficiency of single-chip microcomputer, satisfy the online detection requirement of response fast simultaneously, 4 distinctive level of 4 independent key circuits and RB port are changed interrupt function pin RB4~7 link to each other, the present invention ground connected mode constitutes two-shipper USART (universal synchronous/asynchronous serial reception/transmitter) synchronous/asynchronous serial communication.When pressing main or during from the independent key circuit that RB4, RB5, RB6, RB7 connected of single-chip microcomputer, host and slave processors RD port connects 8 LED light emitting diodes will show synchronously that certain key presses pairing display mode, interrupt pin by the PIC single-chip microcomputer has overcome original real time scan ground mode, has saved great resource.
Description of drawings
Fig. 1 is the circuit diagram that one of the present invention's USART synchronous/asynchronous serial communication transmits display circuit.
Embodiment
The invention will be further described below in conjunction with accompanying drawing.
See also Fig. 1, a kind of USART synchronous/asynchronous serial communication that there is shown one of the present invention transmits display circuit, comprise two PIC single-chip microcomputers, every PIC single-chip microcomputer includes the RD port, the RB port, RC port and VSS port, two PIC single-chip microcomputers are divided into PIC single-chip microcomputer main frame 1 and PIC single-chip microcomputer slave 2, the RD port of these two PIC single-chip microcomputers is eight, be respectively the RD0 port to the RD7 port, each RD port all is in series with a LED light emitting diode 4, the RB port of two PIC single-chip microcomputers includes the RB4 port, the RB5 port, the RB6 port, the RB7 port, each RB port of PIC single-chip microcomputer main frame 1 and PIC single-chip microcomputer slave 2 all is connected with an independent key circuit 3, the RC port of PIC single-chip microcomputer main frame 1 and PIC single-chip microcomputer slave 2 comprises RC7 port and RC6 port, wherein, the RC7 port of PIC single-chip microcomputer main frame 1 links to each other with the RC6 port of PIC single-chip microcomputer slave 2, the RC6 port of PIC single-chip microcomputer main frame 1 links to each other with the RC7 port of PIC single-chip microcomputer slave 2, the VSS port ground connection of two PIC single-chip microcomputers, RD0 port to RD7 port is all connected with LED light emitting diode 4 by a resistance R.
Being set to respectively of four RB ports:
RB4: count automatically;
RB5: single two demonstration;
RB6: height conversion;
RB7: two lamps flow.
Working method of the present invention: when pressing main or during from RB4, RB5, RB6, RB7 connected the independent key circuit 3 of single-chip microcomputer, the RD port of PIC single-chip microcomputer host and slave processors 1,2 connects 8 LED light emitting diodes 4 will show synchronously that certain key presses pairing display mode.
The present invention's two a kind of USART synchronous/asynchronous serial communication transmits the interrupt method of display circuit, the serial communication of USART synchronous/asynchronous transmits display circuit and comprises continuous PIC single-chip microcomputer main frame and PIC single-chip microcomputer slave, four RB ports of each PIC single-chip microcomputer all are connected with an independent key circuit, and their RD port all is in series with the LED light emitting diode, the variation that the variation of instruction and cycle index realizes its show state is changeed in the display part of PIC single-chip microcomputer main frame by loosing, introduced the master among the present invention, the notion of slave, the display message of PIC single-chip microcomputer slave is directly by USART communication the port content to be delivered to the slave port in real time by PIC single-chip microcomputer main frame to realize that its interrupt method comprises:
At first, during initialization, open 2 interrupt responses in the PIC single-chip microcomputer of 14 interrupt sources is arranged, i.e. USART synchronous/asynchronous serial communication receives the data interruption mode and RB port level changes interrupt mode;
When any one interrupt source generation interrupt request of master and slave PIC single-chip microcomputer, in the Interrupt Process process, at first must discern the identity of interrupt source, differentiate and interrupt the generation source;
After judging interrupt source, carry out corresponding break in service, if interrupt causing, then before the master routine that returns the PIC single-chip microcomputer, serial communication must be received the zero clearing of data interruption zone bit by USART communication.
Among the present invention, the serial communication of USART synchronous/asynchronous receives the reception in the data interruption mode and sends data and realizes by USART synchronous/asynchronous serial communication mode, utilize its interrupt request that receives generation that the PIC single-chip microcomputer is entered and interrupt receiving the data that the other side PIC single-chip microcomputer sends over, with the button variable COUNTER in the renewal PIC single-chip microcomputer and the data of PIC single-chip microcomputer slave port, because PIC single-chip microcomputer main frame can change PIC single-chip microcomputer slave COUNTER value, PIC single-chip microcomputer slave also can change PIC single-chip microcomputer host C OUNTER value, and the output video data of PIC single-chip microcomputer slave sends renewal in real time by PIC single-chip microcomputer main frame, so realized the synchro control and the demonstration of two PIC single-chip microcomputers;
It is to change by level to interrupt the input of identification keyboard that RB port level changes interrupt mode, adopt high 4 bit levels of RB port to change interrupt function, realization is to the real-time monitoring of independent key circuit, 4 kinds of display modes are defined into RB4 respectively, RB5, RB6, the independent key circuit that the RB7 pin is connected, when key is pressed, the PIC single-chip microcomputer causes that by button level changes response and interrupts, change in the interrupt mode at RB port level, detect 4 button RB4 successively, RB5, RB6, the independent key circuit of RB7 correspondence has or not to be pressed, according to different button inputs button variable COUNTER is set and is respectively 0,1,2,3, before end interrupt is returned master routine, by USART synchronous/asynchronous serial communication mode, the numerical value of present button variable COUNTER is sent to another PIC single-chip microcomputer.
Above embodiment is only for the usefulness that the present invention is described, but not limitation of the present invention, person skilled in the relevant technique, under the situation that does not break away from the spirit and scope of the present invention, can also make various conversion or modification, therefore all technical schemes that are equal to also should belong to category of the present invention, should be limited by each claim.

Claims (5)

1. a USART synchronous/asynchronous serial communication transmits display circuit, comprise two PIC single-chip microcomputers, every PIC single-chip microcomputer includes the RD port, the RB port, RC port and VSS port, it is characterized in that, described two PIC single-chip microcomputers are divided into PIC single-chip microcomputer main frame and PIC single-chip microcomputer slave, the RD port of these two PIC single-chip microcomputers is eight, be respectively the RD0 port to the RD7 port, each RD port all is in series with a LED light emitting diode, the RB port of two PIC single-chip microcomputers includes the RB4 port, the RB5 port, the RB6 port, the RB7 port, each RB port of PIC single-chip microcomputer main frame and PIC single-chip microcomputer slave all is connected with an independent key circuit, the RC port of described PIC single-chip microcomputer main frame and PIC single-chip microcomputer slave includes RC7 port and RC6 port, wherein, the RC7 port of PIC single-chip microcomputer main frame links to each other with the RC6 port of PIC single-chip microcomputer slave, the RC6 port of PIC single-chip microcomputer main frame links to each other with the RC7 port of PIC single-chip microcomputer slave, the VSS port ground connection of two PIC single-chip microcomputers
Described RD0 port to RD7 port is all connected with described LED light emitting diode by a resistance R.
2. USART synchronous/asynchronous serial communication according to claim 1 transmits display circuit, it is characterized in that being set to respectively of described four RB ports: the RB4 port is counting automatically; The RB5 port is single two demonstration; The RB6 port is the height conversion; The RB7 port is that two lamps flow.
3. a USART synchronous/asynchronous serial communication as claimed in claim 1 transmits the interrupt method of display circuit, described USART synchronous/asynchronous serial communication transmits display circuit and comprises continuous PIC single-chip microcomputer main frame and PIC single-chip microcomputer slave, four RB ports of each PIC single-chip microcomputer all are connected with an independent key circuit, and their RD port all is in series with the LED light emitting diode, it is characterized in that, the variation that the variation of instruction and cycle index realizes its show state is changeed in the display part of described PIC single-chip microcomputer main frame by loosing, the display message of PIC single-chip microcomputer slave is directly by USART communication the port content to be delivered to the slave port in real time by PIC single-chip microcomputer main frame to realize that its interrupt method comprises:
At first, during initialization, open 2 interrupt responses in the PIC single-chip microcomputer of 14 interrupt sources is arranged, i.e. USART synchronous/asynchronous serial communication receives the data interruption mode and RB port level changes interrupt mode;
When any one interrupt source generation interrupt request of master and slave PIC single-chip microcomputer, in the Interrupt Process process, at first must discern the identity of interrupt source, differentiate and interrupt the generation source;
After judging interrupt source, carry out corresponding break in service, if interrupt causing, then before the master routine that returns the PIC single-chip microcomputer, serial communication must be received the zero clearing of data interruption zone bit by USART communication.
4. USART synchronous/asynchronous serial communication according to claim 3 transmits the interrupt method of display circuit, it is characterized in that,
Described USART synchronous/asynchronous serial communication receives the reception in the data interruption mode and sends data and realizes by USART synchronous/asynchronous serial communication mode, utilize its interrupt request that receives generation to make the PIC single-chip microcomputer enter interruption, receive the data that the other side PIC single-chip microcomputer sends over, with the button variable COUNTER in the renewal PIC single-chip microcomputer and the data of PIC single-chip microcomputer slave port;
It is to change by level to interrupt the input of identification keyboard that described RB port level changes interrupt mode, adopt high 4 bit levels of RB port to change interrupt function, realization is to the real-time monitoring of independent key circuit, 4 kinds of display modes are defined into the independent key circuit that RB4, RB5, RB6, RB7 pin are connected respectively, when key was pressed, the PIC single-chip microcomputer caused that by button level changes response and interrupts.
5. USART synchronous/asynchronous serial communication according to claim 4 transmits the interrupt method of display circuit, it is characterized in that, change in the interrupt mode at described RB port level, the independent key circuit that detects 4 button RB4, RB5, RB6, RB7 correspondence successively has or not to be pressed, according to different button inputs button variable COUNTER is set and is respectively 0,1,2,3, before end interrupt is returned master routine, by USART synchronous/asynchronous serial communication mode, the numerical value of present button variable COUNTER is sent to another PIC single-chip microcomputer.
CN2010101594155A 2010-04-29 2010-04-29 USART (Universal Synchronous Asynchronous Receiver Transmitter) synchronous/asynchronous serial communication transmission display circuit and interruption method Active CN101833533B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010101594155A CN101833533B (en) 2010-04-29 2010-04-29 USART (Universal Synchronous Asynchronous Receiver Transmitter) synchronous/asynchronous serial communication transmission display circuit and interruption method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010101594155A CN101833533B (en) 2010-04-29 2010-04-29 USART (Universal Synchronous Asynchronous Receiver Transmitter) synchronous/asynchronous serial communication transmission display circuit and interruption method

Publications (2)

Publication Number Publication Date
CN101833533A CN101833533A (en) 2010-09-15
CN101833533B true CN101833533B (en) 2011-10-05

Family

ID=42717605

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010101594155A Active CN101833533B (en) 2010-04-29 2010-04-29 USART (Universal Synchronous Asynchronous Receiver Transmitter) synchronous/asynchronous serial communication transmission display circuit and interruption method

Country Status (1)

Country Link
CN (1) CN101833533B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103793345B (en) * 2012-11-02 2016-08-03 华为技术有限公司 data terminal equipment and interface clock control method
US10148420B2 (en) 2016-11-29 2018-12-04 Nxp B.V. Serial data communications using a UART module and method therefor
CN112099881A (en) * 2020-09-03 2020-12-18 广东芬尼克兹节能设备有限公司 Pointer-based control program system parameter exception handling method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2097421U (en) * 1991-08-30 1992-02-26 陈江南 Microcomputer multipurpose instrument for scoring, quiz, timing
CN2438292Y (en) * 2000-07-04 2001-07-04 张树泉 Infrared remote controller of lamp
CN2442455Y (en) * 2000-09-01 2001-08-08 林灿松 Electronic switch with remote control
CN1340920A (en) * 2000-09-01 2002-03-20 林灿松 Electronic switch with remote control function

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1078925A (en) * 1996-09-05 1998-03-24 Nec Eng Ltd Communication device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2097421U (en) * 1991-08-30 1992-02-26 陈江南 Microcomputer multipurpose instrument for scoring, quiz, timing
CN2438292Y (en) * 2000-07-04 2001-07-04 张树泉 Infrared remote controller of lamp
CN2442455Y (en) * 2000-09-01 2001-08-08 林灿松 Electronic switch with remote control
CN1340920A (en) * 2000-09-01 2002-03-20 林灿松 Electronic switch with remote control function

Also Published As

Publication number Publication date
CN101833533A (en) 2010-09-15

Similar Documents

Publication Publication Date Title
CN100511200C (en) Control method, system and equipment of single serial port multi-CPU
CN101833533B (en) USART (Universal Synchronous Asynchronous Receiver Transmitter) synchronous/asynchronous serial communication transmission display circuit and interruption method
CN106656960A (en) Hilscher-based credible data acquisition system and method
CN105446928A (en) Address automatically allocated serial bus communication method and system
CN102279827A (en) Multifunctional communication transit box
CN105323328A (en) Automatic address identification method by utilizing MODBUS communication protocol on RS-485
CN102890563A (en) Blade server KVW (keyboard, video and mouse) device
CN105243044A (en) Serial port based management system and management method
CN103530247B (en) The priority concocting method of bus access between a kind of node based on multiserver
CN104112413A (en) LED display screen dead pixel point inspection system
CN110719147B (en) High-reliability dual-computer hot standby data acquisition method based on LoRa
CN102005126B (en) Multi-intersection traffic signal control machine
CN205193797U (en) Multi -functional interface system of test usefulness
CN103631658A (en) Blade server KVM switching and cascade solution
CN207319048U (en) Pipeline stall positions and remote alarming device
CN201655255U (en) Double-singlechip communication keying state synchronous display circuit structure based on PIC singlechip
CN205921709U (en) Accuse switch detection device in tax accuse tanker aircraft
CN105718231A (en) KVM (Keyboard Video Mouse) redundancy management system and management method of blade server
CN212302262U (en) Multi-channel data remote acquisition controller
CN212847014U (en) Control system
CN207008014U (en) A kind of test board of server logic Control card
CN209496370U (en) Button control system
CN106595764A (en) Distributive detecting and analyzing system in combination with XRD and XRF
CN102135581A (en) Method for monitoring probe test utilization rate in real time
CN202197272U (en) Indicating lamp panel device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: STATE GRID SHANGHAI ELECTRIC POWER COMPANY

Effective date: 20140318

C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20140318

Address after: 201620 Shanghai city Songjiang District Dragon Road No. 333

Patentee after: Shanghai University of Engineering Science

Patentee after: State Grid Shanghai Municipal Electric Power Company

Address before: 201620 Shanghai city Songjiang District Dragon Road No. 333

Patentee before: Shanghai University of Engineering Science