A kind of plug-in RAM Interface data access system based on 8051 single-chip microcomputers
Technical field
The present invention relates to single chip application technical field, more particularly to a kind of plug-in RAM Interface based on 8051 single-chip microcomputers
Data access system.
Background technology
Wishbone buses complete interconnection by establishing a general-purpose interface between IP kernel, can be used in soft core, admittedly
Interconnected between core and stone.For other IP kernel interface specifications, Wishbone interface specifications have it is simple,
Open, be efficient, beneficial to the features such as realization and completely free.Connect based on above-mentioned advantage, therefore using Wishbone buses
Mouth design.However, when Wishbone buses are as 8051 SCM system bus protocol, 8051 single-chip microcomputer GPIO quantity is not
It is enough.
Reading order of 8051 single-chip microcomputers to sub- module data, it is desirable in this rising edge clock or next of single-chip microcomputer order
Individual rising edge clock reads back data, so when read operation order is sent, it is desirable to which the data of reading are already prepared to.Outside
Portion's equipment can cause the data variation of fifo module and register module, be interrupted so as to produce, and 8051 single-chip microcomputers, which perform, interrupts journey
Sequence, the new data of submodule is read out, but it is that may all occur any time to interrupt, and may interrupt 8051 monolithics
The original read operation order of machine, after causing interrupt routine to be finished, the read operation order being interrupted can not be performed correctly.
It is inadequate for 8051 single-chip microcomputer GPIO quantity, and interrupt and cause single-chip microcomputer can not correctly perform read operation order
The problems such as, the present invention proposes a kind of plug-in RAM Interface data access system based on 8051 single-chip microcomputers.It is intended to compatible different readings
The submodule of delay is taken, and ensures that 8051 single-chip microcomputers can correctly read the data of each submodule.
The content of the invention
The defects of present invention is in order to make up prior art, there is provided a kind of compatibility it is strong based on the plug-in of 8051 single-chip microcomputers
RAM Interface data access system.
The present invention is achieved through the following technical solutions:
A kind of plug-in RAM Interface data access system based on 8051 single-chip microcomputers, it is characterised in that:Including 8051 monolithics
Machine, Wishbone master modules, fifo module, register module, RAM module, interruption control module and external equipment;Will
Interface of the plug-in RAM Interface of 8051 single-chip microcomputer as Wishbone bus protocols, 8051 single-chip microcomputer are connected to
Wishbone master modules, the fifo module, register module and RAM module are connected to by Wishbone buses
Wishbone master modules, it is also associated with postponing control between the Wishbone master modules and Wishbone buses
Module, the external equipment are connected to fifo module and register module, and the fifo module and register module pass through interruption
Control module is connected with 8051 single-chip microcomputers.
The fifo module, register module and RAM module unified distribution Wishbone base address, the register module
Multiple offset address are distributed with RAM module.
The fifo module, register module and RAM module further respectively have a temporary register, store respectively from
The data that fifo module, register module and RAM module are read.
The temporary register unified distribution Wishbone base address of the fifo module, register module and RAM module.
The access method of plug-in RAM Interface data access system of the invention based on 8051 single-chip microcomputers, it is characterised in that:Institute
State Wishbone master modules and the address of 8051 single-chip microcomputers, data and read-write enable signal are converted into standard
Wishbone bus signals, and pass through Wishbone bus access fifo modules, register module, RAM module and FIFO moulds
The temporary register of block, register module and RAM module three respectively;External equipment causes fifo module and register module
Data variation, when producing interruption, interrupt signal is deferred to 8051 single-chip microcomputers by interruption control module, right again at the end of read command pair
8051 single-chip microcomputers are interrupted, and it is implemented as:
8051 single-chip microcomputer sends the address read operation life of fifo module, register module and any module of RAM module
Respective modules are made, after certain delay, respective modules data are read into corresponding temporary register;8051 monolithic afterwards
Temporary register address read operation order corresponding to machine transmission, the data of corresponding temporary register are read in into 8051 single-chip microcomputers;
Now, interrupt signal is interrupted to 8051 single-chip microcomputers again.
The beneficial effects of the invention are as follows:The plug-in RAM Interface data access system based on 8051 single-chip microcomputers, by plug-in
RAM Interface can correctly read and write the register of different submodules, FIFO, RAM etc., can compatible different read latches submodule
Block;In addition, present invention also adds temporary register, using twi-read order and the method for interruption delay so that 8051 is single
Piece machine can correctly read the data of each submodule, and the present invention has the characteristics that read latch compatibility is strong, is easy to implement, has
Have broad application prospects.
Brief description of the drawings
Accompanying drawing 1 is illustrated for plug-in RAM Interface data access system logic module structure of the present invention based on 8051 single-chip microcomputers
Figure.
Embodiment
The present invention is described in detail below in conjunction with the accompanying drawings.
The plug-in RAM Interface data access system based on 8051 single-chip microcomputers, including 8051 single-chip microcomputers, Wishbone
Master modules, fifo module, register module, RAM module, interruption control module and external equipment;By 8051 monolithic
Interface of the plug-in RAM Interface of machine as Wishbone bus protocols, 8051 single-chip microcomputer are connected to Wishbone master moulds
Block, the fifo module, register module and RAM module are connected to Wishbone master modules by Wishbone buses,
It is also associated with postponing control module between the Wishbone master modules and Wishbone buses, the external equipment connects
Fifo module and register module are connected to, the fifo module and register module pass through interruption control module and 8051 single-chip microcomputers
It is connected.
The fifo module, register module and RAM module unified distribution Wishbone base address are 16 ' h1000,16 '
H2000,16 ' h3000, the register module and RAM module distribute multiple offset address.
Because the same data of fifo module can only be read once, the fifo module, register module and RAM module are also
A temporary register is respectively equipped with, stores the data read from fifo module, register module and RAM module respectively.
The temporary register unified distribution Wishbone base address of the fifo module, register module and RAM module is
16 ' h4000,16 ' h4001,16 ' h4002.
The access method of the plug-in RAM Interface data access system based on 8051 single-chip microcomputers, the Wishbone
Master modules are converted to the address of 8051 single-chip microcomputers, data and read-write enable signal the Wishbone bus signals of standard,
And pass through Wishbone bus access fifo modules, register module, RAM module and fifo module, register module and RAM
The temporary register of module three respectively;External equipment causes the data variation of fifo module and register module, produces interruption
When, during interruption control module is carried out to 8051 single-chip microcomputers again at the end of interrupt signal is deferred into 8051 single-chip microcomputer read commands pair
It is disconnected.
8051 single-chip microcomputer sends the address read operation life of fifo module, register module and any module of RAM module
Respective modules are made, after certain delay, respective modules data are read into corresponding temporary register;8051 monolithic afterwards
Temporary register address read operation order corresponding to machine transmission, the data of corresponding temporary register are read in into 8051 single-chip microcomputers.
When reading fifo module data, 8051 single-chip microcomputers first send out 16 ' h1000 addresses read operation orders, prolong by certain
Lag, fifo module data are read into fifo module data temporary register.16 ' h4000 addresses read operation lives are retransmited afterwards
Order, the data of fifo module data temporary register are read in into 8051 single-chip microcomputers.
When reading register module data, 8051 single-chip microcomputers first send out 16 ' h2000 addresses read operation orders, by certain
After delay, register module data are read into register module data temporary register.The reading of 16 ' h4001 addresses is retransmited afterwards
Operational order, the data of register module data temporary register are read in into 8051 single-chip microcomputers.
When reading RAM module data, 8051 single-chip microcomputers first send out 16 ' h3000 addresses read operation orders, by certain delay
Afterwards, RAM module data are read into RAM module data temporary register.16 ' h4002 addresses read operation orders are retransmited afterwards, will
The data of RAM module data temporary register read in 8051 single-chip microcomputers.
It is likely to be interrupted at any time to interrupt in view of 8051 single-chip microcomputers, and then performs the read operation order for reading new data,
The read operation order that may cause to be interrupted can not correctly read data after interrupt routine is finished.The present invention interrupts control
Interrupt signal can be deferred to reading by molding block when 8051 single-chip microcomputers have also been not carried out a complete read operation order pair
Order is interrupted to 8051 single-chip microcomputers again at the end of.