This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Part Number: AM4376
Are we able to implement a master 4/8 bit QSPI on the PRU-ICSS? What would be the QSPI clock speed?
I managed to find the following TI Design showing our PRU-ICSS as a SPI master: http://www.ti.com/tool/TIDEP0033 Do we have something for QSPI?
We are glad that we were able to resolve this issue, and will now proceed to close this thread.
If you have further questions related to this thread, you may click "Ask a related question" below. The newly created question will be automatically linked to this question.
I am not aware of any documentation related to implementing QSPI on the PRU-ICSS. It might be possible - however, the implementation and clock speed would be highly dependent on the use case. The PRU training on Designing a PRU Application may be helpful in outlining the process to determine feasibility.
In reply to Nick Saulnier:
In reply to Akash Patel:
To all readers, please note that this walkthrough is purely an example. The customer is in charge of designing their own implementations. TI will neither design custom use cases nor write custom code.
The PRU clock is 200MHz, so a 10MHz SPI clock requires 20 PRU clocks per SPI clock, an 11.11MHz SPI clock requires 18 PRU clocks per SPI clock, etc. The code was written for a 10MHz SPI clock. If fewer SPIs were used, each config_cycle/read_cycle would call config_bit fewer times, which would enable fewer PRU clock cycles and faster SPI clocks.
The SPI implementation designers decided to dedicate one PRU to controlling the interface. They decided that they wanted to "pack" and "unpack" the SPI values in that PRU rather than doing the processing elsewhere - the packing/unpacking is done in config_cycle/read_cycle. Other considerations: the high/low pulsewidths of the SPI clocks needed to be symmetric, they wanted the number of cycles used to read to match the number of cycles used to write.
I've added comments to snippets of the system designers' PRU code below to explain the timing.
config_cycle 15 ; send 16 config bits serially on each SPI (eacg config_cycle sends one bit)
config_cycle 14 ; one bit per SPI clk cycle
config_cycle 13 ; so 1 config_cycle = 20 PRU clks
nop ; each nop takes 1 PRU clk
clock_high ; this takes 1 PRU clk
nop ; we'll call this PRU clk 18 of a 20 clk cycle
; Read the data from the ADCs and place it into the result registers one cycle at a time
read_cycle 15 ; read 16 bits from each SPI
read_cycle 14 ; 1 read_cycle = 20 PRU clks
config_cycle .macro bit
mov r8, r9 ; 1 PRU clk
config_bit adc1_config_reg, bit, mosi1_pin ; 2 PRU clks
config_bit adc2_config_reg, bit, mosi2_pin
config_bit adc3_config_reg, bit, mosi3_pin
config_bit adc4_config_reg, bit, mosi4_pin
clock_high ; this is the 10th PRU clk
config_bit adc5_config_reg, bit, mosi5_pin
config_bit adc6_config_reg, bit, mosi6_pin
mov r30, r8 ; 1 PRU clk
nop ; these top two NOPs could be removed to get 18 PRU clks = 11.11 MHz SPI clk
nop ; see above
nop ; SPI requires at least 1 NOP before toggle clk low to satisfy setup
clock_low ; this is the 20th PRU clk in the config_cycle
read_cycle .macro bit
mov r11, r31 ; 1 PRU clk (clk 19 of 20)
clock_low ; 1 PRU clk (CLK 20 of 20)
read_bit adc1_result_reg, bit, miso1_pin ; 2 PRU clks (clk 1 of 20)
read_bit adc2_result_reg, bit, miso2_pin
read_bit adc3_result_reg, bit, miso3_pin
read_bit adc4_result_reg, bit, miso4_pin
clock_high ;(PRU clk 10 of 20)
read_bit adc5_result_reg, bit, miso5_pin
read_bit adc6_result_reg, bit, miso6_pin
nop ; these two NOPs could be removed to get 18 PRU clks/cycle = 11.11 MHz
nop ; see above
nop ;(PRU clk 18 of 20)
Different code implementations may yield different max clock rates.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.