完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
datain接单片机P1口,sele接单片机P2口低四位,en接P2.4。下载到板子上调试的时候,发现分配给连接单片机的引脚灯正常,分配给输出引脚的灯没有变化?怎么回事,求解?谢谢。
代码如下: --接受命令模块实体 LIBRARY ieee; --打开IEEE库 USE ieee.std_logic_1164.ALL; --打开STD_LOGIC_1164包集 USE ieee.std_logic_unsigned.ALL; --打开STD_LOGIC_unsigned包集 ENtiTY Command_TxRx IS --定义实体 PORT ( Datain51: IN STD_LOGIC_VECTOR(7 DOWNTO 0); en : IN STD_LOGIC; Sele: IN STD_LOGIC_VECTOR(3 DOWNTO 0); doutF: OUT STD_LOGIC_VECTOR(31 DOWNTO 0); doutA: OUT STD_LOGIC_VECTOR(7 DOWNTO 0); ans: OUT STD_LOGIC:='1'; modesel:OUT STD_LOGIC; waveform:OUT STD_LOGIC_VECTOR(1 DOWNTO 0); trigernum:OUT STD_LOGIC_VECTOR(7 DOWNTO 0); delaytime:OUT STD_LOGIC_VECTOR(7 DOWNTO 0) ); END Command_TxRx; ARCHITECTURE bhv OF Command_TxRx IS signal FTEMP:std_logic_vector(31 downto 0); signal ATEMP:std_logic_vector(7 downto 0); signal TRIGERTEMP:std_logic_vector(7 downto 0); signal DELAYTEMP:std_logic_vector(7 downto 0); signal enable:std_logic; signal modeselect:std_logic; signal waveselect:std_logic_vector(1 downto 0); BEGIN --COM1: PROCESS(en,Sele) BEGIN IF en='1' THEN CASE Sele IS WHEN "0001" => modeselect<=DATAIN51(0); WHEN "0010" => waveselect(1 DOWNTO 0)<=DATAIN51(1 DOWNTO 0); WHEN "0011" => FTEMP(7 DOWNTO 0)<=DATAIN51(7 DOWNTO 0); WHEN "0100" => FTEMP(15 DOWNTO 8)<=DATAIN51(7 DOWNTO 0); WHEN "0101" => FTEMP(23 DOWNTO 16)<=DATAIN51(7 DOWNTO 0); WHEN "0110" => FTEMP(31 DOWNTO 24)<=DATAIN51(7 DOWNTO 0); WHEN "0111" => ATEMP(7 DOWNTO 0)<=DATAIN51(7 DOWNTO 0); WHEN "1000" => TRIGERTEMP(7 DOWNTO 0)<=DATAIN51(7 DOWNTO 0); WHEN "1001" => DELAYTEMP(7 DOWNTO 0)<=DATAIN51(7 DOWNTO 0); WHEN "1010" => enable<='0'; WHEN OTHERS => -- modeselect<=modeselect; -- waveselect<=waveselect; -- FTEMP<=FTEMP; -- ATEMP<=ATEMP; -- TRIGERTEMP<=TRIGERTEMP; -- DELAYTEMP<=DELAYTEMP; -- enable<=enable; END CASE; ELSE enable<='1'; END IF; END PROCESS; doutF<=FTEMP; doutA<=ATEMP; trigernum<=TRIGERTEMP; delaytime<=DELAYTEMP; ans<=enable; modesel<=modeselect; waveform<=waveselect; END bhv; |
|
相关推荐
1个回答
|
|
先用软件自带的仿真工具分析下程序逻辑是否正确在到板子省调试
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
1415 浏览 1 评论
助力AIoT应用:在米尔FPGA开发板上实现Tiny YOLO V4
1055 浏览 0 评论
2491 浏览 1 评论
2190 浏览 0 评论
矩阵4x4个按键,如何把识别结果按编号01-16(十进制)显示在两个七段数码管上?
2457 浏览 0 评论
1920 浏览 52 评论
6020 浏览 113 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-25 02:38 , Processed in 0.436298 second(s), Total 42, Slave 35 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号