Jump to content
  • 0

AXIQUADSPI-ACL-NEXYS4


dfdias

Question

Hi was trying to interface the accelerometer available on the nexys 4 board. But i was not getting any data. Then I mapped the output pins to the JA PMOD header so I could probe them

Using an logic analyzer I saw that the sclk and Chip_select were working but the MOSI signal is full of zeroes.

I connected an 50MHz clk coming from the clock wizard, and then connected it to the ext_spi_clk and used an scale of 16 so the clk is about 3.16MHz

 

Below is the Block_Design

image.thumb.png.25d6ec7e0187519ae837e50d536612ea.pnghelloworld.c

Below is the data I acquired using saleae logic analyzer:

 

image.thumb.png.a16d0202d4cdfd0c168261d344268f39.png

 

I submitted the C files containing the main (helloworld.c) wich is a almost linear copy of the polled example;

The accelmacros file has some values with the commands and register addressees of the SPI slave.

Do you have any hint of what I am missing?

Thanks in advance.

accelmacros.h

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Hello @dfdias,

I don't see anywhere that you set the SPI mode. According to ADXL362 datasheet the SPI timing scheme follows CPHA = CPOL = 0, so it's mode 0.

You should set the options accordingly:

 u32 options = (XSP_MASTER_OPTION | XSP_CLK_ACTIVE_LOW_OPTION ) | XSP_MANUAL_SSELECT_OPTION;
 XSpi_SetOptions(&AD_Sensor,options);

Let me know how it works!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...