Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

Transferring data from keyboard to Spartan-3 (xc3s200)

Status
Not open for further replies.

Partha Mukherjee

Newbie level 4
Joined
Dec 14, 2004
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
63
1. How should I do the bidirectional transfer from/to the Spartan-3 FPGA board
to/from keyboard where I have connected the keyboard to the PS/2 DIN
connector of the FPGA board?

2. How should I generate the User Constraint File (.ucf) automatically? Is there
any provision of doing it?

3. How should I use the expension connectors of the FPGA (A1, A2 & B1) for
processing?

Partha.
 

1. You have to use tri-state outputs.

2. .ucf - is simple text file. You can simply write it by your own. Here is simple example:
Code:
NET CLK          LOC=P80; # Main Clock
NET RST          LOC=P77; # Reset
NET MAIN_LED     LOC=P71; # Main LED
Template is:
NET net_name_in_your_design LOC=physical_pin_name

3. You should state here the title of your FPGA board, because this is board-specific question.
 

Will you please elucidate the answer regarding the tristate output of query number 1 (i.e transferring of data from/to Spartan-3 FPGA board to/from keyboard)?
 

Partha Mukherjee said:
Will you please elucidate the answer regarding the tristate output of query number 1 (i.e transferring of data from/to Spartan-3 FPGA board to/from keyboard)?

Tri-state is general approach. It does not depend what are you going to interface: keyboard or something else. The main idea is as followa: you have pin, which can be used as input and as an output. This pin is called bi-directional. Let's call this pin data. Now you will need additional internal signal, which will be used to control current direction of data pin. We will call this signal enable.

When enable is equal '1', data will flow from FPGA to out (so, pin data will work as output). When signal enable is equal '0', we will force output buffer to high-impedance state ('Z' for VHDL) and signal from external connection will force logic value on pin data. We can read this value. VHDL code is pretty simple for this.

Sequential example:
Code:
PROCESS(enable, a)
BEGIN
    IF (en='1') THEN
        data <= a; 
     ELSE 
        data <= 'Z';
    END IF;
END PROCESS;

Concurrent example:
Code:
data <= a WHEN enable='1' ELSE ‘Z’;

You have to control signal enable and read/write data in according to protocol (keyboard protocol in your case).

Good luck!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top