[go: up one dir, main page]

CN101655825B - A device using FPGA to realize LPC-USB bidirectional communication and LPC-USB and USB-LPC data conversion method - Google Patents

A device using FPGA to realize LPC-USB bidirectional communication and LPC-USB and USB-LPC data conversion method Download PDF

Info

Publication number
CN101655825B
CN101655825B CN2008101424833A CN200810142483A CN101655825B CN 101655825 B CN101655825 B CN 101655825B CN 2008101424833 A CN2008101424833 A CN 2008101424833A CN 200810142483 A CN200810142483 A CN 200810142483A CN 101655825 B CN101655825 B CN 101655825B
Authority
CN
China
Prior art keywords
lpc
usb
data
bus
state
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
CN2008101424833A
Other languages
Chinese (zh)
Other versions
CN101655825A (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 Jiuniuyimao Intelligent Internet Of Things Technology Co ltd
Original Assignee
EVOC Intelligent Technology 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 EVOC Intelligent Technology Co Ltd filed Critical EVOC Intelligent Technology Co Ltd
Priority to CN2008101424833A priority Critical patent/CN101655825B/en
Publication of CN101655825A publication Critical patent/CN101655825A/en
Application granted granted Critical
Publication of CN101655825B publication Critical patent/CN101655825B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Transfer Systems (AREA)

Abstract

The invention relates to a device for achieving LPC-USB two-way communication by using an FPGA and a data conversion method. The device comprises an LPC bus, a USB bus, a field programmable logic device and a USB module, wherein the field programmable logic device finishes the protocol conversion and transmission from LPC data to USB data from the LPC bus to the USB bus, and finishes the protocol conversion and transmission from the USB data to the LPC data from the USB bus to the LPC bus. The device achieves the full-duplex communication of the LPC bus and the USB bus by using the FPGA so as to satisfy certain special application occasions and solve the problems of the short-range communication of two or more computers without the help of other media. The device adopts a scheme with the FPGA and a USB control chip, and two FIFOs are arranged in the FPGA to replace an external FIFO so as to achieve high integration, and an integrated circuit board is manufactured to have the minimum area, the lowest power consumption and the least cost. Besides, the device uses the characteristic of occupying fewer ports of the FIFO to ensure that FIFO only occupies an address space of less than 2 bits in a PC, thereby greatly saving the address space. Simultaneously, the device uses the characteristic of parallel high speed of the FPGA so that the scheme can satisfy the high-speed full-duplex communication.

Description

A kind of device and LPC-USB and USB-LPC data transfer device that uses FPGA to realize the LPC-USB two-way communication
Technical field
The present invention relates to the device of two-way communication, more particularly, relate to device and LPC-USB and USB-LPC data transfer device that a kind of FPGA of use realizes the LPC-USB two-way communication.
Background technology
(Low Pin Count, LPC) bus is a data address command multiplex bus of Intel (Intel) company definition to low pin number, is operated in 33MHz (megahertz).In computer realm, lpc bus replaced gradually industrial standard architectures (Industry Standard Architecture, ISA), X-bus (X bus) etc. and become new interface.
Lpc bus has string characteristic also, and some characteristics of existing universal serial bus have some characteristics of parallel bus again simultaneously.In communication process, have frame signal, synchronizing signal, answer signal in the conventional serial communication protocol, but be again parallel data transmission in whole communication process with 4.
Yet, still have at present a lot of peripherals that the bus interface of other types only is provided, as USB interface etc.Because the frequency of operation of these buses, data address bus width and read-write sequence or the like are different with lpc bus, and the certain operation of needs could realize the communication between them.Communication between them need be resolved the agreement of lpc bus, carries out the conversion of agreement.
At industrial control field, at present a lot of industrial control computer mainboards can provide a plurality of USB interface, but can not realize the direct communication with lpc bus.Industry is devoted to develop adapter in the hope of realizing communicating by letter between lpc bus and the USB easily.
Can realize that the technical scheme of communicating by letter between the LPC-USB has:
1, with CPLD or FPGA, the external dual port RAM+USB chip of arranging in pairs or groups carries out full-duplex communication; Its shortcoming: dual port RAM independently, price is high; The operation dual port RAM, the easy problem that competition occurs, in the time of just same, write operation is carried out to same address simultaneously in the RAM both sides, and data will be lost; The address space of RAM must all be mapped to the addressing space of computing machine, and the capacity of RAM is big more, and the address space that takies is also big more; The data-moving of RAM needs software to do complicated space management, realize that the data of different addresses are had different operations, complicated technology realization.
2, use CPLD or FPGA separately, external 2 fifo chips+USB chip of arranging in pairs or groups carries out full-duplex communication; Its shortcoming: need simultaneously with 2 fifo chips, expensive; Need be with FPGA or CPLD, the interface routine and the FIFO that write FIFO carry out data communication; Need use 4 IC, increase the integrated circuit board area, also increase power consumption simultaneously.
3, FPGA embedded processor, as (NIOS II, Microblaze), plug-in single port RAM+USB chip communicates; Its shortcoming: embedded processor at first needs the FPGA of larger capacity, the bad grasp of cost; Because be embedded processor, thus in the single time, be merely able to a port is operated, so can only be semiduplex mode; Because message transmission rate is up to 10MB/S, if use embedded processor, with regard to necessary plug-in speed buffering module, and the not high soft processor of performance will be the bottleneck place of data channel.
Summary of the invention
The technical problem to be solved in the present invention is, at the above-mentioned defective of prior art, provides a kind of FPGA of use to realize device and the LPC-USB and the USB-LPC data transfer device of LPC-USB two-way communication.
The technical solution adopted for the present invention to solve the technical problems is: construct a kind of device that uses FPGA to realize the LPC-USB two-way communication, comprise lpc bus, usb bus, field programmable logic device and USB module; The control of described field programmable logic device is finished by protocol conversion and the transmission of lpc bus to the LPC data of usb bus to usb data, and finishes by protocol conversion and the transmission of usb bus to the usb data of lpc bus to the LPC data; Described USB module is used to realize the exchanges data of described field programmable logic device and usb bus;
Described field programmable logic device comprises: LPC-USB protocol conversion module, USB-LPC protocol conversion module, first buffer zone and second buffer zone;
Wherein, the LPC-USB protocol conversion module is used to receive the LPC data that lpc bus sends, and it is carried out sending to first buffer zone after the protocol conversion;
First buffer zone is used for by the buffer memory of LPC data to usb data protocol conversion and transport process data, and has played a good clock zone buffer action;
Second buffer zone is used to receive the usb data that the USB module sends, and is used for by the buffer memory of usb data to conversion of LPC data protocol and transport process data, and has played a good clock zone buffer action;
The USB-LPC protocol conversion module is used to receive the usb data of second buffer zone output, and it is carried out sending lpc bus after the protocol conversion.
Realize that at use FPGA of the present invention described first buffer zone and second buffer zone all are the fifo buffers that can carry out 16K byte reading and writing data in the device of LPC-USB two-way communication.
Realize in the device of LPC-USB two-way communication that at use of the present invention FPGA the enable signal of writing of described first buffer zone links to each other, reads that enable signal links to each other with the control end of described USB module, clock signal links to each other with the control end of described lpc bus with the USB module respectively with the control end of described lpc bus.
Realize in the device of LPC-USB two-way communication that at use of the present invention FPGA the enable signal of reading of described second buffer zone links to each other, writes that enable signal links to each other with the control end of described USB module, clock signal links to each other with the control end of described lpc bus with the USB module respectively with the control end of described lpc bus.
Realize in the device of LPC-USB two-way communication at use FPGA of the present invention, described field programmable logic device also comprises: the clock control administration module, it comprises input end, first output terminal and second output terminal, wherein, input end links to each other with outside global clock pin, the clock same-phase of the output of first output terminal and input end, the clock antiphase of the output of second output terminal and input end.
According to another aspect of the present invention, provide a kind of at using FPGA to realize the LPC-USB data transfer device of the device of LPC-USB two-way communication, it may further comprise the steps:
S11, current state is set is initial state;
S12, when the Senior Three position of described lpc bus is 011 and frame signal when being 1, it is address state that current state is set;
S13, reception 32 bit address, it is data mode that current state is set;
S14, reception 8 bit data, it is the TAR1 state that current state is set;
S15, when described lpc bus is 1111 and frame signal when being 1, judge whether low 20 of described 32 bit address are 0XD0000, if it is sync state that current state is set, otherwise, enter step S1:
S16, described 8 bit data are sent to first buffer zone;
S17, end LPC-USB data-switching.
In LPC-USB data transfer device of the present invention, also comprise between step S11 and S12: it is high-impedance state that described lpc bus is set, and the enable signal of writing of first buffer zone puts 0;
In LPC-USB data transfer device of the present invention, in step S13, receive 4 bit address in each LPC_CLK clock period, through 8 LPC_CLK clock period, receive described 32 bit address.
In LPC-USB data transfer device of the present invention, in step S14, receive 4 bit data in each LPC_CLK clock period, through 2 LPC_CLK clock period, receive described 8 bit data.
In LPC-USB data transfer device of the present invention, in step S16, before sending described 8 bit data, comprise that also the enable signal of writing that first buffer zone is set is 1, and described lpc bus is set is 0000.
According to a further aspect of the invention, provide a kind of at using FPGA to realize the USB-LPC data transfer device of the device of LPC-USB two-way communication, it may further comprise the steps:
S21, current state is set is initial state;
S22, when the Senior Three position of described lpc bus is 010 and frame signal when being 1, it is address state that current state is set;
S23, reception 32 bit address, it is the TAR1 state that current state is set;
S24, when described lpc bus is 1111 and frame signal when being 1, judge whether low 20 of described 32 bit address are 0XD0001 or 0XD0002, if it is sync state that current state is set, and described lpc bus is set is 0101, otherwise, enter step S21;
S25, judge whether low 20 of described 32 bit address are 0XD0001, if enter step S26; Otherwise, enter step S27;
S26, the data of described second buffer zone output are sent in 8 the data register;
S27, current state is set is data mode, be provided with described lpc bus be 0000 and the enable signal of reading that described second buffer zone is set be 0;
S28, judge whether low 20 of described 32 bit address are 0XD0001, if enter step S29; Otherwise, enter step S210;
S29, the data that will be stored in described 8 data register send to described USB-LPC protocol conversion module;
S210, the 1st LPC_CLK clock period, high 2 positions 11 of described lpc bus, the empty marking signal assignment of described second buffer zone is given described lpc bus the 1st, the full scale will signal assignment of described first buffer zone is given described lpc bus the 0th, the 2nd LPC_CLK clock period, it is 1111 that described lpc bus is set;
S211, end USB-LPC data-switching.
In USB-LPC data transfer device of the present invention, also comprise between described step S21 and S22: it is high-impedance state that described lpc bus is set, and the enable signal of reading of second buffer zone puts 0.
In USB-LPC data transfer device of the present invention, in step S23, receive 4 bit address in each LPC_CLK clock period, through 8 LPC_CLK clock period, receive described 32 bit address.
In USB-LPC data transfer device of the present invention, in step S29, the 1st LPC_CLK clock period, low 4 of being stored in data in described 8 data register are sent to described USB-LPC protocol conversion module, the 2nd LPC_CLK clock period, high 4 of being stored in data in described 8 data register are sent to described USB-LPC protocol conversion module
Implement device and LPC-USB and USB-LPC data transfer device that use FPGA of the present invention realizes the LPC-USB two-way communication, has following beneficial effect: utilize FPGA to realize the full-duplex communication of lpc bus and usb bus, satisfy some particular application, two or many computing machine short-range communication problems, and do not need by realizing by other media.This device is set up two FIFO by FPGA and USB control chip scheme in FPGA inside, substitute plug-in FIFO, and reached high integrated, therefore the integrated circuit board area is accomplished minimum, and the while power consumption is accomplished minimum, and cost is accomplished minimum.In addition, utilize FIFO to have and take the few characteristic of port, make it in PC, only need take address space, thereby save address space greatly less than 2 bytes.Simultaneously, utilized the characteristic of FPGA parallel high-speed, made this programme can satisfy the high speed full-duplex communication.
Description of drawings
The invention will be further described below in conjunction with drawings and Examples, in the accompanying drawing:
Fig. 1 is that the present invention uses FPGA to realize the system chart of the device of LPC-USB two-way communication;
Fig. 2 is the process flow diagram that device shown in Figure 1 is realized the LPC-USB data transfer device;
Fig. 3 is the state transition diagram of the state machine of Fig. 2;
Fig. 4 is the process flow diagram that device shown in Figure 1 is realized the USB-LPC data transfer device;
Fig. 5 is the state transition diagram of the state machine of Fig. 4;
Fig. 6 is first buffer zone shown in Figure 1 and the arrangement plan of second buffer zone;
Fig. 7 is the system chart of USB module shown in Figure 1;
Fig. 8 is the FPGA shown in Figure 1 and the interface connection diagram of USB module.
Embodiment
Realize device one application-specific of LPC-USB two-way communication for use FPGA of the present invention, mainly be between device A and equipment B, to carry out exchanges data, wherein device A is carried out the transmitting-receiving of data by lpc bus, and equipment B is carried out the transmitting-receiving of data by usb bus.As shown in Figure 1, use FPGA to realize comprising lpc bus, usb bus, field programmable logic device and USB module among this embodiment of device of LPC-USB two-way communication in the present invention; The control of this field programmable logic device is finished by protocol conversion and the transmission of lpc bus to the LPC data of usb bus to usb data, and finishes by protocol conversion and the transmission of usb bus to the usb data of lpc bus to the LPC data; The USB module is used to realize the exchanges data of field programmable logic device and usb bus; Comprise for this field programmable logic device: LPC-USB protocol conversion module, USB-LPC protocol conversion module, first buffer zone (FIF01) and second buffer zone (FIFO2); Wherein, the LPC-USB protocol conversion module is used to receive the LPC data that lpc bus sends, and it is carried out sending to first buffer zone after the protocol conversion; First buffer zone is used for by the buffer memory of LPC data to usb data protocol conversion and transport process data, and has played a good clock zone buffer action; Second buffer zone is used to receive the usb data that the USB module sends, and is used for by the buffer memory of usb data to conversion of LPC data protocol and transport process data, and has played a good clock zone buffer action; The USB-LPC protocol conversion module is used to receive the usb data of second buffer zone output, and it is carried out sending lpc bus after the protocol conversion.As shown in Figure 6, first buffer zone and second buffer zone all are the fifo buffers that can carry out the 16K reading and writing data.In addition, this field programmable logic device also comprises CLKV module (clock control administration module), and this CLKV module mainly realizes the control and management to clock.The outside is sent to the clock of FPGA by the global clock pin, divides two-way output, the one tunnel with the clock same-phase of input, the one tunnel with the clock antiphase of input, as the reference clock of FPGA program design.In specific design, the device of the present patent application is also to claim the TOP module by utilization top layer software, IO interface with the definition whole procedure, and the input and output of external interface and each realized that the sub-module of concrete function is connected, realizing the logical relation between them, and realized mutual with the USB module simultaneously.
In concrete work, device A is sent to FPGA to data by lpc bus, and produces check code simultaneously, through the processing of FPGA, protocol conversion, give USB module data,, give USB interface data by the processing of USB module, this moment the equipment B reading of data, and check its correctness, to determine whether to need to start retransmission mechanism, this process realizes the communication of lpc bus data to USB.Reverse direction, equipment B is given USB module data by USB interface, through the processing of USB module, carries out transmitted in packets, be sent to FPGA and generate check code, through the processing of FPGA module, protocol conversion is given lpc bus data, the device A reading of data, and check its correctness, to determine whether to need to start retransmission mechanism, this process realizes the communication of usb data to lpc bus.Thereby realized the full-duplex communication between lpc bus and the USB.
After system powers on, lpc bus sends data to USB if desired, then device A sends data to FPGA by lpc bus, produces check code simultaneously, through the processing of FPGA, carry out protocol conversion, data are sent to the USB module, and through the processing of USB module, equipment B is by the USB interface sense data, and check its correctness, to determine whether to need to start retransmission mechanism; USB sends data to lpc bus if desired, equipment B is given USB module data by USB interface, produces check code simultaneously, after the processing through the USB module, send data to FPGA,, carry out protocol conversion through the processing of FPGA module, data are sent to lpc bus, again by the device A sense data, and check its correctness, to determine whether to need to start retransmission mechanism.Lpc bus and USB be transceive data simultaneously, to realize the full-duplex communication between them.Whole data exchange process is the transmission data of a frame one frame, and receiving data also is the reception of a frame one frame; Some information that include this frame in each frame data simultaneously comprise the information of verification and error correction aspect; After reading of data, also read simultaneously the information aspect the verification,, then sent an information, started retransmission mechanism, allowed transmit leg resend this frame data, till transmission is correct if find in this frame that certain or some data are wrong.
In concrete the enforcement, fpga chip adopts the chip of the SPARTAN3A series of XILINX company, and concrete model is XC3S200A-4FT256C, and development platform is ISE9.2.It mainly contains three groups of signals: the lpc bus desired signal of communicating by letter with FPGA, the USB module desired signal of communicating by letter with FPGA, shared data line; The definition of concrete interface signal, as following table 1:
Signal name Direction Describe
LPC_FRAME_IO IN The FRAME pin position of LPC
LPC_RST_N_IO IN The LPC reset signal
LPC_CLK_IO IN The LPC clock signal
LPC_LAD_IO INOUT LPC data and address shared bus
USB_CLK IN The USB clock signal
F_FLAGA IN USB writes marking signal
F_FLAGB IN USB reads marking signal
F_SLOE OUT
F_SLRD OUT
F_SLWR OUT
UD_D INOUT The shared data line
Table 1
For the LPC-USB protocol conversion module, it is mainly according to the LPC standard, and the lpc bus write data is come, and in FPGA inside, by protocol conversion, the data that recognize is sent into first buffer zone of FPGA inside.There are various modes, this modular design mainly to utilize Memory Target WriteMode transmission data during lpc bus transmission data.Lpc bus has multiple different state when the transmission data, this module mainly realizes the conversion of different conditions with state machine, to realize that terminal computer is write FIFO1 by the data that lpc bus sends through after the protocol conversion.
Shown in Fig. 2 and 3, behind electrification reset, state machine enters initial state, and promptly current state is an initial state;
When each LPC_CLK rising edge clock comes to begin the judgement to current state temporarily;
When current state is initial state, at first make the data line of lpc bus place high-impedance state, the enable signal of writing of first buffer zone puts 0, when the data line that determines lpc bus is 0000 and frame signal when being 0, state machine is transferred to the DIR state, be that current state changes to the DIR state, otherwise allow current state be in initial state;
When current state is the DIR state, at first make the data line of lpc bus place high-impedance state, the enable signal of writing of first buffer zone puts 0, when the data line signal that determines lpc bus is 011 and frame signal when being 1, state machine is transferred to address state, be that current state changes to address state, otherwise allow its current state be in initial state;
When current state is address state, at first make the data line of lpc bus place high-impedance state, the enable signal of writing of first buffer zone puts 0, and each LPC_CLK clock period is transmitted 4 bit address, through 8 LPC_CLK clock period, the data line of 32 addresses by lpc bus sent, wherein high 12 ignore need not, low 20 effectively, state machine is transferred to data mode afterwards, be that current state changes to data mode, otherwise allow its current state be in address state;
When current state is data mode, at first make the data line of lpc bus place high-impedance state, the enable signal of writing of first buffer zone puts 0, each LPC_CLK clock period is transmitted 4 bit data, through 2 LPC_CLK clock period, the data line of 8 data by lpc bus sent, and state machine is transferred to the TAR1 state afterwards, and promptly current state changes to the TAR1 state;
When current state is the TAR1 state, the enable signal of writing of first buffer zone puts 0, when the data line that determines lpc bus is 1111 and frame signal when being 1, wait for 4 LPC_CLK clock period,, begin 20 bit address that address state sends are judged as the 5th LPC_CLK during the clock period, when being 0XD0000, state machine is transferred to sync state, and promptly current state changes to sync state, otherwise allows its current state be in initial state;
When current state is sync state, 8 bit data that send during data mode write the data input pin of FIF01, and the enable signal of writing of first buffer zone is put 1, and the data line of lpc bus puts 0000, state machine is transferred to the TAR2 state afterwards, and promptly current state changes to the TAR2 state;
When current state is the TAR2 state, the enable signal of writing of first buffer zone is put 0, the data line of lpc bus puts 1111, and state machine is transferred to the END state afterwards, and promptly current state changes to the END state;
When current state is the END state, the enable signal of writing of first buffer zone is put 0, the data line of lpc bus is put high-impedance state, and state machine is transferred to initial state afterwards, and promptly current state changes to initial state;
When other situations, the current state of state machine remains initial state.
For the USB-LPC protocol conversion module, this module is mainly according to the lpc bus standard, and in FPGA inside, through protocol conversion, the lpc bus reading of data is to terminal computer the data in second buffer zone.Various modes is arranged during the LPC reading of data, and what this design mainly utilized is Memory Target reading mode transmission data.Lpc bus has multiple different state when the transmission data, this module mainly realizes the conversion of different conditions with state machine, to realize the data read in second buffer zone to terminal computer.
Shown in Figure 4 and 5, behind electrification reset, state machine enters initial state, and promptly current state is an initial state;
When each LPC_CLK rising edge clock comes to begin the judgement to current state temporarily;
When current state is initial state, at first make the data line of lpc bus place high-impedance state, the enable signal of reading of second buffer zone puts 0, when the data line that determines lpc bus is 0000 and FRAME signal when being 0, state machine is transferred to the DIR state, be that current state changes to the DIR state, otherwise allow current state be in initial state;
When current state is the DIR state, the enable signal of reading of second buffer zone puts 0, and when the Senior Three position of the data line line that determines lpc bus is 010 and frame signal when being 1, state machine is transferred to address state, be that current state changes to address state, otherwise allow its current state be in initial state;
When current state is address state, at first make the data line line of lpc bus place high-impedance state, the enable signal of reading of second buffer zone puts 0, and each LPC_CLK clock period is transmitted 4 bit address, through 8 LPC_CLK clock period, the data line of 32 addresses by lpc bus transmitted, wherein high 12 ignore need not, low 20 effectively, state machine is transferred to the TAR1 state afterwards, be that current state changes to data mode, otherwise allow its current state be in address state;
When current state is the TAR1 state, the enable signal of reading of second buffer zone puts 0, when the bidirectional data line that determines lpc bus is 1111 and frame signal when being 1, wait for 1 LPC_CLK clock period, as the 2nd LPC_CLK during the clock period, begin 20 bit address that address state transmits are judged, when being 0XD0001 or when the 0XD0002, state machine is transferred to sync state and the data line of lpc bus is changed to 0101, be that current state changes to sync state and the data line of lpc bus is changed to 0101, otherwise allow its current state be in initial state;
When current state is sync state, operate as follows: when the address that determines the address state transmission is 0XD0001, preceding 2 LPC_CLK clock period, the enable signal of reading of second buffer zone puts 0, current state remains on sync state, the data line of lpc bus puts 0101, as the 3rd LPC_CLK during the clock period, the enable signal of reading of second buffer zone puts 1, the state machine current state remains on sync state, the data line of lpc bus is changed to 0101, the 4 LPC_CLK during the clock period, the data storage of the data output end of FIFO2 output in 8 data register, the enable signal of reading of second buffer zone puts 0, state machine is transferred to data mode, and promptly current state changes to data mode, and the data line of lpc bus is changed to 0000; When the address that determines the address state transmission is 0XD0002, at first the enable signal of reading of second buffer zone puts 0, preceding 3 LPC_CLK clock period, current state remains sync state, the data line signal of lpc bus is changed to 0101, the 4 LPC_CLK in the clock period, and state machine is transferred to data mode, be that current state is changed into data mode, the data line of lpc bus is changed to 0000; When the address that determines the address state transmission was other situations, the data line of lpc bus was changed to high-impedance state, and the enable signal of reading of second buffer zone puts 0, and state machine is transferred to initial state, and promptly current state is changed into initial state;
When current state is data mode, the enable signal of reading of second buffer zone puts 0, when the address that determines the address state transmission is 0XD0001, the 1st LPC_CLK clock period, low 4 bidirectional data lines that send lpc bus to that are stored in the data in 8 bit data register when the sync state, current state remains data mode simultaneously, the 2nd LPC_CLK clock period, high 4 data lines that send lpc bus to that are stored in the data in 8 bit data register when the sync state, state machine is transferred to the TAR2 state, and promptly current state is changed into the TAR2 state; When the address that determines the address state transmission is 0XD0002, the 1st LPC_CLK clock period, high 2 positions 11 of the data line of lpc bus, the empty marking signal assignment of FIFO2 is given bidirectional data line the 1st, the full scale will signal assignment of FIFO1 is given the 0th of data line of lpc bus, current state remains data mode simultaneously, the 2nd LPC_CLK clock period, the data line of lpc bus is changed to 1111, state machine is transferred to the TAR2 state, and promptly current state is changed into the TAR2 state; When the address that determines the address state transmission was other situations, state machine was transferred to initial state, and promptly current state is changed into initial state;
When current state was the TAR2 state, the enable signal of reading of second buffer zone put 0, and the bidirectional data line of lpc bus is changed to 1111, and state machine is transferred to the END state, and promptly current state is changed into the END state;
When current state is the END state, the enable signal of reading of second buffer zone is put 0, the data line of lpc bus is put high-impedance state, and state machine is transferred to initial state afterwards, and promptly current state changes to initial state;
When other situations, the current state of state machine remains initial state.
In force, first buffer zone, second buffer zone, CLKV module are mainly with utilizing Xilinx developing instrument ISE9.2 to generate IP CORE, wherein first buffer zone and second buffer zone are the FIFO of degree of depth 16K, utilize FPGA clock internal manager DCM to realize the CLKV module.First buffer zone is mainly realized the buffering of lpc bus write data, USB module read data.Lpc bus transmits data to first buffer zone by data input pin, the USB module is by data output end reading of data in first buffer zone, the enable signal of writing of first buffer zone links to each other with the lpc bus control end with clock signal, the enable signal of reading of first buffer zone links to each other with USB module controls end with clock signal, when first buffer zone is full, send FULL to indicate lpc bus, when first buffer empty, send EMPTY to indicate the USB module, when first buffer zone has 510 data empty again, send the PROG_EMPTY signal to the USB module.Second buffer zone is mainly realized the buffering of lpc bus read data, USB module write data.The USB module transmits data to second buffer zone by data input pin, lpc bus is by data output end reading of data in second buffer zone, the enable signal of reading of second buffer zone links to each other with the lpc bus control end with clock signal, the enable signal of writing of second buffer zone links to each other with the USB control end with clock signal, when second buffer zone is full, send FULL to indicate the USB module, when second buffer empty, send EMPTY to indicate lpc bus.
As shown in Figure 7, the USB module uses Cypress 68013A to change the controller of local bus as USB, and its is inner integrated enhancement mode 51 kernels can be done a lot of configurations to the related register in the usb communication, equally also can be used as standard 51 and call.Far Left is the USB transceiver, on transceiver the right is SIE (Serial Interface Engine), it also is in the communication of USB, the main unit of being responsible for, its inner integrated USB packing, give out a contract for a project, and packet receiving, the hardware circuit that unpacks, and stayed a large amount of registers, can allow 51 kernels dispose.SIE the right, and coupled be the configurable FIFO of 4KB, data enter FIFO from SIE, under the control of GPIF module or 51 kernels, outwards transmit in the mode of 8bit/16bit, just arrive Local bus, enter FPGA then.In the USB host-host protocol, our demand is: data volume want big and data transmission reliable, adopt the bulk transmission mode, it is to support wrong retransmission mechanism, in the configuration of FIFO, we have adopted 2 FIFO, a turnover, each 2Kbyte.
Be illustrated in figure 8 as the interface connection diagram of FPGA and USB module, and the physical interface definition, as shown in table 2 below:
Signal name Bit wide Direction Describe
RDYO 1 IN The empty zone bit that FPGA sends, sky is read in expression
RDY1 1 IN The full zone bit that FPGA sends, expression is write full
CTLO 1 OUT The WEN# enable signal, FIFO's writes among the control FPGA
CTL1 1 OUT The REN# enable signal, FIFO's reads among the control FPGA
CTL2 1 OUT The OE# enable signal is chosen FIFO among the FPGA
USB_CLK 1 OUT USB is the synchronous clock of interface, 48MHz to FPGA
Data
8 INOUT Bi-directional data
Table 2
The present invention describes by several specific embodiments, it will be appreciated by those skilled in the art that, without departing from the present invention, can also carry out various conversion and be equal to alternative the present invention.In addition, at particular condition or concrete condition, can make various modifications to the present invention, and not depart from the scope of the present invention.Therefore, the present invention is not limited to disclosed specific embodiment, and should comprise the whole embodiments that fall in the claim scope of the present invention.

Claims (12)

1.一种使用FPGA实现LPC-USB双向通信的装置,包括LPC总线和USB总线,其特征在于,该装置还包括:现场可编程逻辑器件和USB模块;所述现场可编程逻辑器件控制完成由LPC总线到USB总线的LPC数据到USB数据的协议转换和传送,以及完成由USB总线到LPC总线的USB数据到LPC数据的协议转换和传送;所述USB模块用于实现所述现场可编程逻辑器件和USB总线的数据交换;1. A device using FPGA to realize LPC-USB bidirectional communication, comprising LPC bus and USB bus, is characterized in that, the device also includes: field programmable logic device and USB module; described field programmable logic device control is completed by The protocol conversion and transmission from the LPC data to the USB data from the LPC bus to the USB bus, and the protocol conversion and transmission from the USB data to the LPC data from the USB bus to the LPC bus; the USB module is used to realize the field programmable logic Data exchange between the device and the USB bus; 所述现场可编程逻辑器件包括:LPC-USB协议转换模块、USB-LPC协议转换模块,第一缓冲区、以及第二缓冲区;The field programmable logic device includes: an LPC-USB protocol conversion module, a USB-LPC protocol conversion module, a first buffer, and a second buffer; 其中,LPC-USB协议转换模块用于接收LPC总线发送的LPC数据,并将其进行协议转换后发送到第一缓冲区;Wherein, the LPC-USB protocol conversion module is used to receive the LPC data sent by the LPC bus, and send it to the first buffer after protocol conversion; 第一缓冲区用于由LPC数据到USB数据协议转换及传送过程中数据的缓存;The first buffer is used for converting from LPC data to USB data protocol and buffering data during transmission; 第二缓冲区用于接收USB模块发送的USB数据,并用于由USB数据到LPC数据协议转换及传送过程中数据的缓存;The second buffer is used to receive the USB data sent by the USB module, and is used for data buffering during protocol conversion and transmission from USB data to LPC data; USB-LPC协议转换模块用于接收第二缓冲区输出的USB数据,并将其进行协议转换后发送LPC总线。The USB-LPC protocol conversion module is used to receive the USB data output from the second buffer, and convert it to the protocol and send it to the LPC bus. 2.根据权利要求1所述的使用FPGA实现LPC-USB双向通信的装置,其特征在于,所述第一缓冲区和第二缓冲区均是可进行16K byte数据读写的FIFO缓冲区。2. use FPGA according to claim 1 to realize the device of LPC-USB two-way communication, it is characterized in that, described first buffer and second buffer are all FIFO buffers that can carry out 16K byte data read and write. 3.根据权利要求2所述的使用FPGA实现LPC-USB双向通信的装置,其特征在于,所述第一缓冲区的写使能信号与所述LPC总线的控制端相连、读使能信号与所述USB模块的控制端相连、时钟信号分别与所述LPC总线和USB模块的控制端相连。3. use FPGA according to claim 2 to realize the device of LPC-USB two-way communication, it is characterized in that, the writing enable signal of described first buffer zone is connected with the control terminal of described LPC bus, read enable signal and The control terminal of the USB module is connected, and the clock signal is respectively connected with the control terminal of the LPC bus and the USB module. 4.根据权利要求2所述的使用FPGA实现LPC-USB双向通信的装置,其特征在于,所述第二缓冲区的读使能信号与所述LPC总线的控制端相连、写使能信号与所述USB模块的控制端相连、时钟信号分别与所述LPC总线和USB模块的控制端相连。4. use FPGA according to claim 2 to realize the device of LPC-USB two-way communication, it is characterized in that, the read enable signal of described second buffer zone is connected with the control terminal of described LPC bus, write enable signal and The control terminal of the USB module is connected, and the clock signal is respectively connected with the control terminal of the LPC bus and the USB module. 5.根据权利要求2所述的使用FPGA实现LPC-USB双向通信的装置,其特征在于,所述现场可编程逻辑器件还包括:时钟控制管理模块,其包括输入端、第一输出端和第二输出端,其中,输入端与外部全局时钟管脚相连,第一输出端的输出与输入端的时钟同相位,第二输出端的输出与输入端的时钟反相位。5. use FPGA according to claim 2 to realize the device of LPC-USB two-way communication, it is characterized in that, described field programmable logic device also comprises: clock control management module, it comprises input end, first output end and the first Two output terminals, wherein the input terminal is connected to the external global clock pin, the output of the first output terminal has the same phase as the clock of the input terminal, and the output of the second output terminal has an opposite phase to the clock of the input terminal. 6.一种针对权利要求1~5任一所述的使用FPGA实现LPC-USB双向通信的装置的LPC-USB数据转换方法,其特征在于,包括以下步骤:6. a kind of LPC-USB data conversion method for the device that uses FPGA to realize LPC-USB two-way communication described in claim 1~5 any one, it is characterized in that, comprises the following steps: S11、设置当前状态为开始状态;S11, setting the current state as the start state; S12、当所述LPC总线的高三位为011且帧信号为1时,设置当前状态为地址状态;S12. When the upper three bits of the LPC bus are 011 and the frame signal is 1, set the current state as the address state; S13、接收32位地址,设置当前状态为数据状态;S13. Receive a 32-bit address, and set the current state as a data state; S14、接收8位数据,设置当前状态为TAR1状态;S14. Receive 8-bit data, and set the current state as TAR1 state; S15、当所述LPC总线为1111且帧信号为1时,判断所述32位地址的低20位是否为0XD0000,如果是,设置当前状态为SYNC状态,否则,进入步骤S1;S15. When the LPC bus is 1111 and the frame signal is 1, judge whether the lower 20 bits of the 32-bit address are 0XD0000, if yes, set the current state as the SYNC state, otherwise, enter step S1; S16、将所述8位数据发送到第一缓冲区;S16. Send the 8-bit data to the first buffer; S17、结束LPC-USB数据转换。S17. End the LPC-USB data conversion. 7.根据权利要求6所述的方法,其特征在于,在步骤S11和S12之间还包括:设置所述LPC总线为高阻态,第一缓冲区的写使能信号置0;7. The method according to claim 6, characterized in that, between steps S11 and S12, further comprising: setting the LPC bus to a high-impedance state, and setting the write enable signal of the first buffer to 0; 8.根据权利要求6所述的方法,其特征在于,在步骤S13中,在每个LPC_CLK时钟周期接收4位地址,经过8个LPC_CLK时钟周期,接收所述32位地址;在步骤S14中,在每个LPC_CLK时钟周期接收4位数据,经过2个LPC_CLK时钟周期,接收所述8位数据。8. The method according to claim 6, wherein, in step S13, 4-bit address is received in each LPC_CLK clock cycle, and the 32-bit address is received through 8 LPC_CLK clock cycles; in step S14, 4-bit data is received in each LPC_CLK clock cycle, and the 8-bit data is received after 2 LPC_CLK clock cycles. 9.根据权利要求6所述的方法,其特征在于,在步骤S16中,在发送所述8位数据之前,还包括设置第一缓冲区的写使能信号为1,并设置所述LPC总线为0000。9. The method according to claim 6, wherein, in step S16, before sending the 8-bit data, it also includes setting the write enable signal of the first buffer to 1, and setting the LPC bus is 0000. 10.一种针对权利要求1~5任一所述的使用FPGA实现LPC-USB双向通信的装置的USB-LPC数据转换方法,其特征在于,包括以下步骤:10. A USB-LPC data conversion method for the device for implementing LPC-USB bidirectional communication using FPGA according to any one of claims 1 to 5, characterized in that it comprises the following steps: S21、设置当前状态为开始状态;S21. Set the current state as the start state; S22、当所述LPC总线的高三位为010且帧信号为1时,设置当前状态为地址状态;S22. When the upper three bits of the LPC bus are 010 and the frame signal is 1, set the current state as the address state; S23、接收32位地址,设置当前状态为TAR1状态;S23. Receive a 32-bit address, and set the current state as the TAR1 state; S24、当所述LPC总线为1111且帧信号为1时,判断所述32位地址的低20位是否为0XD0001或0XD0002,如果是,设置当前状态为SYNC状态,并设置所述LPC总线为0101,否则,进入步骤S21;S24, when the LPC bus is 1111 and the frame signal is 1, judge whether the lower 20 bits of the 32-bit address are 0XD0001 or 0XD0002, if so, set the current state as the SYNC state, and set the LPC bus as 0101 , otherwise, go to step S21; S25、判断所述32位地址的低20位是否为0XD0001,如果是,进入步骤S26;否则,进入步骤S27;S25, judge whether the lower 20 bits of the 32-bit address are 0XD0001, if yes, enter step S26; otherwise, enter step S27; S26、将所述第二缓冲区输出的数据发送到8位的数据寄存器中;S26. Send the data output by the second buffer to an 8-bit data register; S27、设置当前状态为数据状态、设置所述LPC总线为0000、以及设置所述第二缓冲区的读使能信号为0;S27. Set the current state as the data state, set the LPC bus to 0000, and set the read enable signal of the second buffer to 0; S28、判断所述32位地址的低20位是否为0XD0001,如果是,进入步骤S29;否则,进入步骤S210;S28. Determine whether the lower 20 bits of the 32-bit address are 0XD0001, if yes, enter step S29; otherwise, enter step S210; S29、将存储在所述8位的数据寄存器中的数据发送到所述USB-LPC协议转换模块;S29. Send the data stored in the 8-bit data register to the USB-LPC protocol conversion module; S210、在第1个LPC_CLK时钟周期,所述LPC总线的高2位置11,将所述第二缓冲区的空标志信号赋值给所述LPC总线的第1位,将所述第一缓冲区的满标志信号赋值给所述LPC总线的第0位,在第2个LPC_CLK时钟周期,设置所述LPC总线为1111;S210. In the first LPC_CLK clock cycle, set the high 2 position of the LPC bus to 11, assign the empty flag signal of the second buffer to the first bit of the LPC bus, and assign the first buffer to the first bit of the LPC bus. The full flag signal is assigned to the 0th bit of the LPC bus, and in the second LPC_CLK clock cycle, the LPC bus is set to 1111; S211、结束USB-LPC数据转换。S211. End the USB-LPC data conversion. 11.根据权利要求10所述的方法,其特征在于,在所述步骤S21和S22之间还包括:设置所述LPC总线为高阻态,第二缓冲区的读使能信号置0;在步骤S23中,在每个LPC_CLK时钟周期接收4位地址,经过8个LPC_CLK时钟周期,接收所述32位地址。11. The method according to claim 10, characterized in that, between the steps S21 and S22, further comprising: setting the LPC bus to a high-impedance state, and setting the read enable signal of the second buffer zone to 0; In step S23, a 4-bit address is received in each LPC_CLK clock cycle, and the 32-bit address is received after 8 LPC_CLK clock cycles. 12.根据权利要求11所述的方法,其特征在于,在步骤S29中,在第1个LPC_CLK时钟周期,将存储在所述8位的数据寄存器中的数据的低4位发送给所述USB-LPC协议转换模块,在第2个LPC_CLK时钟周期,将存储在所述8位的数据寄存器中的数据的高4位发送给所述USB-LPC协议转换模块。12. The method according to claim 11, wherein in step S29, in the first LPC_CLK clock cycle, the lower 4 bits of the data stored in the 8-bit data register are sent to the USB - The LPC protocol conversion module sends the upper 4 bits of the data stored in the 8-bit data register to the USB-LPC protocol conversion module in the second LPC_CLK clock cycle.
CN2008101424833A 2008-08-19 2008-08-19 A device using FPGA to realize LPC-USB bidirectional communication and LPC-USB and USB-LPC data conversion method Active CN101655825B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008101424833A CN101655825B (en) 2008-08-19 2008-08-19 A device using FPGA to realize LPC-USB bidirectional communication and LPC-USB and USB-LPC data conversion method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008101424833A CN101655825B (en) 2008-08-19 2008-08-19 A device using FPGA to realize LPC-USB bidirectional communication and LPC-USB and USB-LPC data conversion method

Publications (2)

Publication Number Publication Date
CN101655825A CN101655825A (en) 2010-02-24
CN101655825B true CN101655825B (en) 2011-01-19

Family

ID=41710119

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008101424833A Active CN101655825B (en) 2008-08-19 2008-08-19 A device using FPGA to realize LPC-USB bidirectional communication and LPC-USB and USB-LPC data conversion method

Country Status (1)

Country Link
CN (1) CN101655825B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102169470B (en) * 2010-02-27 2014-01-29 比亚迪股份有限公司 A conversion bridge from AHB bus to BVCI bus
CN102207920B (en) * 2010-03-30 2013-12-04 比亚迪股份有限公司 Conversion bridge for conversion from BVCI (basic virtual component interface) bus to AHB (advanced high performance bus)
CN104052456B (en) * 2014-06-23 2017-02-15 青岛海信电器股份有限公司 Circuit for two-way communication
CN106598901A (en) * 2016-12-08 2017-04-26 邦彦技术股份有限公司 System and chip for converting Local Bus into USB based on FPGA
CN113868179B (en) * 2021-09-10 2024-04-02 中国航空工业集团公司西安航空计算技术研究所 Communication device of LPC-DPRam and data conversion method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6370603B1 (en) * 1997-12-31 2002-04-09 Kawasaki Microelectronics, Inc. Configurable universal serial bus (USB) controller implemented on a single integrated circuit (IC) chip with media access control (MAC)
US20020116565A1 (en) * 2000-01-03 2002-08-22 Jing Wang USB host controller and interface with batched data transfer
US20030229738A1 (en) * 2002-06-05 2003-12-11 Dactron Controller interface
JP2004110409A (en) * 2002-09-18 2004-04-08 Hirotekku Kk Bus monitoring device
US20050235088A1 (en) * 2004-04-20 2005-10-20 Hynix Semiconductor Inc. Multi-protocol serial interface system
CN1758232A (en) * 2004-10-10 2006-04-12 中兴通讯股份有限公司 Interface modular converter and method for configuration of FPGA

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6370603B1 (en) * 1997-12-31 2002-04-09 Kawasaki Microelectronics, Inc. Configurable universal serial bus (USB) controller implemented on a single integrated circuit (IC) chip with media access control (MAC)
US20020116565A1 (en) * 2000-01-03 2002-08-22 Jing Wang USB host controller and interface with batched data transfer
US20030229738A1 (en) * 2002-06-05 2003-12-11 Dactron Controller interface
JP2004110409A (en) * 2002-09-18 2004-04-08 Hirotekku Kk Bus monitoring device
US20050235088A1 (en) * 2004-04-20 2005-10-20 Hynix Semiconductor Inc. Multi-protocol serial interface system
CN1758232A (en) * 2004-10-10 2006-04-12 中兴通讯股份有限公司 Interface modular converter and method for configuration of FPGA

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JP特开2004-110409A 2004.04.08

Also Published As

Publication number Publication date
CN101655825A (en) 2010-02-24

Similar Documents

Publication Publication Date Title
CN101477504B (en) System and method for transmission of data
CN101208678B (en) Software layer for communication between RS-232 to I2C translation IC and a host
CN102929836B (en) Special ASIC (Application Specific Integrated Circuit) chip system for spaceflight
CN109411007B (en) Universal flash memory test system based on FPGA
CN101087235A (en) A FPGA-based multi-functional communication interface conversion device and method
CN101655825B (en) A device using FPGA to realize LPC-USB bidirectional communication and LPC-USB and USB-LPC data conversion method
CN203812236U (en) Data exchange system based on processor and field programmable gate array
CN107911391A (en) A kind of AXI protocol based on FPGA and the method for SPI protocol conversion
EP1535169B1 (en) Improved inter-processor communication system for communication between processors
CN112395230A (en) UART interface extension circuit based on programmable logic device
CN101436171B (en) Modular communication control system
CN104714904A (en) RapidIO controller adopting window mapping mechanism and control method of RapidIO controller
CN107908587A (en) Real-time data acquisition transmitting device based on USB3.0
CN111736115A (en) High-speed transmission method of MIMO millimeter-wave radar based on improved SGDMA+PCIE
CN101004674A (en) Processor architecture
CN201336032Y (en) Software simulation serial data transmission device
CN107436857A (en) A kind of Enhanced SPI device and the method carried out data transmission using the device
CN103226531B (en) A kind of dual-port peripheral configuration interface circuit
CN101534259B (en) An asynchronous communication controller and its control method
CN117435538A (en) Bridging system for converting PCIe (peripheral component interconnect express) into SRIO (serial peripheral component interconnect express)
CN113609067B (en) System for realizing 32-channel RS485 interface card
CN107608927B (en) A Design Method for Supporting Full-featured LPC Bus Host Port
US11782636B2 (en) Method for data processing of an interconnection protocol to support multiple lanes, controller, and storage device
CN100462952C (en) Universal Serial Bus controller with configurable interface
CN115982071A (en) DDR3 controller-oriented network-on-chip conversion interface

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
EE01 Entry into force of recordation of patent licensing contract

Assignee: Xi'an EVOC Intelligent Technology Co.,Ltd.

Assignor: EVOC INTELLIGENT TECHNOLOGY Co.,Ltd.

Contract record no.: 2012610000049

Denomination of invention: Device for achieving LPC-USB two-way communication by using FPGA and data conversion method of LPC-US and USB-LPC

Granted publication date: 20110119

License type: Exclusive License

Open date: 20100224

Record date: 20120425

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230725

Address after: 518000 B2, 20/F, Yanxiang Science and Technology Building, No. 31, High-tech Fourth Road, Maling Community, Yuehai Street, Nanshan District, Shenzhen, Guangdong Province

Patentee after: Shenzhen Jiuniuyimao Intelligent Internet of Things Technology Co.,Ltd.

Address before: 518057 Guangdong city of Shenzhen province Nanshan District high in the four EVOC Technology Building No. 31

Patentee before: EVOC INTELLIGENT TECHNOLOGY Co.,Ltd.