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
Contributor
Contributor
5,626 Views
Registered: ‎11-20-2009

How to interface SPISEL pin in XPS SPI interface?

I trying to implement SPI TFT interface with SPartan6 FPGA using XPS.

When I add the axi spi interface 1.02a with microblze I got the following assignments in the MHS file.

 

# PORT axi_spi_0_SPISEL_pin = axi_spi_0_SPISEL, DIR = I
 PORT axi_spi_0_SCK_pin = axi_spi_0_SCK, DIR = IO
 PORT axi_spi_0_MISO_pin = axi_spi_0_MISO, DIR = IO
 PORT axi_spi_0_MOSI_pin = axi_spi_0_MOSI, DIR = IO
 PORT axi_spi_0_SS_pin = axi_spi_0_SS, DIR = IO

I comment the SPISEL pin because i don't know how to interface it.

 

Also changed the SPISEL connection to net_Vcc ( reference from avnet board with SPI FLASH MHS file)

BEGIN axi_spi
 PARAMETER INSTANCE = axi_spi_0
 PARAMETER HW_VER = 1.02.a
 PARAMETER C_SCK_RATIO = 96
 PARAMETER C_BASEADDR = 0x40a00000
 PARAMETER C_HIGHADDR = 0x40a0ffff
 PARAMETER C_FIFO_EXIST = 0
 BUS_INTERFACE S_AXI = axi4lite_0
 PORT S_AXI_ACLK = clk_100_0000MHzPLL0
 PORT SPISEL = net_vcc
 PORT SCK = axi_spi_0_SCK
 PORT MISO = axi_spi_0_MISO
 PORT MOSI = axi_spi_0_MOSI
 PORT SS = axi_spi_0_SS
END

UCF File.

Net axi_spi_0_MISO_pin LOC=v16;
Net axi_spi_0_MOSI_pin LOC=p12;
Net axi_spi_0_SCK_pin LOC=v14;
Net axi_spi_0_SS_pin LOC=u13;

What is the proper way to interface SPISEL line in MHS?

 

Tags (3)
0 Kudos
3 Replies
Mentor hgleamon1
Mentor
5,600 Views
Registered: ‎11-14-2011

Re: How to interface SPISEL pin in XPS SPI interface?

You understand that SPISEL is an (active low) input to select the FPGA SPI IP as a slave device, right?

 

If you have no use for the FPGA as an SPI slave, then tie it high like you have done. Otherwise, it should connect to an external signal.

----------
"That which we must learn to do, we learn by doing." - Aristotle
0 Kudos
Contributor
Contributor
5,596 Views
Registered: ‎11-20-2009

Re: How to interface SPISEL pin in XPS SPI interface?

Thanks for the quick reply.

 

Here I am using FPGA as master which transfer array of data bytes to SPI TFT.  

 

All the SPI lines remains ideal when i check with scope. 

 

Here the snippet of my code.  

 

 

void SPI_Read_Write(unsigned char DataByte)
{
	u32 Index;

	static XSpi Spi;

		u8 WriteBuffer[8000];
		//u8 ReadBuffer[80000];
		XSpi_Config *ConfigPtr;	/* Pointer to Configuration data */

		// Initialize the SPI driver so that it is  ready to use.
		ConfigPtr = XSpi_LookupConfig(SPI_DEVICE_ID);


		XSpi_CfgInitialize(&Spi, ConfigPtr,ConfigPtr->BaseAddress);

		 // Set the SPI device as a master and in manual slave select mode such
		 // that the slave select signal does not toggle for every byte of a
		 // transfer, this must be done before the slave select is set
		XSpi_SetOptions(&Spi, XSP_MASTER_OPTION | XSP_MANUAL_SSELECT_OPTION);


		// Select the slave on the SPI bus so that it can be
		// read and written using the SPI bus
		XSpi_GetSlaveSelect(&Spi);

		XSpi_SetSlaveSelect(&Spi, SPI_SELECT);

		// Start the SPI driver so that interrupts and the device are enabled
		XSpi_Start(&Spi);


		//disable global interrupts since we will use a polled approach
		XSpi_IntrGlobalDisable(&Spi);

		for(Index = 0; Index < 80000;
					Index++) {
				WriteBuffer[Index] = (u8)DataByte;
			}
		XSpi_Transfer(&Spi, WriteBuffer, NULL, 80000);

}

 

 

what might be the reason for no communication?

0 Kudos
Mentor hgleamon1
Mentor
5,400 Views
Registered: ‎11-14-2011

Re: How to interface SPISEL pin in XPS SPI interface?

How do you know that this code executes correctly? Have you debugged it? Can you add some STDIO debug output to a serial terminal and see that all function calls return correctly? Have you tried to simulate the FPGA and processor? Do you have any chipscope shots that show any activity in the SPI block?

 

Frankly, there are 101 reasons why the SPI lines remain inactive (I assume that's what you mean) but until you give us some indication of what debugging steps you have made yourself, we're just looking for a needle in a haystack.

 

More info please!

----------
"That which we must learn to do, we learn by doing." - Aristotle
0 Kudos