赛灵思
直播中

王艳

7年用户 1253经验值
私信 关注
[问答]

如何使用ps2键盘

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)

刘瑞

2019-7-18 09:55:01
是的,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.
举报

h1654155275.5842

2019-7-18 10:03:37
我不确定什么是“拉起约束”在斯巴达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?
举报

刘瑞

2019-7-18 10:18:37
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.
举报

郎渐海

2019-7-18 10:38:29
我将“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
举报

更多回帖

×
20
完善资料,
赚取积分