Image by Brian Penny
Question from the Customer:I am using a Promira Serial Platform with SPI Active - Level 1 Application and Promira Software API I2C/SPI Active connected to the lab computer via Ethernet connection. I have questions about the queue mechanism - I see it takes about 500uS for the Promira platform to clear a queue, which was confirmed with a logic analyzer.
The queue is very simple – it sends and receives 16-byte data through an SPI interface:
It also takes 500uS if I create a GPIO queue, where I wait for a change of the GPIO state.
My question:
Thanks for your question! The duration of clearing a queue is based on how often the queue is cleared. We’ll describe how the queue mechanism works and provide a script that you can modify for your system.
A typical SPI transfer example with Promira API queue mechanism should follow the below flow:
At step 9, ps_collect_resp is called repeatedly called until no more data is available to read from the queue buffer. On collecting and storing it in a local buffer, the queue buffer is consistently emptied and re-filled by incoming data. To not lose data, this is achieved only when the SPI slave data is collected as soon as possible. That way, the 2MB buffer is not filled up, which leads to overflow – loss of data.
As the above outline illustrated, to accelerate the process, multiple queues must be created and rapidly replenished. As soon as a queue finishes, resubmit promptly, ensuring there is always a pending queue at the Promira platform. Due to the significant latency between the computer and the Promira platform, a set of number of outstanding queues can be maintained. These will be maintained autonomously, helping to compensate for the latency.
We have a functional script that you can refer to and use: spi_nogap2.txt. This script can stream at 20 MHz without gaps. The error checking is not ideal in this script – this is an example that you can modify to fit your system requirements. To execute the code:
We hope this answers your questions. Additional resources that you may find helpful include the following:
If you want more information, feel free to contact us with your questions, or request a demo that applies to your application.