专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > 硬件开发

FPGA怎样读外部RAM,该如何处理

发布时间:2010-06-13 21:40:35 文章来源:www.iduyao.cn 采编人员:星星草
FPGA怎样读外部RAM
硬件连接:
单片机的P0,P2,WR,ALE连接FPGA.

单片机发送:
定义--#define SendOrder *((volatile unsigned char xdata *)(0x0709))
例子--SendOrder=0x01;

问题:FPGA怎样读取地址0x0709上的0x01值?
急,最好能给代码~~

------解决方案--------------------
楼主可以参考下:
http://www.eetop.cn/bbs/thread-56069-1-1.html
------解决方案--------------------
路过留脚印
------解决方案--------------------
那你想问的是什么?VHDL的实现?
FPGA里面至少要实现一个地址译码器,至少要实现一个8-BIT的寄存器,当所有的信号(RD/WR)符合一个"CPU写"的时序的时候,如果地址是0x0709,数据(0x01)会被写到寄存器里面去.....
ALE好处理,就是一个锁存器,很简单...
------解决方案--------------------

一个简单的VHDL实现,可以对地址0x0709译码,并写入一个字节
library ieee;
use ieee.std_logic_1164.all;

entity test is
port (
addr: in std_logic_vector(15 downto 0);
data: in integer range 0 to 255;
nwr: in std_logic;
nrd: in std_logic;
ncs: in std_logic);
end entity test;

architecture a1 of test is
signal work_reg: integer range 0 to 255;
signal n_reg_write: std_logic;
begin
n_reg_write <= '0' when (ncs = '0' and addr(15 downto 0) = X"0709" and nwr = '0') else
'1';

process(n_reg_write)
begin

if (n_reg_write'event and n_reg_write = '1') then
work_reg <= data;
end if;

end process;

end architecture a1;
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: