完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
tify;text-indent: 40px;">我试图通过u*** HID主机将u***键盘与我的spartan 6接口。
我对此问题的第一反应是查看用户指南: http://www.digilentinc.com/Data/Products/NEXYS3/Nexys3_rm.pdf 他们谈论u***非常虚伪,但它似乎一旦我插入u***它,它应该工作。 但它肯定没有。 他们所展示的是USB主机连接到PIC24FJ192,后者连接到斯巴达6板。 也许我需要做一些额外的事情来让它发送到ps2键盘时钟和数据? 我在VHDL编程,我决定检查是否 ps数据和时钟都有任何结果。 所以这就是我的工作。 ---开始代码 实体键盘是 port(时钟:std_logic; psclock,psdata:在std_logic中; LED:输出std_logic_vector(1 downto 0)); 结束键盘 键盘的架构beh 开始 LED(0)以下为原文 I am trying to interface a u*** key board with my spartan 6 via the u*** HID host. My first response to the problem was to look at the user guide: http://www.digilentinc.com/Data/Products/NEXYS3/Nexys3_rm.pdf They talk about the u*** hid very vagely, but it almost seems like once I plug the u*** it, then it should work. But it certainly does not. What they do show is that the u*** host connects to a PIC24FJ192 which connects to the spartan 6 board. Maybe I need to do something extra to make it send stuff to the ps2keyboard clock and data? I am programming in VHDL and I decided to check if There was anything comming out of the ps data and clock. So this is what I do. ---start code entity keyboard is port( clock: in std_logic; psclock, psdata: in std_logic; LED: out std_logic_vector(1 downto 0)); end keyboard architecture beh of keyboard is begin LED(0) <= psclock; LED(1) <= psdata; end beh. -------------end code --start ucf file Net "clock" LOC= V10 | IOSTANDARD=LVCMOS33; ## Pic USB-HID interface Net "psdata" LOC = J13| IOSTANDARD = LVCMOS33; Net "psclock" LOC = L12 | IOSTANDARD = LVCMOS33; Net "LED<0>" LOC = U16 | IOSTANDARD = LVCMOS33; Net "LED<1>" LOC = V16 | IOSTANDARD = LVCMOS33; --end ucf file Theoretically, when the keyboard is connected and doing nothing, the psclock and psdata are both high. If they are both high, then they should light up the leds. The problem is that it isn't lighting up the LEDs which makes me believe that I am missing a step. The above code is all I am using when I synthesise and programm the board. what can I do to get the keyboard to send signals to my spartan 6 board? Has anyone tried interfacing a u*** keyboard to the spartan 6? |
|
相关推荐
9个回答
|
|
是的,PIC单片机负责处理所有USB HID内容并模拟PS / 2接口。
我没有使用NEXYS3,但在类似的板上,显然有时需要指定PULLUP约束。 此外,一些USB设备无法正常工作,所以尝试一些不同的。 以上来自于谷歌翻译 以下为原文 Yeah, the PIC microcontroller takes care of all of the USB HID stuff and emulates a PS/2 interface. I haven't used the NEXYS3 but on a similar board it's apparently sometimes necessary to specify PULLUP constraints. Additionally, some USB devices just don't work properly so try a few different ones. |
|
|
|
我不确定什么是“拉起约束”在斯巴达6的主ucf文件中没有提到:
http://www.digilentinc.com/Data/Products/NEXYS3/Nexys3_Master_ucf.zip 如果存在这样的事情,那么我需要添加什么? 以上来自于谷歌翻译 以下为原文 I'm not sure what would be a "pull up contraint" It isn't mentioned on the spartan 6's master ucf file: http://www.digilentinc.com/Data/Products/NEXYS3/Nexys3_Master_ucf.zip if such a thing exists then what would I need to add? |
|
|
|
Digilent提供的UCF只是一个起点:)
尝试 NET“psdata”PULLUP; 净“psclock”PULLUP; 不能保证这会有所帮助,但值得一试。 以上来自于谷歌翻译 以下为原文 The Digilent-supplied UCF is just a starting point :) Try NET "psdata" PULLUP;Net "psclock" PULLUP; No guarantees that this'll help, but it's worth a try. |
|
|
|
我将“PULLUP”添加到我的禁令文件中,LEDS LIT UP !!!!!!
:smileyhappy: 谢谢你,乔尔比先生 净“PS2DATA”LOC = J13 | IOSTANDARD = LVCMOS33 | 拉起; #Bank = 1,引脚名称= IO_L39P_M1A3,Sch名称= PIC-SDI1Net“PS2CLOCK”LOC = L12 | IOSTANDARD = LVCMOS33 | 拉起; #Bank = 1,引脚名称= IO_L40P_GCLK11_M1A5,Sch名称= PIC-SCK1 以上来自于谷歌翻译 以下为原文 I added "PULLUP" to my contraint file and the LEDS LIT UP!!!!!! :smileyhappy: Thank YOU Mr. Joelby Net "PS2DATA" LOC = J13 | IOSTANDARD = LVCMOS33 | PULLUP; #Bank = 1, pin name = IO_L39P_M1A3, Sch name = PIC-SDI1 Net "PS2CLOCK" LOC = L12 | IOSTANDARD = LVCMOS33 | PULLUP; #Bank = 1, pin name = IO_L40P_GCLK11_M1A5, Sch name = PIC-SCK1 |
|
|
|
优秀!
我很高兴有帮助。 我在Digilent Atlys Resources页面上更新了PS / 2信息,其中一些可能适用于您的Nexys3。 我能给出的最大提示是对手册中的所有内容都非常怀疑,并参考原理图。 以上来自于谷歌翻译 以下为原文 Excellent! I'm glad that helped. I've updated the PS/2 info on my Digilent Atlys Resources page, some of which you might find applicable to your Nexys3. The biggest hint I can give is to be incredibly suspicious about everything in the manual and to refer to the schematic diagram. |
|
|
|
thx,man ...因为你的建议我的设计有效....
以上来自于谷歌翻译 以下为原文 thx, man...my design works because of your suggestion.... |
|
|
|
@joelby
我也在尝试与Digilent Atlys Spartan 6板相同的接口。 我的LED指示灯亮起,显示来自微控制器的键盘clk和数据引脚很高,但它仍可在不连接键盘的情况下工作。 这意味着它没有检测到任何键盘。 我的vhdl代码 entity interfacetest1 isPort(reset:in STD_LOGIC; kbclk:in STD_LOGIC; kbdata&amp; colon; in STD_LOGIC; clk:in std_logic; out1:out STD_LOGIC_VECTOR(7 downto 0)); end interfacetest1; 体系结构interfacetest1的行为是 开始 process(reset,clk)beginif(clk ='1'和clk'event)thenif(reset ='1')then1elsif(kbclk ='1')then out1(0)out1(1)out1(7 downto 2) elsif(kbclk ='0')然后out1(0)out1(1)out1(7 downto 2)结束if; 结束如果;结束过程; 结束行为; ucf约束 NET“clk”LOC =“L15”; #Bank = 1,引脚名称= IO_L42P_GCLK7_M1UDM,类型= GCLK,Sch名称= GCLKNET“out1(0)”LOC =“U18”; #Bank = 1,引脚名称= IO_L52N_M1DQ15,Sch名称= LD0 NET“out1(1)”LOC =“M14”; #Bank = 1,引脚名称= IO_L53P,Sch名称= LD1 NET“out1(2)”LOC =“N14”; #Bank = 1,引脚名称= IO_L53N_VREF,Sch名称= LD2 NET“out1(3)”LOC =“L14”; #Bank = 1,引脚名称= IO_L61P,Sch名称= LD3 NET“out1(4)”LOC =“M13”; #Bank = 1,引脚名称= IO_L61N,Sch名称= LD4 NET“out1”LOC =“D4”; #Bank = 0,引脚名称= IO_L1P_HSWAPEN_0,Sch名称= HSWAP / LD5 NET“out1”LOC =“P16”; #Bank = 1,引脚名称= IO_L74N_out1UT_BUSY_1,Sch name = LD6 NET“out1”LOC =“N12”; #Bank = 2,引脚名称= IO_L13P_M1_2,Sch名称= M1 / LD7NET“复位”LOC =“N4”; #Bank = 3,Pin name = IO_L1P,Sch name = BTNU NET“kbclk”LOC =“P17”| 拉起; #Bank = 1,引脚名称= IO_L49P_M1DQ10,Sch名称= PIC32-SCK1NET“kbdata”LOC =“N15”| 拉起; #Bank = 1,引脚名称= IO_L50P_M1UDQS,Sch名称= PIC32-SDI1 如果加载了微控制器上的固件,那么当我按下键盘上的任何键时,Led(1)和LED(0)应该闪烁,但它不起作用。 PIC单片机是否需要使用新固件进行刻录? 以上来自于谷歌翻译 以下为原文 @joelby I am also trying the same interfacing with Digilent Atlys Spartan 6 board. My LEDs lit up showing that Keyboard clk and data pin from microcontroller is high but it still works without attaching keyboard. Meaning it is not detecting any keyboard . my vhdl code entity interfacetest1 is Port ( reset : in STD_LOGIC; kbclk : in STD_LOGIC; kbdata : in STD_LOGIC; clk : in std_logic; out1 : out STD_LOGIC_VECTOR (7 downto 0)); end interfacetest1; architecture Behavioral of interfacetest1 is begin process(reset, clk) begin if(clk= '1' and clk' event) then if(reset = '1') then out1<="00001010"; elsif(kbclk ='1') then out1(0)<=kbclk; out1(1) <=kbdata; out1(7 downto 2) <="111100"; elsif(kbclk ='0') then out1(0)<=kbclk; out1(1) <=kbdata; out1(7 downto 2) <="111110"; end if; end if; end process; end Behavioral; ucf constraints NET "clk" LOC = "L15"; # Bank = 1, Pin name = IO_L42P_GCLK7_M1UDM, Type = GCLK, Sch name = GCLK NET "out1(0)" LOC = "U18"; # Bank = 1, Pin name = IO_L52N_M1DQ15, Sch name = LD0 NET "out1(1)" LOC = "M14"; # Bank = 1, Pin name = IO_L53P, Sch name = LD1 NET "out1(2)" LOC = "N14"; # Bank = 1, Pin name = IO_L53N_VREF, Sch name = LD2 NET "out1(3)" LOC = "L14"; # Bank = 1, Pin name = IO_L61P, Sch name = LD3 NET "out1(4)" LOC = "M13"; # Bank = 1, Pin name = IO_L61N, Sch name = LD4 NET "out1<5>" LOC = "D4"; # Bank = 0, Pin name = IO_L1P_HSWAPEN_0, Sch name = HSWAP/LD5 NET "out1<6>" LOC = "P16"; # Bank = 1, Pin name = IO_L74N_out1UT_BUSY_1, Sch name = LD6 NET "out1<7>" LOC = "N12"; # Bank = 2, Pin name = IO_L13P_M1_2, Sch name = M1/LD7 NET "reset" LOC = "N4"; # Bank = 3, Pin name = IO_L1P, Sch name = BTNU NET "kbclk" LOC = "P17" | PULLUP; # Bank = 1, Pin name = IO_L49P_M1DQ10, Sch name = PIC32-SCK1 NET "kbdata" LOC = "N15"| PULLUP; # Bank = 1, Pin name = IO_L50P_M1UDQS, Sch name = PIC32-SDI1 If firmware on microcontroller is loaded, then when i press any key on keyboard Led(1) and led(0) should blink, but it isn't working. Does the PIC microcontroller need to be burned with a new firmware? |
|
|
|
我怀疑问题是你的设计会在发生某些事情时闪烁LED,但由于所涉及的脉冲很短,你根本无法用眼睛察觉它们。
要么使用示波器来观察实际发生的情况,要么改变你的设计以使用某种类型或“脉冲拉伸”来记录过渡并将其保持足够长的时间以便能够观察它。 一种简单的方法可能是检测和计数时钟转换并在LED上显示二进制计数器。 如果计算单个时钟边缘,理论上这意味着每次按键会使值增加11。 以上来自于谷歌翻译 以下为原文 I suspect that the problem is that your design flashes the LEDs when something happens, but because the pulses involved are very short, you will simply not be able to perceive them with your eyes. Either use an oscilloscope to observe what is actually happening, or changed your design to use some sort or "pulse stretching" which will register a transition and hold it for long enough for you to be able to observe it. One easy way might be to detect and count clock transitions and display a counter in binary on the LEDs. If counting a single clock edge, this would in theory mean that each key press would increment the value by eleven. |
|
|
|
@joelby
谢谢你的想法。 我尝试过这个 。 我做了一个代码,其中如果clk变低甚至一次它应该显示不同的LED输出,但它不起作用。我将在不同的斯巴达板上尝试我的代码,看看我的USB端口是否有问题。 但是,为什么代码不起作用还有其他可能吗? 以上来自于谷歌翻译 以下为原文 @joelby Thanks for the idea. I tried it . I made a code wherein if clk goes low even once it should show different LED output, but it doesn't work. I will try my code on different spartan board to see whether there is a problem with my USB port on board. But is there any other possiblity why the code is not working? |
|
|
|
只有小组成员才能发言,加入小组>>
2473 浏览 7 评论
2860 浏览 4 评论
Spartan 3-AN时钟和VHDL让ISE合成时出现错误该怎么办?
2321 浏览 9 评论
3406 浏览 0 评论
如何在RTL或xilinx spartan fpga的约束文件中插入1.56ns延迟缓冲区?
2502 浏览 15 评论
有输入,但是LVDS_25的FPGA内部接收不到数据,为什么?
2151浏览 1评论
请问vc707的电源线是如何连接的,我这边可能出现了缺失元件的情况导致无法供电
644浏览 1评论
求一块XILINX开发板KC705,VC707,KC105和KCU1500
503浏览 1评论
2053浏览 0评论
783浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-2-2 19:56 , Processed in 1.335166 second(s), Total 94, Slave 77 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号