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

Timer/counter multifunctional multiplexing algorithm and device Download PDF

Info

Publication number
CN101764569A
CN101764569A CN200910110677A CN200910110677A CN101764569A CN 101764569 A CN101764569 A CN 101764569A CN 200910110677 A CN200910110677 A CN 200910110677A CN 200910110677 A CN200910110677 A CN 200910110677A CN 101764569 A CN101764569 A CN 101764569A
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.)
Granted
Application number
CN200910110677A
Other languages
Chinese (zh)
Other versions
CN101764569B (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 algorithm. The algorithm 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 algorithm and device
Technical field
The present invention relates to a kind of timer/counter multifunctional multiplexing algorithm, the particularly a kind of timer/counter multifunctional multiplexing algorithm 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 algorithm.
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 algorithm comprises a timer/counter is provided; By 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 by down trigger, thereby the monitoring pulse spacing.
In the timer/counter multifunctional multiplexing algorithm of the present invention, described timer/counter is 16 bit timing device/counters.
In the timer/counter multifunctional multiplexing algorithm 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 algorithm 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 algorithm 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 algorithm 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 the port that is used for the PG Electric Machine Control and is used for the port of 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 algorithm.
Compared to prior art, timer/counter multifunctional multiplexing algorithm of the present invention and device utilize the port definition of timer/counter and the multifunctional multiplexing that down trigger realizes PG Electric Machine Control and pulse spacing monitoring, have well utilized 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 algorithm is realized the schematic diagram of PG Electric Machine Control.
Fig. 4-the 5th utilizes timer/counter multifunctional multiplexing algorithm of the present invention to realize the schematic diagram 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 (as TV remote etc.), and described pulse monitoring interruptive port INTP2 is a fracture in the infrared reception.
Timer/counter multifunctional multiplexing algorithm of the present invention adopts timer/counter to realize the control and the pulse spacing of PG motor are monitored.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 algorithm 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 the present embodiment).
Seeing also Fig. 1-2, is the schematic diagram that timer of the present invention/comparator multifunctional multiplexing algorithm is realized the PG Electric Machine Control.Please consulting Fig. 3-4 simultaneously, is to utilize timer/counter multifunctional multiplexing algorithm of the present invention to realize the schematic diagram 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 specific implementation process and the principle of the multifunctional multiplexing of PG Electric Machine Control and pulse spacing monitoring are as follows:
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 feeds back by the reference motor and regulates X.
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, as 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 by 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: as shown in Figure 3-4, if trailing edge A, B point is 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 by 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 to give up the value of this point so.So in actual applications, 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 algorithm, 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 algorithm of the present invention and device utilize the port definition of timer/counter and the multifunctional multiplexing that down trigger realizes PG Electric Machine Control and pulse spacing monitoring, have well utilized the resources of chip of timer/counter.
The above only is preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of being done within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.

Claims (10)

1. timer/counter multifunctional multiplexing algorithm comprises:
One timer/counter is provided;
The voltage interruption point of setting the PG motor by 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 by described timer/counter down trigger, thus the monitoring pulse spacing.
2. timer/counter multifunctional multiplexing algorithm as claimed in claim 1 is characterized in that: described timer/counter is 16 bit timing device/counters.
3. timer/counter multifunctional multiplexing algorithm 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 algorithm 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 algorithm 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 algorithm 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 algorithm as claimed in claim 6, it is characterized in that: counter is automatic clear when overflowing.
8. timer/counter multifunctional multiplexing device is characterized in that: comprise timer/counter, described timer/counter comprises the port that is used for the PG Electric Machine Control and is used for the port of pulse spacing monitoring.
9. timer/counter multifunctional multiplexing device as claimed in claim 8, it is characterized in that: 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.
10. a timer/counter multifunctional multiplexing device is characterized in that: comprise the timer/counter that is used for as the arbitrary described timer/counter multifunctional multiplexing algorithm 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 true CN101764569A (en) 2010-06-30
CN101764569B 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)

Cited By (2)

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

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR0154853B1 (en) * 1995-08-23 1998-12-15 김광호 Rectifying circuit and its control method of model reference type
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

Cited By (2)

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

Also Published As

Publication number Publication date
CN101764569B (en) 2012-06-13

Similar Documents

Publication Publication Date Title
CN102904766B (en) Baud rate identification method and device for serial communication and monitoring equipment
CN101764569B (en) Timer/counter multifunctional multiplexing algorithm and device
US9747244B2 (en) Clockless virtual GPIO
CN105824275B (en) A kind of method that slave station servo-driver is controlled to synchronize main website
CN103186150A (en) Alternating current heater control device and method
TW201439712A (en) Dithering circuit for serial data transmission
CN103566573A (en) Automatic counting device based on comprehensive basketball shooting training system and counting method thereof
CN110943900B (en) Carrier monitoring multi-access RS485 bus circuit with collision detection and method
CN111812476A (en) IGBT module electrical parameter online measurement device and method
CN105305932B (en) Electric machine speed regulation control method, device and smoke exhaust ventilator
CN105682271A (en) PPG drive frequency detection system for induction cooker
CN102237845B (en) Method for controlling motor
EP2819019A1 (en) Latency probe
CN1309169C (en) Multipath clock detecting device
CN204947738U (en) A kind of monitoring information acquisition control device of adapted to multi-type transducer
CN109240130A (en) Programmable pin level control circuit
CN105811971B (en) Variable ratio frequency changer clock source based on counter and FPGA device
CN103869155B (en) Method and device for electric generator frequency measurement based on PLC high-speed input
EP2810138A2 (en) Timebase peripheral
CN109580975A (en) A kind of speed detector based on pwm signal, processing circuit and chip
TW201340585A (en) Modularized control circuit with signal-capturing function for fan motor and method for controlling the same
CN211930937U (en) Silicon controlled rectifier detection control circuit and LED module of adjusting luminance
CN109831139A (en) A kind of thyristor speed control module reducing noise jamming
CN105629013B (en) timing anti-creeping device and method for electric energy metering
CA2700014C (en) Clock-detecting circuit

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