CN101764569B - Timer/counter multifunctional multiplexing algorithm and device - Google Patents

Timer/counter multifunctional multiplexing algorithm and device Download PDF

Info

Publication number
CN101764569B
CN101764569B CN200910110677XA CN200910110677A CN101764569B CN 101764569 B CN101764569 B CN 101764569B CN 200910110677X A CN200910110677X A CN 200910110677XA CN 200910110677 A CN200910110677 A CN 200910110677A CN 101764569 B CN101764569 B CN 101764569B
Authority
CN
China
Prior art keywords
timer
counter
port
multifunctional multiplexing
motor
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.)
Expired - Fee Related
Application number
CN200910110677XA
Other languages
Chinese (zh)
Other versions
CN101764569A (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.)
Shenzhen H&T Intelligent Control Co Ltd
Original Assignee
Shenzhen H&T Intelligent Control 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 Shenzhen H&T Intelligent Control Co Ltd filed Critical Shenzhen H&T Intelligent Control Co Ltd
Priority to CN200910110677XA priority Critical patent/CN101764569B/en
Publication of CN101764569A publication Critical patent/CN101764569A/en
Application granted granted Critical
Publication of CN101764569B publication Critical patent/CN101764569B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a timer/counter multifunctional multiplexing method. The method comprises that a timer/counter; the voltage interruption point of a PG motor is set as a zero crossing point and the sum of motor shutdown intervals is set through the timer/counter, and the motor shutdown intervals are adjusted by using actual rotating speed detected by a motor feedback device, so the adjustment and the control of the working voltage of the PG motor are realized; triggering is interrupted to enable the timer to counter the interval between two adjacent points to monitor pulse interval. The invention additionally provides a timer/counter multifunctional multiplexing device. By using the port definition and the triggering interruption of the timer/counter, the invention has the advantages that the multifunctional multiplexing of the PG motor control and the pulse interval monitoring is realized and the chip resource of the timer/counter is properly utilized.

Description

