Jump to content
  • 0

How do I configure the QSPI IP for controlling a DAC?


ivansavy

Question

Hello, I am using Vivado and Vitis 2020.2 to build a MicroBlaze application for the Arty S7.

My objective is to control a DAC using SPI. I have the QSPI IP configured in standard and running at 390 kHz.

image.png.0118f644427a0ea05e14fa11c3c5e6c3.png

I created an interface port spi_port for the IP and constrained the port to match I/O pins 0, 2, 3, and 4 on the Arty.

image.png.5fd06cf6de87be0de9bd76962b35f64d.png

image.png.3b72e1e1aab040cfa1221855d78d43d2.png

Finally, I initialized the XSpi instance, selected the first (and only) slave, and used XSpi_Transfer to MOSI a simple buffer.

image.png.48ab165a8510c17c1a71accc64d357a4.png

image.png.75d2c7a2674f46ce87f19e8a7c8998bb.png

When I probe the pins on an oscilloscope, the issue I am seeing is there is no SPI clock on the Arty pin nor data on the MOSI line. Does anyone know where my error is? Thank you

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Updates:

In the Board tab of the IP, you can select the Board Interface to be Custom, spi, or qspi flash. I had this selected as spi, which I think routed my SPI signals through the J7 SPI header on the Arty S7. The reason I found this was because, when I scoped the SPI header as a test to see if it was activated, I saw the signals from my I/O pins 10-13. In the Arty S7 User Guide, it states that I/O pins 10-13 are tied to the SPI header pins, so I think that I activated the SPI header accidentally, but constrained I/O pins 10-13 which meant that the SPI header was getting my signals from those pins instead.

However, when I create the IP from scratch and select Custom for the Board Interface, the sck_io signal is disabled. How am I supposed to communicate with my SPI peripheral if I can't route a clock to its SCK pin?

image.thumb.png.2d868c849689cd846254b54d79ea9ce8.png

Link to comment
Share on other sites

  • 0

Update:

The sck_io signal is unavailable because I had the STARTUP Primitive enabled, which routed the slave clock to STARTUP_IO_cfgmclk_io. As stated in the AXI Quad SPI v3.2 LogiCORE IP Product Guide section Enable STARTUPE2 Primitive Parameter: "This primitive has a dedicated clock pin that can be used to provide the SPI clock to the slave memory" and in Table 2-2: "Free-running clock from on-chip oscillator. Nominally 50 MHz but is not characterized or specified in a data sheet."

Edited by ivansavy
Link to comment
Share on other sites

  • 0

Updates:

I deleted and re-added the QSPI IP to my design, configured the Board Interface to be Custom, disabled the STARTUP primitive, and constrained the relevant signals in the .xdc files just as above, but when I ran my MicroBlaze application I still did not see the SPI signals on the I/O pins I selected in my .xdc file.

I also deleted and re-added the QSPI IP with the J7 board interface enabled and STARTUP primitive disabled, but again I was again not able to see any output on the scope when I launched my MicroBlaze application.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...