Has anyone been able to get the chip select output on the AXI SPI block working? I've tried the example code and other things I've found on line but no such luck. I've even tried different outputs from the block thinking it was just labelled wrong.
ConfigPtr = XSpi_LookupConfig(TI_Amp);
if (ConfigPtr == NULL) {
xil_printf("Device not found\n\r");
}
else
{
xil_printf("Found SPI module\n\r");
}
delay(1000);
Status = XSpi_CfgInitialize(&Spi, ConfigPtr, ConfigPtr->BaseAddress);
//Status = XSpi_Initialize(&Spi, TI_Amp);
if (Status != XST_SUCCESS) {
xil_printf("SPI failed config\n\r");
}
else
{
xil_printf("SPI config set\n\r");
XSpi_Reset(&Spi); //Stop the device if already on
}
delay(1000);
Status = XSpi_SelfTest(&Spi);
if (Status == XST_SUCCESS) {
xil_printf("SPI self test passed\n\r");
}
else if(Status == XST_REGISTER_ERROR)
{
xil_printf("SPI failed to write to register\n\r");
}
else if(Status == XST_LOOPBACK_ERROR)
{
xil_printf("SPI failed loopback\n\r");
}
while(1)
{
xil_printf("Hello World\n\r");
//XSpi_WriteReg(SPI_BASEADDR, 0x03, 0x50); //Writes to address 0x50
//a value of 6
//XSpi_Transfer(&Spi, writeBuffer, readBuffer, 1);
XSpi_WriteReg(&Spi, 0x03, 0x50);
delay(10000);
readValue = 5;
xil_printf("%u\n\r", readBuffer[0]);
}
Here's my code. I can see the SPI_Out and SPI_CLK lines doing there job but not the SS_0 line which is supposed to be the chip select. Any help is greatly appreciated.
Question
newkid_old
Has anyone been able to get the chip select output on the AXI SPI block working? I've tried the example code and other things I've found on line but no such luck. I've even tried different outputs from the block thinking it was just labelled wrong.
ConfigPtr = XSpi_LookupConfig(TI_Amp);
if (ConfigPtr == NULL) {
xil_printf("Device not found\n\r");
}
else
{
xil_printf("Found SPI module\n\r");
}
delay(1000);
Status = XSpi_CfgInitialize(&Spi, ConfigPtr, ConfigPtr->BaseAddress);
//Status = XSpi_Initialize(&Spi, TI_Amp);
if (Status != XST_SUCCESS) {
xil_printf("SPI failed config\n\r");
}
else
{
xil_printf("SPI config set\n\r");
XSpi_Reset(&Spi); //Stop the device if already on
}
delay(1000);
Status = XSpi_SelfTest(&Spi);
if (Status == XST_SUCCESS) {
xil_printf("SPI self test passed\n\r");
}
else if(Status == XST_REGISTER_ERROR)
{
xil_printf("SPI failed to write to register\n\r");
}
else if(Status == XST_LOOPBACK_ERROR)
{
xil_printf("SPI failed loopback\n\r");
}
delay(10);
while(Status != XST_SUCCESS)
{
Status = XSpi_SetOptions(&Spi, XSP_MASTER_OPTION | XSP_LOOPBACK_OPTION | XSP_MANUAL_SSELECT_OPTION);
}
delay(10);
XSpi_Start(&Spi);
XSpi_IntrGlobalDisable(&Spi);
while(1)
{
xil_printf("Hello World\n\r");
//XSpi_WriteReg(SPI_BASEADDR, 0x03, 0x50); //Writes to address 0x50
//a value of 6
//XSpi_Transfer(&Spi, writeBuffer, readBuffer, 1);
XSpi_WriteReg(&Spi, 0x03, 0x50);
delay(10000);
readValue = 5;
xil_printf("%u\n\r", readBuffer[0]);
}
Here's my code. I can see the SPI_Out and SPI_CLK lines doing there job but not the SS_0 line which is supposed to be the chip select. Any help is greatly appreciated.
Link to comment
Share on other sites
7 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.