A kind of timer/counter multifunctional multiplexing method and device
Technical field
The present invention relates to a kind of timer/counter multifunctional multiplexing method, particularly a kind of timer/counter multifunctional multiplexing method that can realize PG Electric Machine Control and pulse spacing monitoring.The invention still further relates to a kind of timer/counter multifunctional multiplexing device.
Background technology
Timer/counter in the single-chip microcomputer is used widely in various control circuits at present.Yet common timer/counter all only is used to realize simple function, does not possess multifunctional multiplexing.
Summary of the invention
In order to solve above-mentioned prior art problems, be necessary to provide a kind of timer/counter multifunctional multiplexing method.
In order to solve above-mentioned prior art problems, also be necessary to provide a kind of timer/counter multifunctional multiplexing device.
A kind of timer/counter multifunctional multiplexing method comprises one timer/counter is provided; Through the voltage interruption point of setting the PG motor is the time interval sum that zero crossing and motor stop, and the actual speed adjustment motor dwell time interval that utilizes the motor feedback to measure, thereby the adjustment that realizes the PG motor operating voltage is controlled; With make timer count the time interval of consecutive points through down trigger, thereby the monitoring pulse spacing.
In the timer/counter multifunctional multiplexing method of the present invention, described timer/counter is 16 bit timing device/counters.
In the timer/counter multifunctional multiplexing method of the present invention, comprise that also it is free mode of operation that timer/counter is set; Definition is used for the port of PG Electric Machine Control; Be used for the port of pulse spacing monitoring with definition.
In the timer/counter multifunctional multiplexing method of the present invention, the port that definition is used for the PG Electric Machine Control comprises zero passage interruptive port, motor feedback interruptive port and is used to produce the port of the output of timer interval break period, realization SCR control signal.
In the timer/counter multifunctional multiplexing method of the present invention, the port that definition is used for the pulse spacing monitoring comprises pulse monitoring interruptive port.
In the timer/counter multifunctional multiplexing method of the present invention, comprise that also the time of utilizing pulse to monitor to calculate adjacent two zero crossings monitors the frequency of AC power.
A kind of timer/counter multifunctional multiplexing device is characterized in that: comprise timer/counter, described timer/counter comprises port that is used for the PG Electric Machine Control and the port that is used for the pulse spacing monitoring.
In the timer/counter multifunctional multiplexing device of the present invention; Also comprise infrared receiving-transmitting device; The port of described PG Electric Machine Control comprise zero passage interruptive port, motor feedback interruptive port and be used to produce timer break period at interval, realize that the port of the output of SCR control signal, the port of described pulse spacing monitoring comprise that the infrared reception that is used to receive the interrupt signal that described infrared receiving-transmitting device sends interrupts broken ends of fractured bone mouth.
A kind of timer/counter multifunctional multiplexing device comprises the timer/counter that is used for above-mentioned arbitrary described timer/counter multifunctional multiplexing method.
Compared to prior art; Timer/counter multifunctional multiplexing method of the present invention and device utilize port definition and the down trigger of timer/counter to realize the multifunctional multiplexing that PG Electric Machine Control and pulse spacing are monitored, good use the resources of chip of timer/counter.
Description of drawings
Fig. 1 is the block diagram of timer of the present invention/comparator multifunctional multiplexing device.
Fig. 2-the 3rd, timer of the present invention/comparator multifunctional multiplexing method realizes the sketch map of PG Electric Machine Control.
Fig. 4-the 5th utilizes timer/counter multifunctional multiplexing method of the present invention to realize the sketch map that remote control receives.
Embodiment
Seeing also Fig. 1, is the block diagram of timer of the present invention/comparator multifunctional multiplexing device.Described timer/comparator multifunctional multiplexing dress comprises that 16 bit timings device/counter device, described timer/counter comprise port that is used for the PG Electric Machine Control and the port that is used for the pulse spacing monitoring.The port of described PG Electric Machine Control comprise zero passage interruptive port INTP0, motor feedback interruptive port INTP1 and be used to produce timer break period at interval INTIM000, realize that the port of the output of SCR control signal, the port of described pulse spacing monitoring comprise the pulse monitoring interruptive port INTP2 that is used to receive the interrupt signal that described infrared receiving-transmitting device sends.In the change execution mode of timer of the present invention/comparator multifunctional multiplexing device; Described timer/counter multifunctional multiplexing device also comprises infrared receiving-transmitting device (like TV remote etc.), and described pulse monitoring interruptive port INTP2 is a fracture in the infrared reception.
Timer/counter multifunctional multiplexing method of the present invention adopts timer/counter to realize control and pulse spacing monitoring to the PG motor.Realize that with 16 bit timings device/counter PG Electric Machine Control and remote controller are received as example, are described in detail timer/counter multifunctional multiplexing method of the present invention below.
Wherein, timer/counter each pin of being used for the PG Electric Machine Control comprises: INTP0 zero passage interruptive port; INTP1 motor feedback interruptive port;
INTIM000 is used to produce timer interval break period, realizes the output of SCR control signal, and definition CR00 is the comparand register of 16 bit timings/counter, and TM00 is the counter register of 16 bit timings/counter.
The pin that timer/counter is used for the pulse spacing monitoring comprises:
INTP2 pulse monitoring interruptive port (being fracture in the infrared reception in this execution mode).
Seeing also Fig. 1-2, is the sketch map that timer of the present invention/comparator multifunctional multiplexing method realizes the PG Electric Machine Control.Please consulting Fig. 3-4 simultaneously, is to utilize timer/counter multifunctional multiplexing method of the present invention to realize the sketch map that remote control receives.
Utilize 16 a bit timings/counter to realize the time that produces the timer interruption is calculated and controls in the remote controller code monitoring simultaneously, thereby thereby control silicon controlled angle of flow adjustment PG motor operating voltage in the PG motor.Wherein, the concrete implementation procedure and the principle of the multifunctional multiplexing of PG Electric Machine Control and pulse spacing monitoring are following:
1,16 bit timings/comparator being set earlier is the free-running operation pattern, and counter is zero clearing when overflowing.
2, to the realization of PG Electric Machine Control: shown in Fig. 1-2, X=(B-A), A, C, E are zero crossing, and B, D are the timer point of interruption.The CR00=TM00 that B is ordered (A)+X, wherein X is the blanking time that motor stops, and regulates X through feeding back with reference to motor.
If A is the zero passage point of interruption, at this moment close the PG motor power, read counter register TM00 at the A point, giving comparand register CR00 the value of TM00+X, open 16 bit timing devices simultaneously and interrupt.When counter equals CR00, produce and interrupt, like B point among Fig. 1.Timer INTIM00 interrupts and can trigger at the B point, at this moment opens the PG motor power.
Measured the motor actual speed through the motor speed feedback again, the rotating speed and the actual speed that relatively need are adjusted X.
3, the realization of pulse spacing monitoring: shown in Fig. 3-4; If trailing edge A, B point are pulse monitoring interruptive port INTP2 down trigger point; When A, B point down trigger, write down the counter TM00 value of each timing/comparator; Ask the poor of two TM00 values simultaneously, be the interpulse period of remote controller.Process above the circulation.Just can monitor the time interval of these pulses.For example, trigger through external interrupt, timer is counted the time interval of consecutive points, as shown in Figure 4 the time interval=TM00 (B)-TM00 (A).Utilizing in the 16 bit timing devices free timing TM00 to add that a period of time is controlled produces regularly break period.
In the above-mentioned execution mode of the present invention, in 16 bit timings/comparator because free schema automatic clear after counter is FFFFH, if during the pulse monitoring on this transition point, need give up the value of this point so.So in practical application, regularly/figure place of comparator is high more good more because like this transition point relative pulse time just few more.
In other change execution modes of timer of the present invention/comparator multifunctional multiplexing method, above-mentioned pulse spacing monitoring can also be used for other and use.As, the time of utilizing the pulse monitoring technique to calculate adjacent two zero crossings is monitored frequency f=1/2 (C-A) of AC power.So just realized having realized the control of PG motor with 16 a bit timings/counter.
Timer/counter multifunctional multiplexing method of the present invention and device utilize port definition and the down trigger of timer/counter to realize the multifunctional multiplexing that PG Electric Machine Control and pulse spacing are monitored, good use the resources of chip of timer/counter.
The above is merely preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of within spirit of the present invention and principle, being done, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.

