SPI Examples
Posted: Fri Apr 21, 2017 12:59 am
The example on github https://github.com/RedPitaya/RedPitaya/ ... /spi/spi.c is not sufficient enough to actually show how to use the SPI.
The write i can sorta put together but the read function means nothing to me, how am i supposed to read specified number of bytes from an external source?
Can i make the Redpitaya into an SPI slave?
Can i use the SPI in the same application as the ADC api with the fpga_0.94.bit loaded?
What is the max SPI speed that RedPitaya can handle (Search of github source showed different numbers like 50Mhz, 25Mhz etc)?
My goal is to have it this way. On the PC side i have a USB to SPI Ftdi cable that i connect to the RedPitaya board. Then on the RedPitaya i write a single C Application that listens on the SPI as a slave for commands from the PC. There would be 2 commands, StartCapturing(0), and SendData(1). The StartCapturing i have gotten to work in C with the RedPitaya api. I am able to setup the trigger, trigger the values and read the fast ADC values into a buffer. Now i need to figure out how to send that data and receive commands from the PC over SPI.
Note: UART is too slow to send 4k samples in few milliseconds. And i dont want to have an Ethernet cable connected. On the PC end i would write a simple application that would communicate over the same USB to SPI cable.
The write i can sorta put together but the read function means nothing to me, how am i supposed to read specified number of bytes from an external source?
Can i make the Redpitaya into an SPI slave?
Can i use the SPI in the same application as the ADC api with the fpga_0.94.bit loaded?
What is the max SPI speed that RedPitaya can handle (Search of github source showed different numbers like 50Mhz, 25Mhz etc)?
My goal is to have it this way. On the PC side i have a USB to SPI Ftdi cable that i connect to the RedPitaya board. Then on the RedPitaya i write a single C Application that listens on the SPI as a slave for commands from the PC. There would be 2 commands, StartCapturing(0), and SendData(1). The StartCapturing i have gotten to work in C with the RedPitaya api. I am able to setup the trigger, trigger the values and read the fast ADC values into a buffer. Now i need to figure out how to send that data and receive commands from the PC over SPI.
Note: UART is too slow to send 4k samples in few milliseconds. And i dont want to have an Ethernet cable connected. On the PC end i would write a simple application that would communicate over the same USB to SPI cable.