Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Need help with ps/2 keyboard interface

Status
Not open for further replies.

siddharthakala

Member level 2
Joined
Jul 20, 2010
Messages
53
Helped
6
Reputation
12
Reaction score
5
Trophy points
1,288
Location
bangalore
Activity points
1,732
Hi,

I am trying to design a simple PS/2 keyboard interface for Nexys3 board. The design should just recognize some scancodes and turn on an LED and another LED to show connection of keyboard with FPGA.

My design is not working and what I dont understand is - why a PIC microcontroller is provided? Can I not just directly use the keyboard data and clock inputs without using the PIC controller for my design. I thought I should be able to implement the design on FPGA and use the PS/2 inputs directly. But its not working at all.

Nexys3 uses USB HID port for PS/2 inputs.

It would be great if someone could help me with this. Thanks a lot
 

lucbra

Advanced Member level 2
Joined
Oct 30, 2003
Messages
514
Helped
73
Reputation
146
Reaction score
63
Trophy points
1,308
Location
Belgium
Activity points
3,251
try opencores - they have a ready-to-run PS/2 core (you'll need to hook the necessary interface to your LEDs of course

Good luck
 

srizbf

Advanced Member level 5
Joined
Apr 3, 2010
Messages
1,995
Helped
417
Reputation
840
Reaction score
328
Trophy points
1,363
Activity points
10,985
the PIC controller acts as a keyboard controller and sends out data and clock in ps/2 interface.

you must have the proper command to send to keyboard initially after power-on before reading the ps/2 signals.
 

joelby

Full Member level 4
Joined
Jun 6, 2011
Messages
196
Helped
66
Reputation
130
Reaction score
64
Trophy points
1,308
Activity points
2,644
Some of the other Digilent boards have reference designs for PS/2 that you could use - have a look at Digilent Inc. - Digital Design Engineer's Source .

The PIC provides a USB host that emulates PS/2 devices, which are much simpler to deal with than USB in an FPGA. You could connect a PS/2 keyboard or mouse directly to the FPGA (with appropriate pull-ups) if you wanted to, but Digilent figure that most people have USB peripherals these days.
 

siddharthakala

Member level 2
Joined
Jul 20, 2010
Messages
53
Helped
6
Reputation
12
Reaction score
5
Trophy points
1,288
Location
bangalore
Activity points
1,732
Thanks for the helpful suggestions.

I am assuming that I will need to run the power on sequence before being able to get the codes from the keyboard. I did not see any examples or designs doing that so I thought it is not needed.

Thanks a lot
 

joelby

Full Member level 4
Joined
Jun 6, 2011
Messages
196
Helped
66
Reputation
130
Reaction score
64
Trophy points
1,308
Activity points
2,644
It's been a while, and I'm not sure if the NEXYS3's PS/2 emulation requires it (I have a suspicion it does, because I recall that my ATLYS doesn't generate any output when a keyboard or mouse is attached and you don't do anything else), but normally you'd send 0xFF 0xF4 to the keyboard to reset it and enable reporting.

If you look at the PS/2 design I linked in my previous post ("PS2 Mouse Control reference component"), you'll see that it does actually initialise the mouse when the controller is reset.
 

siddharthakala

Member level 2
Joined
Jul 20, 2010
Messages
53
Helped
6
Reputation
12
Reaction score
5
Trophy points
1,288
Location
bangalore
Activity points
1,732
Thanks.

This is what I was doubtful about. I was not doing the reset thing before performing the required task. I think it should work now.
 

zafartahirov

Newbie level 3
Joined
Mar 9, 2011
Messages
4
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,283
Activity points
1,304
Did u manage to connect the keyboard through USB-HID?
 

iaia85

Newbie level 2
Joined
Mar 9, 2013
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,291
Hi guys,

can I use the EPP interface to connect the usb keyboard/mouse?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top