A kind of protocol converter that is used for FlexRay bus and PC104 bus
Technical field
The invention belongs to field bus communication control technology field, be specifically related to the protocol converter of a kind of FlexRay of being used for bus and PC104 bus.The present invention can be used for Auto Electronic Controlled System and industrial bus control system.
Background technology
In Auto Electronic Controlled System and industrial bus control system, usually need use multiple bussing technique in the same control system.Signaling interface between the bus and protocol conversion problem directly influence the quick effective integration of The whole control system.As a kind of emerging have transmission confirmability and the machine-processed high-speed bus of failure tolerant, the FlexRay bus also needs to be resolved hurrily and buses such as present widely used PC104, USB, CAN between interface problem.
Summary of the invention
In order to solve signaling interface and the protocol conversion problem between FlexRay bus and the PC104 bus, the present invention provides the protocol converter of a kind of FlexRay of being used for bus and PC104 bus.This protocol converter is based on FlexRay bus and PC104 bus communication agreement; Realize the on-the-spot full duplex real time communication between FlexRay bus and the PC104 bus; And seamless integrated identification, analysis, tracking and detection failure technology; Solve signaling interface and exchanges data problem between FlexRay bus and the PC104 bus, be convenient to the quick effective integration of multibus control system.
The technical solution adopted for the present invention to solve the technical problems is following:
The present invention provides the protocol converter of a kind of FlexRay of being used for bus and PC104 bus, and it comprises bottom hardware and support programs two large divisions.
Bottom hardware comprises protocol conversion module, power adaptation module two parts.
Protocol conversion module is the core of said protocol converter bottom hardware, comprises master controller, FlexRay bus control unit, voltage isolation transducer, FlexRay bus transceiver and signal lamp.Solidify FlexRay bus and PC104 bus protocol conversion logic and configuration item in the master controller; Realize exchanges data and Communication Control between FlexRay bus and the PC104 bus; It is connected with exterior PC 104 main control computers; And signal is realized voltage isolation and conversion via the voltage isolation transducer, be connected with the FlexRay bus control unit.The FlexRay bus control unit is configured and controls FlexRay bus communication process, and it is connected with the voltage isolation transducer realizes that voltage of signals is isolated and conversion, is connected with the FlexRay bus transceiver then.The FlexRay bus transceiver is connected with outside FlexRay network, is the interface of FlexRay bus control unit and physics FlexRay bus, for outside FlexRay network provides differential reception and transmitting capacity.Signal lamp is connected with primary processor, indication bus communication state and fault message.
Power adaptation module is that protocol conversion module provides required direct voltage, comprises power transfer module, electric source filter circuit and power supply indicator.Power adaptation module is through the PC104 EBI; Obtain direct voltage from exterior PC 104 main control computers; Through electric source filter circuit electric current is cushioned and filtering; Convert required direct voltage into via power transfer module, supply power, and be connected to show power supply state with power supply indicator to the protocol conversion module related circuit.
Support programs are stored in the master controller, and exchanges data and communication process between FlexRay bus and the PC104 bus are controlled, and mainly realize finite state machine, carry out following steps:
1) Status Flag bit vector power-up initializing;
2) the protocol converter self-detection mechanism checkout gear according to FlexRay bus and PC104 bus starts successfully sign, if this flag bit is effective, changes step 4) over to, otherwise, change step 3) over to;
3) fault detect identification, location and processing, and finish operation;
4) detect self check and successfully indicate,, change step 5) over to if this flag bit is effective, otherwise, change step 3) over to;
5) test initialization successfully indicates, if this flag bit is effective, changes step 6) over to, otherwise, change step 3) over to;
6) detect finite state machine and successfully start sign,, change step 7) over to if this flag bit is effective, otherwise, change step 3) over to; 7) detect the key node Status Flag,, change step 8) over to if this flag bit is effective, otherwise, change step 3) over to;
8) detect end operation request flag,, change step 10) over to if this flag bit is effective, otherwise, step 7) returned via step 9);
9) self adaptation is regulated;
10) detect sign out of service,, change step 11) over to if this flag bit is effective, otherwise, change step 3) over to;
11) set done state for finishing operation and outage cleared condition.
Bus protocol conversion operation process of the present invention is:
Said protocol converter two ends respectively with exterior PC 104 main control computers with after outside FlexRay network is connected; When exterior PC 104 main control computers are correlated with downstream site transmitting control commands and data in outside FlexRay network; These orders and data get in the master controller; Master controller is through interrupting receiving and resolving these orders or data; And decode by the PC104 bus protocol, then decoded order, data and corresponding presupposed information are combined into one group of data-signal that satisfies the FlexRay agreement, and data-signal are realized voltage isolation and conversion via the voltage isolation transducer; The data that write the FlexRay bus control unit are sent buffering area, and the FlexRay bus control unit is sent to outside FlexRay network via voltage isolation transducer and FlexRay bus transceiver with data-signal.
When in the outside FlexRay network by on-the-spot FlexRay node when the PC104 main control computer sends data; At first the FlexRay bus transceiver receives on-the-spot FlexRay node and uploads information; Carry out voltage isolation and conversion through the voltage isolation transducer; Write the Data Receiving buffering area of FlexRay bus control unit, the FlexRay bus control unit sends reception to master controller and successfully arbitrates master controller response arbitration simultaneously; Data Receiving buffering area reading of data from the FlexRay bus control unit; And via the voltage isolation transducer data-signal is realized voltage isolation and conversion, according to FlexRay communication protocol the data of obtaining are decoded then, then decoded data and corresponding presupposed information are combined into one group of data that satisfy the PC104 agreement after; Send control commands corresponding and data by master controller, be sent to exterior PC 104 main control computers through the PC104 bus.
In this process, master controller is according to perfect identification, analysis and follow the tracks of detection failure algorithm real-time tracking key node state, and the flicker of control signal indicator light is to show and to follow the tracks of the operating state and the fault message of this protocol converter.
The invention has the beneficial effects as follows; In the time of the signaling interface of realization FlexRay bus and PC104 bus and Communication Control; Trigger the mode switch problem with Event triggered settling time, optimize FlexRay binary channels redundancy communication logic, each functional module adopts mature technology and universal elements; Simple in structure, circuit elements device interchangeability is good.
Description of drawings
Fig. 1 is the bottom hardware structured flowchart that the present invention is used for the protocol converter of FlexRay bus and PC104 bus.
Fig. 2 is the flow chart of the support programs of the present invention's protocol converter of being used for FlexRay bus and PC104 bus.
Embodiment
The present invention will combine instance to be elaborated with reference to accompanying drawing, so that to the object of the invention, characteristic and advantage are carried out more deep understanding.
Fig. 1 is the bottom hardware structure chart of the protocol converter of FlexRay bus and PC104 bus.This protocol converter bottom hardware comprises that protocol conversion module 1 and power adaptation module 2 are total to the two large divisions.
Protocol conversion module 1 is the core of said protocol converter, comprises a master controller 10, FlexRay bus control unit 12, voltage isolation transducer 11, voltage isolation transducer 13, voltage isolation transducer 15, FlexRay bus transceiver 14, FlexRay bus transceiver 16 and a signal lamp 17.
Master controller 10 adopts programmable logic device; Solidify the protocol conversion logic and the configuration item of exchange of FlexRay bus and PC104 bus data and Communication Control; Select the CPLD M4A5-192/96 of Lattice company in this instance for use; It has 192 macrocells, and 96 available I/O mouths are supported the JTAG debug standard.12 pairs of FlexRay bus communications of FlexRay bus control unit process is configured and controls, and selects the MFR4200 controller of FreeScale company in this instance for use, and it provides 9 bit address lines, 16 position datawires, 11 signaling interfaces such as control line.Two FlexRay bus transceivers (14,16) are the interface of FlexRay controller and physics FlexRay bus, for outside FlexRay network provides differential reception and transmitting capacity, select the TJA1080A transceiver of NXP company in this instance for use.Three voltage isolation transducers (11,13,15) are used for voltage isolation and conversion, to guarantee the data normal communication and to avoid chip overvoltage damage, select the level transferring chip LVC164245 of TI company in this instance for use.Signal lamp 17 is used to indicate bus communication state and fault message, selects the paster green LED in this instance for use, encapsulation 0805.
Exterior PC 104 main control computers are connected with primary processor 10 via the I/O port with 16 position datawires, 8 control lines, 9 bit address line modes.Primary processor 10 is realized voltage isolation and conversion with 16 position datawires, 11 control lines, 9 bit address line modes via 11 pairs of signals of voltage isolation transducer, is connected with FlexRay bus control unit 12.Primary processor 10 is connected with signal lamp 17 simultaneously, indication bus communication state and fault message.FlexRay bus control unit 12 is connected with voltage isolation transducer 13, realizes that voltage of signals is isolated and conversion, be connected with FlexRay bus transceiver 14 then, and FlexRay bus transceiver 14 is connected with outside FlexRay network.The FlexRay bus is the binary channels redundant bus, after FlexRay bus control unit 12 also being arranged and voltage isolation transducer 15 being connected, be connected with FlexRay bus transceiver 16, and FlexRay bus transceiver 16 is connected with outside FlexRay network.
Power adaptation module 2 satisfies required direct voltage for protocol conversion module 1 provides, and comprises a power transfer module 20, electric source filter circuit 19, electric source filter circuit 21 and power supply indicator 22.
Power transfer module 20 realizes the level conversion function, selects the TPS7333Q low-dropout regulator of TI company in this instance for use.Electric source filter circuit 19 is realized the buffering and the filtering of electric current, adopts one 100 μ F electrochemical capacitor and one 0.01 μ F capacitance series circuit in this instance.Electric source filter circuit 21 is identical with structure with electric source filter circuit 19 principles.Power supply indicator 22 is used to indicate power supply status, selects the paster green LED in this instance for use, encapsulation 0805.
Power adaptation module 2, cushions and filtering through 19 pairs of electric currents of electric source filter circuit, to protocol conversion module 1 circuit supply from exterior PC 104 main control computer acquisition+5V direct voltages through the PC104 EBI; Simultaneously, convert into+the 3.3V direct voltage, cushion and filtering, supply with FlexRay bus control unit 12 and use through 21 pairs of electric currents of electric source filter circuit via power transfer module 20 general+5V direct voltages; And be connected the display power supply on off operating mode with power supply indicator 22.
Fig. 2 is the flow chart of support programs of the protocol converter of FlexRay bus and PC104 bus.The support programs that the present invention is used for the protocol converter of FlexRay bus and PC104 bus are based on status poll and response mechanism realization finite state machine:
Step 20 is an initial actuating.
Step 21 Status Flag bit vector power-up initializing.
Step 22 starts successfully sign according to the protocol converter self-detection mechanism checkout gear of FlexRay bus and PC104 bus, if this flag bit is effective, changes step 24 over to; Otherwise, change step 23 over to.
Step 23 fault detect identification, location and processing, and finish operation.
Step 24 detects self check and successfully indicates, if this flag bit is effective, changes step 25 over to; Otherwise, change step 23 over to.
Step 25 test initialization successfully indicates, if this flag bit is effective, changes step 26 over to; Otherwise, change step 23 over to.
Step 26 detects finite state machine and successfully starts sign, if this flag bit is effective, changes step 27 over to; Otherwise, change step 23 over to.
Step 27 detects the key node Status Flag, if this flag bit is effective, changes step 28 over to; Otherwise, change step 23 over to.
Step 28 detects and finishes the operation request flag, if this flag bit is effective, changes step 30 over to; Otherwise, return step 27 via step 29.
Step 29 self adaptation is regulated.
Step 30 detects sign out of service, if this flag bit is effective, changes step 31 over to; Otherwise, change step 23 over to.
Step 31 is set done state for finishing operation and outage cleared condition.
Above-mentioned instance is merely explanation the present invention and gives an example, and is not to be used to limit the present invention, and any equivalents based on the foregoing description all should be within scope of patent protection of the present invention.