Claims (9)

1. timer/counter multifunctional multiplexing method comprises:
One timer/counter is provided;
The voltage interruption point of setting the PG motor through described timer/counter is the time interval sum that zero crossing and motor stop; And the actual speed adjustment motor dwell time interval that utilizes the motor feedback to measure, thereby the adjustment that realizes the PG motor operating voltage is controlled; With
Make timer count the time interval of consecutive points through described timer/counter down trigger, thus the monitoring pulse spacing.
2. timer/counter multifunctional multiplexing method as claimed in claim 1 is characterized in that: described timer/counter is 16 bit timing device/counters.
3. timer/counter multifunctional multiplexing method as claimed in claim 1 is characterized in that: comprise that also it is free mode of operation that timer/counter is set; Definition is used for the port of PG Electric Machine Control; Be used for the port of pulse spacing monitoring with definition.
4. timer/counter multifunctional multiplexing method as claimed in claim 3 is characterized in that: the port that definition is used for the PG Electric Machine Control comprises zero passage interruptive port, motor feedback interruptive port and is used to produce the port of the output of timer interval break period, realization SCR control signal.
5. timer/counter multifunctional multiplexing method as claimed in claim 3 is characterized in that: the port that definition is used for the pulse spacing monitoring comprises pulse monitoring interruptive port.
6. timer/counter multifunctional multiplexing method as claimed in claim 3 is characterized in that: comprise that also the time of utilizing pulse to monitor to calculate adjacent two zero crossings monitors the frequency of AC power.
7. timer/counter multifunctional multiplexing method as claimed in claim 6, it is characterized in that: counter is automatic clear when overflowing.
8. multiplexer that adopts each said timer/counter multifunctional multiplexing method in the claim 1 to 7; It is characterized in that: comprise timer/counter; Described timer/counter comprises port that is used for the PG Electric Machine Control and the port that is used for the pulse spacing monitoring; Also comprise infrared receiving-transmitting device; The port of described PG Electric Machine Control comprise zero passage interruptive port, motor feedback interruptive port and be used to produce timer break period at interval, realize that the port of the output of SCR control signal, the port of described pulse spacing monitoring comprise that the infrared reception that is used to receive the interrupt signal that described infrared receiving-transmitting device sends interrupts broken ends of fractured bone mouth.
9. a timer/counter multifunctional multiplexing device is characterized in that: comprise the timer/counter that is used for like the arbitrary described timer/counter multifunctional multiplexing method of claim 1-7.
CN200910110677XA 2009-10-20 2009-10-20 Timer/counter multifunctional multiplexing algorithm and device Expired - Fee Related CN101764569B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200910110677XA CN101764569B (en) 2009-10-20 2009-10-20 Timer/counter multifunctional multiplexing algorithm and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910110677XA CN101764569B (en) 2009-10-20 2009-10-20 Timer/counter multifunctional multiplexing algorithm and device

