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: 
Highlighted
Observer sadiqhus
Observer
5,961 Views
Registered: ‎12-18-2009

accessing ports existing in Xps in SDK

Jump to solution

Hi,

 

I am new to XPS design,I have created some external ports in XPS, now i want to access them in SDK, i have searched for this, i have found some solutions which says add xps_gpio e.g.

 

http://forums.xilinx.com/xlnx/board/message?board.id=EDK&message.id=13325

 

I have added that, but my question is after adding gpio, how to connect it to specific port? (by editing mhs file?)

I have tried this 

 

BEGIN xps_gpio
 PARAMETER INSTANCE = xps_gpio_0
 PARAMETER HW_VER = 2.00.a
 PARAMETER C_INTERRUPT_PRESENT = 1
 PARAMETER C_GPIO_WIDTH = 8
 PARAMETER C_BASEADDR = 0x81480000
 PARAMETER C_HIGHADDR = 0x8148ffff
 BUS_INTERFACE SPLB = mb_plb
 PORT GPIO_IO =Ext_Port_1
END

 

where Ext_Port_1 is the port which i want to access in SDK, Is this procedure correct?

 

and then how to access that in SDK? I have tried to access it using "Ext_Port_1" and "xps_gpio_0_GPIO_IO" (which is the default name of gpio port ) but they  don't work. Should i use some sort of address? please explain this

 

Also what would be the case when i try to map an inout port? Is there any differnce?

 

 

Looking for your help !

 

Thanks and Best Regards,

sadiqhus

0 Kudos
1 Solution

Accepted Solutions
Participant n5ac
Participant
7,432 Views
Registered: ‎10-29-2008

Re: accessing ports existing in Xps in SDK

Jump to solution

OK your first declaration is correct in the MHS file:

 

 PORT GPIO_IO =Ext_Port_1

 

and then you will need to put the pin-out information in the UCF file.

 

To access it inside the micro in EDK, you should go to XPS, right click on the GPIO peripheral you have added and look at the driver documentation.  It can also be found under your Xilinx directory on your PC.  I'm using 10.1 so mine is here:

 

C:\Xilinx\10.1\EDK\sw\XilinxProcessorIPLib\drivers\gpio_v2_12_a\doc\html\api\index.html

 

You will need to know the base address of the GPIO device for most of the calls as I recall.  You will find this in your generated processor include files as xparameters.h.

 

There are also examples of how to access the GPIO device in another directory:

 

C:\Xilinx\10.1\EDK\sw\XilinxProcessorIPLib\drivers\gpio_v2_12_a\examples

 

Finally, your GPIO version might vary from mine, but if you look at the directory structure, just pick the most recent driver. 

 

Steve 

 

 

 

Tags (1)
6 Replies
Observer sadiqhus
Observer
5,932 Views
Registered: ‎12-18-2009

Re: accessing ports existing in Xps in SDK

Jump to solution

Is there no one who can answer that?

 

Needs help deperately ...

 

 

thanks

sadiqhus

0 Kudos
Observer sadiqhus
Observer
5,893 Views
Registered: ‎12-18-2009

Re: accessing ports existing in Xps in SDK

Jump to solution

Hi,

 

Can any body please help me in this matter? Is this thing is so difficult that no one is answering it?

 

 

Regards,

sadiqhus

0 Kudos
Participant n5ac
Participant
5,886 Views
Registered: ‎10-29-2008

Re: accessing ports existing in Xps in SDK

Jump to solution

OK, heres how it works:

 

1. You add a GPIO peripheral as you have done.

2. The port on the last line of your peripheral (PORT GPIO_IO =Ext_Port_1) is going to be the number of bits that you have set for the width (PARAMETER C_GPIO_WIDTH = 8)

3. The GPIO will have these ports "dangling" which you must connect in EDK.  If you want to connect them to other devices in EDK, just use the port you have supplied and the bit number such as Ext_Port_1[0].  If you want these to go outside of your EDK design (to other IP in an ISE world or to pins on the package) you will have to map them in the port section of your MHS file like this:

 

 PORT GPIO_GPIO_IO = GPIO_GPIO_IO, DIR = IO, VEC = [7:0]

 

4.  These ports will now flow out to your UCF file where you can connect them to pins, for example.  Like this:

 

Net GPIO_GPIO_IO<0> LOC=C10  | IOSTANDARD = LVCMOS33;  

Net GPIO_GPIO_IO<1> LOC=B10  | IOSTANDARD = LVCMOS33;  

 

Note how I have each bit assigned to a different pin using the <> notation for the bit number in the GPIO vector.

 

5. Now you can use the GPIO API inside of EDK to access the pins/port.  If you need help doing this, just ask.

 

Steve 

0 Kudos
Observer sadiqhus
Observer
5,865 Views
Registered: ‎12-18-2009

Re: accessing ports existing in Xps in SDK

Jump to solution

Hi steve,

 

Thanks alot for your reply, I have just some confusions

 

1-lets say we have Ext_port_1 which is also 8 bit wide, then should it be declared as 

 

 PORT GPIO_IO =Ext_Port_1??

 or 

PORT GPIO_IO[0] =Ext_Port_1[0]

PORT GPIO_IO[1] =Ext_Port_1[1]

.

.

.

PORT GPIO_IO[7] =Ext_Port_1[7] ?

 

 

 2-how to access that in SDK? I have tried to access it using "Ext_Port_1" and "xps_gpio_0_GPIO_IO" (which is the default name of gpio port ) but they  don't work. Should i use some sort of address? please explain this

 

Thanks and Best Regards,

sadiqhus

 

 

0 Kudos
Participant n5ac
Participant
7,433 Views
Registered: ‎10-29-2008

Re: accessing ports existing in Xps in SDK

Jump to solution

OK your first declaration is correct in the MHS file:

 

 PORT GPIO_IO =Ext_Port_1

 

and then you will need to put the pin-out information in the UCF file.

 

To access it inside the micro in EDK, you should go to XPS, right click on the GPIO peripheral you have added and look at the driver documentation.  It can also be found under your Xilinx directory on your PC.  I'm using 10.1 so mine is here:

 

C:\Xilinx\10.1\EDK\sw\XilinxProcessorIPLib\drivers\gpio_v2_12_a\doc\html\api\index.html

 

You will need to know the base address of the GPIO device for most of the calls as I recall.  You will find this in your generated processor include files as xparameters.h.

 

There are also examples of how to access the GPIO device in another directory:

 

C:\Xilinx\10.1\EDK\sw\XilinxProcessorIPLib\drivers\gpio_v2_12_a\examples

 

Finally, your GPIO version might vary from mine, but if you look at the directory structure, just pick the most recent driver. 

 

Steve 

 

 

 

Tags (1)
Observer sadiqhus
Observer
5,822 Views
Registered: ‎12-18-2009

Re: accessing ports existing in Xps in SDK

Jump to solution

Hi,

 

thanks a lot for your help steve...

 

 

Thanks and Best Regards,

Sadiqhus

Message Edited by sadiqhus on 03-26-2010 03:22 AM
0 Kudos