Summary of the invention
The technical problem to be solved in the present invention is to provide a kind of semaphores with clock synchronizing function, to solve in master control
When module breaks down, because the clock crystal oscillator component variations on each light control module make clock frequency deviation occur, lead to difference
The phenomenon that Time Inconsistency of lamp control plate and then time of occurrence entanglement, occurs, be dedicated to improving the stability of traffic control system and
Reliability provides traffic safety certain guarantee.
The technical scheme is that a kind of semaphore with clock synchronizing function, including main controller module, secondary control
Device module processed, wireless transmitter module, clock synchronization module, light control module, power module;Main controller module, submaster controller mould
Block, wireless transmitter module are connect with light control module respectively, and light control module is connect with clock synchronization module and power module respectively.
Further, the main controller module by microprocessor STC89C52RC, resistor R1, capacitor C1~C3 with
And crystal oscillator Y1 composition;Wherein, 3.3V power supply in the power port VCC connection power module of microprocessor STC89C52RC, ground connection
Port GND ground connection, port x 1, X2 and capacitor C2, C3, crystal oscillator Y1 are connected to form clock circuit, port RSE and resistor R1,
Capacitor C1 is connected to form reset circuit, and port P0.0~P0.7, P2.0~P2.7, P3.2~P3.7 are respectively and in light control module
Subport A0~A29 be connected, when EA external 3.3V power supply in port is to provide can, port P3.0, P3.1 are negative as communication port
Duty access third party's communication equipment.
Further, the submaster controller module by microprocessor STC89C52RC, resistor R2, capacitor C4~C6 with
And crystal oscillator Y2 composition;Wherein, 3.3V power supply in the power port VCC connection power module of microprocessor STC89C52RC, ground connection
Port GND ground connection, port x 1, X2 and capacitor C5, C6, crystal oscillator Y2 are connected to form clock circuit, port RSE and resistor R2,
Capacitor C4 is connected to form reset circuit, and port P0.0~P0.7, P2.0~P2.7, P3.2~P3.7 are respectively and in light control module
Subport B0~B29 be connected, when EA external 3.3V power supply in port is to provide can, port P3.0, P3.1 as communication port and
Wireless transmitter module is connected.
Further, the wireless transmitter module by resistor R11~R15, NPN type triode, PNP type triode,
Diode D1, capacitor C15, wireless transmitter composition;Wherein, after the collector of NPN type triode is first connected with resistor R11
Access 3.3V power supply in power module again, the port P3.0 of submaster controller module is connected to resistor R11 and NPN type triode
Between collector, the emitter of NPN type triode is grounded, the base stage of NPN type triode first connect with resistor R12 again with two poles
The positive terminal of pipe D1 is connected, and three branches of negative pole end point of diode D1 a, branch is grounded after being connected with capacitor C15, and one
Branch is grounded after being connected with resistor R15, and a branch returns to the collector of PNP type triode after being connected with resistor R14,
3.3V power supply in the emitter connection power module of PNP type triode, after the base stage of PNP type triode is connected with resistor R13
Connect again with the port P3.1 of submaster controller module, the port of wireless transmitter respectively with the collector of PNP type triode, two poles
Pipe D1 positive terminal, be connected.
Further, the clock synchronization module is made of communication conversion chip MAX3232E, capacitor C20~C24;It is logical
Port C1+, C1- of letter conversion chip MAX3232E is connected with capacitor C20, and port C2+, C2- are connected with capacitor C21, end
Mouth V+ is connected through capacitor C22 with 3.3V power supply in power module, and port V- is through 3.3V in capacitor C23, C24 and power module
Power supply is connected, furthermore VCC, GND respectively with 3.3V power supply in power module, be connected, port T1IN, R1OUT and light control module
In port TXx, RXx of each submodule be connected to receive signal, each submodule in port T2IN, R2OUT and light control module
Port TYx, RYx be connected to send signal, wherein x represent suitable for light control module each submodule port, i.e. lamp control mould
Port G0, G1 of the microprocessor PIC12C509 of each submodule is uniformly connected to communication conversion chip MAX3232E's in block
Port T1IN, R1OUT, port G4, G5 of the microprocessor PIC12C509 of each submodule is uniformly connected to logical in light control module
Believe port T2IN, R2OUT of conversion chip MAX3232E.
Further, the light control module is made of 29 duplicate submodular circuits, is with first submodule
Example, by microprocessor PIC12C509, capacitor C7~C8, crystal oscillator Y3, resistor R3~R4, PNP type triode, relay, lamp
LG1 composition;Port G6~G7 and capacitor C7, C8, the crystal oscillator Y3 of microprocessor PIC12C509 is connected to form clock circuit, end
Mouth G8 is connect with the port A1/B1 of master/slave controller module, 3.3V power supply in power port VCC connection power module, port G2
It is connected through resistor R4 with the base stage of PNP type triode, the grounded collector of PNP type triode, emitting stage elder generation and relay
It is connected and reconnects 3.3V power supply in power module, one end ground connection of lamp LG1, the other end is through resistor R3, relay and power supply mould
12V power supply is connected in block, and port TX1, RX1 are connected with port T1IN, R1OUT of clock synchronization module to send signal, port
TY1, RY1 are connected with port T2IN, R2OUT of clock synchronization module to receive signal.
Further, the power module is by 220V AC power source, 7812/7803 type regulated power supply processor, voltage sense
Answer device TR1, IN4007 type diode D1~D4, capacitor CX1, CX2 composition;Voltage sensor TR1 respectively with 220V alternating current
The positive and negative electrode in source is connected, and the positive terminal of IN4007 type diode D1 is connected with voltage sensor TR1, negative pole end and IN4007
The negative pole end of type diode D2 is connected, the positive terminal phase of the negative pole end and IN4007 type diode D1 of IN4007 type diode D3
Even, the positive terminal of the positive terminal connection IN4007 type diode D4 of IN4007 type diode D3, IN4007 type diode D4's is negative
The positive terminal of extreme connection IN4007 type diode D2, a branch of the port V1 of 7812/7803 type regulated power supply processor
It is connected between IN4007 type diode D1, D2, another branch is connected to the one end capacitor CX1, the other end of capacitor CX1
It is connected respectively with the centre of port GND, IN4007 type diode D3, D4 of 7812/7803 type regulated power supply processor, 7812/
The port VO of 7803 type regulated power supply processors is connected with output port 1, and one end of capacitor CX2 is connected to 7812/7803 type
The port VO of regulated power supply processor, other end port GND, the output end with 7812/7803 type regulated power supply processor respectively
Mouth 2 is connected.
The beneficial effects of the present invention are: breaking down compared with prior art, the present invention mainly solving in main control module
When, because the clock crystal oscillator component variations on each light control module make clock frequency deviation occur, lead to the time of different lamp control plates
The phenomenon that inconsistent and then time of occurrence entanglement, occurs, while not increasing operation risk, synchronous using semaphore clock
Mode greatly improves the stability and reliability of traffic control system.
Embodiment 1: as shown in figs. 1-7, a kind of semaphore with clock synchronizing function, including main controller module, pair
Controller module, wireless transmitter module, clock synchronization module, light control module, power module;Main controller module, submaster controller
Module, wireless transmitter module are connect with light control module respectively, and light control module is connect with clock synchronization module and power module respectively.
Light control module is directly controlled by main controller module under normal circumstances;Specifically include main controller module real-time control
The light color state of light control module, the clock circuit in main controller module are uniformly controlled the clock variation of light control module;
It is automatic to start submaster controller module if software systems monitor that main controller module breaks down, by sub-control
Device module directly controls light control module;Specifically include the light color state of submaster controller module real-time control light control module, sub-control
Clock circuit in device module be uniformly controlled light control module clock variation, and from submaster controller module through wireless transmitter module to
Console sends main controller module failed request, waits to be repaired;
If software systems detect that major and minor controller module all breaks down, start in light control module n-th submodule
Clock circuit be uniformly controlled light control module clock variation;It specifically includes using the clock in light control module n-th submodule
Circuit sends RS232 through clock synchronization module and instructs into light control module other submodules, calibrates each submodule in light control module
Timing differential between block, while entering alternative scheme operational mode;Wherein n-th submodule indicates in light control module from going to
First trouble-free submodule afterwards.
Further, the main controller module by microprocessor STC89C52RC, resistor R1, capacitor C1~C3 with
And crystal oscillator Y1 composition;Wherein, 3.3V power supply in the power port VCC connection power module of microprocessor STC89C52RC, ground connection
Port GND ground connection, port x 1, X2 and capacitor C2, C3, crystal oscillator Y1 are connected to form clock circuit, port RSE and resistor R1,
Capacitor C1 is connected to form reset circuit, and port P0.0~P0.7, P2.0~P2.7, P3.2~P3.7 are respectively and in light control module
Subport A0~A29 be connected, when EA external 3.3V power supply in port is to provide can, port P3.0, P3.1 are negative as communication port
Duty access third party's communication equipment.
The function of main controller module specifically includes that the light color state of a) real-time control light control module;B) it is uniformly controlled lamp
Control the clock variation of module;C) data sharing is carried out with third party's communication equipment.
Further, the submaster controller module by microprocessor STC89C52RC, resistor R2, capacitor C4~C6 with
And crystal oscillator Y2 composition;Wherein, 3.3V power supply in the power port VCC connection power module of microprocessor STC89C52RC, ground connection
Port GND ground connection, port x 1, X2 and capacitor C5, C6, crystal oscillator Y2 are connected to form clock circuit, port RSE and resistor R2,
Capacitor C4 is connected to form reset circuit, and port P0.0~P0.7, P2.0~P2.7, P3.2~P3.7 are respectively and in light control module
Subport B0~B29 be connected, when EA external 3.3V power supply in port is to provide can, port P3.0, P3.1 as communication port and
Wireless transmitter module is connected.
The function of submaster controller module specifically includes that a) the real-time control light control module when main controller module breaks down
Light color state;B) the clock variation of light control module is uniformly controlled when main controller module breaks down;C) main controller module
Main controller module failed request is sent to console through wireless transmitter module when failure, is waited to be repaired.
Further, the wireless transmitter module by resistor R11~R15, NPN type triode, PNP type triode,
Diode D1, capacitor C15, wireless transmitter composition;Wherein, after the collector of NPN type triode is first connected with resistor R11
Access 3.3V power supply in power module again, the port P3.0 of submaster controller module is connected to resistor R11 and NPN type triode
Between collector, the emitter of NPN type triode is grounded, the base stage of NPN type triode first connect with resistor R12 again with two poles
The positive terminal of pipe D1 is connected, and three branches of negative pole end point of diode D1 a, branch is grounded after being connected with capacitor C15, and one
Branch is grounded after being connected with resistor R15, and a branch returns to the collector of PNP type triode after being connected with resistor R14,
3.3V power supply in the emitter connection power module of PNP type triode, after the base stage of PNP type triode is connected with resistor R13
Connect again with the port P3.1 of submaster controller module, the port of wireless transmitter respectively with the collector of PNP type triode, two poles
Pipe D1 positive terminal, be connected.
The function of wireless transmitter module is controlled when specifically including that a) main controller module failure by submaster controller module
It sends main controller module failed request to console, waits to be repaired.
Further, the clock synchronization module is made of communication conversion chip MAX3232E, capacitor C20~C24;It is logical
Port C1+, C1- of letter conversion chip MAX3232E is connected with capacitor C20, and port C2+, C2- are connected with capacitor C21, end
Mouth V+ is connected through capacitor C22 with 3.3V power supply in power module, and port V- is through 3.3V in capacitor C23, C24 and power module
Power supply is connected, furthermore VCC, GND respectively with 3.3V power supply in power module, be connected, port T1IN, R1OUT and light control module
In port TXx, RXx of each submodule be connected to receive signal, each submodule in port T2IN, R2OUT and light control module
Port TYx, RYx be connected to send signal, wherein x represent suitable for light control module each submodule port, i.e. lamp control mould
Port G0, G1 of the microprocessor PIC12C509 of each submodule is uniformly connected to communication conversion chip MAX3232E's in block
Port T1IN, R1OUT, port G4, G5 of the microprocessor PIC12C509 of each submodule is uniformly connected to logical in light control module
Believe port T2IN, R2OUT of conversion chip MAX3232E.
The function of clock synchronization module, which specifically includes that, a) receives the clock instruction that some submodule is sent in light control module;
B) tranmitting data register is instructed to submodules all in light control module in the form of RS232.
Further, the light control module is made of 29 duplicate submodular circuits, is with first submodule
Example, by microprocessor PIC12C509, capacitor C7~C8, crystal oscillator Y3, resistor R3~R4, PNP type triode, relay, lamp
LG1 composition;Port G6~G7 and capacitor C7, C8, the crystal oscillator Y3 of microprocessor PIC12C509 is connected to form clock circuit, end
Mouth G8 is connect with the port A1/B1 of master/slave controller module, 3.3V power supply in power port VCC connection power module, port G2
It is connected through resistor R4 with the base stage of PNP type triode, the grounded collector of PNP type triode, emitting stage elder generation and relay
It is connected and reconnects 3.3V power supply in power module, one end ground connection of lamp LG1, the other end is through resistor R3, relay and power supply mould
12V power supply is connected in block, and port TX1, RX1 are connected with port T1IN, R1OUT of clock synchronization module to send signal, port
TY1, RY1 are connected with port T2IN, R2OUT of clock synchronization module to receive signal.
The function of light control module, which specifically includes that, receives master/slave controller module signal a) to show correct light color state
And clock variation;B) in the case where master/slave controller module all breaks down, using in light control module n-th submodule
Clock circuit sends RS232 through clock synchronization module and instructs into light control module other submodules, calibrates each in light control module
Timing differential between submodule, while entering alternative scheme operational mode;Wherein n-th submodule indicate light control module in from
First trouble-free submodule after going to.
Further, the power module is by 220V AC power source, 7812/7803 type regulated power supply processor, voltage sense
Answer device TR1, IN4007 type diode D1~D4, capacitor CX1, CX2 composition;Voltage sensor TR1 respectively with 220V alternating current
The positive and negative electrode in source is connected, and the positive terminal of IN4007 type diode D1 is connected with voltage sensor TR1, negative pole end and IN4007
The negative pole end of type diode D2 is connected, the positive terminal phase of the negative pole end and IN4007 type diode D1 of IN4007 type diode D3
Even, the positive terminal of the positive terminal connection IN4007 type diode D4 of IN4007 type diode D3, IN4007 type diode D4's is negative
The positive terminal of extreme connection IN4007 type diode D2, a branch of the port V1 of 7812/7803 type regulated power supply processor
It is connected between IN4007 type diode D1, D2, another branch is connected to the one end capacitor CX1, the other end of capacitor CX1
It is connected respectively with the centre of port GND, IN4007 type diode D3, D4 of 7812/7803 type regulated power supply processor, 7812/
The port VO of 7803 type regulated power supply processors is connected with output port 1, and one end of capacitor CX2 is connected to 7812/7803 type
The port VO of regulated power supply processor, other end port GND, the output end with 7812/7803 type regulated power supply processor respectively
Mouth 2 is connected.
The function of power module specifically include that a) for main controller module, submaster controller module, wireless transmitter module, when
Clock synchronization module, light control module etc. provide 12V, 3.3V power supply and support.
If software systems detect that major and minor controller module all breaks down, start in the 1st submodule of light control module
Clock circuit be uniformly controlled light control module clock variation;If the 1st submodule of light control module equally breaks down, open
Clock circuit in dynamic the 2nd submodule of light control module is uniformly controlled the clock variation of light control module;And so on.
The present invention directly controls light control module by main controller module under normal circumstances;If software systems monitor main control
It is automatic to start submaster controller module when device module breaks down, light control module is directly controlled by submaster controller module, while through nothing
Line transmitting module sends main controller module failed request to console, waits to be repaired;If software systems detect major and minor control
When device module all breaks down, start the clock that the clock circuit in light control module n-th submodule is uniformly controlled light control module
Variation.Compared with prior art, the present invention mainly solve when main control module breaks down, because on each light control module when
Clock crystal oscillator component variations make clock frequency deviation occur, lead to the Time Inconsistency of different lamp control plates and then time of occurrence entanglement
Phenomenon occurs, and while not increasing operation risk, in such a way that semaphore clock is synchronous, greatly improves traffic control
The stability and reliability of system.
In conjunction with attached drawing, the embodiment of the present invention is explained in detail above, but the present invention is not limited to above-mentioned
Embodiment within the knowledge of a person skilled in the art can also be before not departing from present inventive concept
Put that various changes can be made.