Publications (2)

Publication Number Publication Date
CN101764569A CN101764569A (en) 2010-06-30
CN101764569B true CN101764569B (en) 2012-06-13

Family

ID=42495586

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910110677XA Expired - Fee Related CN101764569B (en) 2009-10-20 2009-10-20 Timer/counter multifunctional multiplexing algorithm and device

Country Status (1)

Country Link
CN (1) CN101764569B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102237845B (en) * 2011-07-06 2013-06-19 四川长虹电器股份有限公司 Method for controlling motor
CN110635726A (en) * 2019-10-18 2019-12-31 中国电子科技集团公司第四十三研究所 Speed detection method and detection circuit for non-inductive brushless motor

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1299182A (en) * 1999-12-08 2001-06-13 中国科学院武汉物理与数学研究所 Method for using timing system of computer to control step motor
CN1068154C (en) * 1995-08-23 2001-07-04 三星电子株式会社 Model reference following commutation circuit and adjusting method thereof
CN2456132Y (en) * 2000-12-08 2001-10-24 中国科学院长春光学精密机械与物理研究所 Controlling system for preventing runaway of photoelectric transit
CN1779722A (en) * 2004-11-18 2006-05-31 华为技术有限公司 Device for acquiring apparatus running time
CN101320337A (en) * 2008-07-16 2008-12-10 北京中星微电子有限公司 Timer and its implementing method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1068154C (en) * 1995-08-23 2001-07-04 三星电子株式会社 Model reference following commutation circuit and adjusting method thereof
CN1299182A (en) * 1999-12-08 2001-06-13 中国科学院武汉物理与数学研究所 Method for using timing system of computer to control step motor
CN2456132Y (en) * 2000-12-08 2001-10-24 中国科学院长春光学精密机械与物理研究所 Controlling system for preventing runaway of photoelectric transit
CN1779722A (en) * 2004-11-18 2006-05-31 华为技术有限公司 Device for acquiring apparatus running time
CN101320337A (en) * 2008-07-16 2008-12-10 北京中星微电子有限公司 Timer and its implementing method

Also Published As

Publication number Publication date
CN101764569A (en) 2010-06-30

Similar Documents

Publication Publication Date Title
CN101764569B (en) Timer/counter multifunctional multiplexing algorithm and device
CN105824275B (en) A kind of method that slave station servo-driver is controlled to synchronize main website
CN102904766A (en) Baud rate identification method and device for serial communication and monitoring equipment
KR20150128658A (en) Dithering circuit for serial data transmission
CN103186150A (en) Alternating current heater control device and method
CN103092257B (en) Self-adaptive trigger synchronization control device
CN111812476A (en) IGBT module electrical parameter online measurement device and method
CN102237845B (en) Method for controlling motor
EP2819019A1 (en) Latency probe
US9201446B2 (en) Timebase peripheral
CN103869155B (en) Method and device for electric generator frequency measurement based on PLC high-speed input
CN104216317A (en) Enabling signal control circuit used for improving data transmission reliability of RS485 bus
CN105811971B (en) Variable ratio frequency changer clock source based on counter and FPGA device
CN109062021A (en) It is a kind of to interrupt the method and air conditioner for generating time base by zero passage
CN106873403B (en) CAN controller
CN104993820A (en) Calibration device and calibration method for frequency of oscillator
CN204794661U (en) Thyristor trigger based on computer
CN105629013B (en) timing anti-creeping device and method for electric energy metering
CN109327333A (en) A kind of message stops paying out method and device
RU2674878C1 (en) Device for synchronizing microcontrollers
RU106406U1 (en) CONTROLLER CONTROLLER MODULE
CN106970570B (en) A kind of vibration control method for electrovibrating feeder
CA2700014C (en) Clock-detecting circuit
CN203965515U (en) For the power-measuring device of Engine Room intermediate frequency generating station automatic control equipment
CN209710067U (en) A kind of trigger pulse plate

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120613

Termination date: 20211020

CF01 Termination of patent right due to non-payment of annual fee