Jump to content

nikk

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by nikk

  1. hm mine A7 works fine off USB cable
  2. nikk

    Arty A7 and SPI on J6

    Trying to test SPI on J6 with the simple program: #include "xspi.h" #include "xparameters.h" #include "xil_printf.h" #include "sleep.h" int main() { xil_printf("Hello World!\r\n"); static XSpi device; XSpi_Config *pcfg; int status; pcfg = XSpi_LookupConfig(XPAR_SPI_0_DEVICE_ID); xil_printf("Spi_LookupConfig = %d\r\n", pcfg); status = XSpi_CfgInitialize(&device, pcfg, pcfg->BaseAddress); xil_printf("XSpi_CfgInitialize = %d\r\n", status); status = XSpi_SetOptions(&device, XSP_MASTER_OPTION | XSP_MANUAL_SSELECT_OPTION); xil_printf("XSpi_SetOptions = %d\r\n", status); status = XSpi_Start(&device); xil_printf("XSpi_Start = %d\r\n", status); XSpi_IntrGlobalDisable(&device); xil_printf("XSpi_IntrGlobalDisable = %d\r\n", status); status = XSpi_SetSlaveSelect(&device, 0b1); xil_printf("XSpi_SetSlaveSelect = %d\r\n", status); u8 bytes [4] = {0x01,0x02,0x03,0x04}; xil_printf("Before loop starts\r\n"); while (1) { xil_printf("loop...\r\n"); status = XSpi_Transfer(&device, bytes, NULL, 4); xil_printf("XSpi_Transfer = %d\r\n",status); usleep(1); } } Output: Hello World! Spi_LookupConfig = 9300 XSpi_CfgInitialize = 0 XSpi_SetOptions = 0 XSpi_Start = 0 XSpi_IntrGlobalDisable = 0 XSpi_SetSlaveSelect = 0 Before loop starts loop... on attached screenshot I see only two bytes are sent out and that is it, why?
  3. Thank you for your quick reply. Status = XSpi_SetSlaveSelect(SpiInstancePtr, 1); and Status = XSpi_SetSlaveSelect(SpiInstancePtr, 0); are always returned 0 which is XST_SUCCESS. Frequency wise, on screenshot I have divider 16*2 so 100/32 = 3.125MHz, so should be fine for the sensor spec. With the microcontroller it works on 8MHz for SPI. Any other ideas? when I measure voltage on CS pin it's always 2.257V, yes it has pull-up resistor 10K, exactly like for PmodACL Also noticed that in digilent code that called XSpi_Start after setting XSpi_SetSlaveSelect, does it matter?
  4. Hi, I am using an original ARTY A7 board. Using an SPI device with ARTY board connected to J6. I'm sending two bytes via FPGA and I see the clock on a scope and master output but I see that CS line is still high, what am I doing wrong? here is my simple code to send two bytes: XSpi_Config *ConfigPtr; /* Pointer to Configuration data */ ConfigPtr = XSpi_LookupConfig(SPI_DEVICE_ID); if (ConfigPtr == NULL) { return XST_DEVICE_NOT_FOUND; } Status = XSpi_CfgInitialize(SpiInstancePtr, ConfigPtr, ConfigPtr->BaseAddress); if (Status != XST_SUCCESS) { return XST_FAILURE; } Status = XSpi_SelfTest(SpiInstancePtr); if (Status != XST_SUCCESS) { return XST_FAILURE; } if (SpiInstancePtr->SpiMode != XSP_STANDARD_MODE) { return XST_SUCCESS; } uint8_t clk_pha; uint8_t clk_pol; clk_pha = 1; clk_pol = 1; uint32_t spi_options = XSP_MASTER_OPTION | (clk_pol ? XSP_CLK_ACTIVE_LOW_OPTION : 0) | (clk_pha ? XSP_CLK_PHASE_1_OPTION : 0) | XSP_MANUAL_SSELECT_OPTION; Status = XSpi_SetOptions( SpiInstancePtr, spi_options); if (Status != XST_SUCCESS) { return XST_FAILURE; } XSpi_Start(SpiInstancePtr); XSpi_IntrGlobalDisable(SpiInstancePtr); int s = XSpi_SetSlaveSelect(SpiInstancePtr, 0x01); status = XSpi_Transfer(SpiInstancePtr, WriteBuffer, ReadBuffer, 2); s = XSpi_SetSlaveSelect(SpiInstancePtr, 0x00); PS: sensor works fine with microcontroller
  5. Thanks, uninstalled Vivado+Vitis 2022 and installed Vivado+Vitis 2021 - same, probably something with the Java but have no clue what is wrong.
  6. Made a project in Vivado 2022.1, compiled it successfully, then selected Tools - Launch Vitis IDE and it starts and hangs right away. Please suggest. Vivado +Vitis 2022.1 on Windows 10 64Bit
×
×
  • Create New...