UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Participant sticken
Participant
11,351 Views
Registered: ‎04-11-2012

Reading data form GPIO

Hello everybody,

 

How can I read data from GPIO of an FPGA? Is there any special/dedicated instruction or have I to declare the entity of a component (using VHDL) and connect the GPIO port to the "in" port of my component?

Any help/link/hint would be much appreciated.


Thank you,

 

sticken

0 Kudos
10 Replies
Xilinx Employee
Xilinx Employee
11,345 Views
Registered: ‎01-03-2008

Re: Reading data form GPIO

You are designing hardware circuits for an FPGA and not writing code for a CPU.  So the concept of reading a GPIO does not exist.  The FPGA does have bidirectional IO pins and these can be directly connected to the hardware circuits that you are designing.

------Have you tried typing your question into Google? If not you should before posting.
Too many results? Try adding site:www.xilinx.com
0 Kudos
Participant sticken
Participant
11,334 Views
Registered: ‎04-11-2012

Re: Reading data form GPIO

You're right! I have some knowledge of VHDL and hardware circuits, but I've never worked with an FPGA. How can I connect IO pins to I/O ports of my circuit?

 

Thanks in advance.

 

sticken

0 Kudos
Xilinx Employee
Xilinx Employee
11,319 Views
Registered: ‎01-03-2008

Re: Reading data form GPIO

The synthesizer will automatically insert IO buffers on the to level ports.
------Have you tried typing your question into Google? If not you should before posting.
Too many results? Try adding site:www.xilinx.com
0 Kudos
Historian
Historian
11,313 Views
Registered: ‎02-25-2008

Re: Reading data form GPIO


@sticken wrote:

You're right! I have some knowledge of VHDL and hardware circuits, but I've never worked with an FPGA. How can I connect IO pins to I/O ports of my circuit?

 

Thanks in advance.


Is your "circuit" the external stuff connected to the FPGA, or is it the logic you're describing that lives IN the FPGA?

----------------------------Yes, I do this for a living.
0 Kudos
Participant sticken
Participant
11,302 Views
Registered: ‎04-11-2012

Re: Reading data form GPIO

bassman59, my circuit is the logic that lives in the FPGA. So the synthesizer will insert the I/O buffers but how can I send data from outside to the circuit inside the FPGA?

 

Thanks in advance,

 

Matteo

0 Kudos
Voyager
Voyager
11,299 Views
Registered: ‎04-02-2011

Re: Reading data form GPIO

 

my circuit is the logic that lives in the FPGA. So the synthesizer will insert the I/O buffers but how can I send data from outside to the circuit inside the FPGA?

 

 


 

 

You can send data from outside world to inside FPGA through GPIO's.

 

library ieee;
use ieee.std_logic_1164.all;

entity test_in is

   port (

               clk         : in std_logic;
               rst         : in std_logic;
               gpio_i     : in std_logic;

               gpio_o     : out std_logic

           );

end test_in;

Architecture rtl of test_in is

signal temp : std_logic;   

begin

process(clk,rst)

  begin

     if(rst='1') then

        temp <= '0';

     elsif(Rising_edge(clk)) then

       temp <= gpio_i;

      end if;

 end process;

  gpio_o <= temp;

    end rtl;

 

This is just a simple code illustrating how to take data from outside,inside the FPGA through GPIO pin an gving output on other GPIO pin or GPIO LED.

 

However if you want to read the data from GPIO you may use Logic Analyser to check whether there is some signal i.e data present on GPIO or not...

 

0 Kudos
Xilinx Employee
Xilinx Employee
11,287 Views
Registered: ‎01-03-2008

Re: Reading data form GPIO

> how can I send data from outside to the circuit inside the FPGA?

 

By applying the data to the pin of the the FPGA that you have assigned the input to.  You seem to be missing some very basic hardware and FPGA concepts.  I would strongly encourage you to go through some of the simple ISE tutorials.

------Have you tried typing your question into Google? If not you should before posting.
Too many results? Try adding site:www.xilinx.com
0 Kudos
Historian
Historian
11,273 Views
Registered: ‎02-25-2008

Re: Reading data form GPIO


 

 You can send data from outside world to inside FPGA through GPIO's.

 

This is just a simple code illustrating how to take data from outside,inside the FPGA through GPIO pin an gving output on other GPIO pin or GPIO LED.

 

However if you want to read the data from GPIO you may use Logic Analyser to check whether there is some signal i.e data present on GPIO or not...

 


That's overly complicating the matter.

"GPIO" is a microcontroller concept which is irrelevant in the FPGA world. All FPGA pins are GPIO in a sense. They ARE general purpose and they ARE I/O.

----------------------------Yes, I do this for a living.
0 Kudos
Highlighted
Participant sticken
Participant
11,235 Views
Registered: ‎04-11-2012

Re: Reading data form GPIO

Could you tell me how/where to find those tutorials?

 

Thank you

Tags (1)
0 Kudos
Historian
Historian
3,163 Views
Registered: ‎02-25-2008

Re: Reading data form GPIO


@sticken wrote:

Could you tell me how/where to find those tutorials?

 

Thank you


a) Turn on your computer.
b) Log in.

c) Launch your favorite Web browser.

d) enter www.google.com into the address bar.

e) Enter Xilinx ISE tutorial into the search bar.

f) Press enter.

g) ???

h) Profit!

----------------------------Yes, I do this for a living.