Jump to content
  • 0

AD2 SPI 1, 0 not working


whatpic

Question

I'm using the Analog Discovery 2 to read SPI data.

It works for CPOL/CPHA  0, 0    0, 1    and  1, 1.

But it does not work for CPOL = 1    CPHA =  0.  I get erroneous data with this setting.

Anyone know what I'm doing wrong?

 

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

Hi attila,

I'm very new to the AD2 so whats obvious to you is not to me.  You say I can use the Debug/Logic Analyzer but when I read the manuals on the Digilent web site there is no mention of how to do this.  (BTW do you know if there are more detailed manuals on the web site.  The ones that are there are severely lacking in information on how to use the AD2)

I tried setting up the Logic and Protocol screens the way you did but when I press Execute I get:

Write: h01, h02, h03

Read: h00, h00, h00

If I press the Debug button on the top right of the Protocol screen I get this:

       Write: h01, h02, h03,

       Read: Not available in Debug mode. See Logic Analyzer.

image.thumb.png.2bff12cb598389a634f8faf7b9207997.png

Link to comment
Share on other sites

Hi @whatpic

See the Help in the WaveForms application for the latest help corresponding to the software version, press F1, select Help tab, or Help menu / Browse.

As it is reported, in Debug mode the Read functions are not available. This mode is inteded to investigate the protocol and timing issues in Logic Analyzer.

The MISO in Logic Analyzer corresponds to the Read of zero in Protocol.

Do you have any slave SPI device connected?
Is it powered?
Are the wires correctly connected CS, CLK, MOSI, MISO

Link to comment
Share on other sites

Hi Attila,

I built two circuits using PIC 18F4550 microcontrollers.  One is a Slave SPI and the other is a Master SPI.  I connected them together so they would communicate with each other.  I have the Master sending the numbers 1 through 25 to the Slave.  Both my Slave and Master are powered by their own power supplies (+5 VDC)

I do not use the CS but the CLK, MOSI, and MISO are properly connected.  I know they are properly connected because it works for SPI 0,0, 0,1, and 1,1.  i.e. the AD2 correctly reads the 1 through 25 the Master is sending.  My Slave also reads these values.  When I check the Clock and MOSI signals with the O'Scope I see the Clock signal ans a MOSI signal that corresponds with 1 through 25.  See below screen shot for numbers 1 through 4.

The Logic Analyzer just doesn't work for SPI 1,0.

 

image.thumb.png.700e90e12f22fef5a765b3007c382690.png

Link to comment
Share on other sites

Hi @whatpic

The Protocol interface does not support SPI without CS.
In the Logic Analyzer you can specify none for CS and for SPI 1-0 select Sampling on falling edge.
With Analog Discovery when analyzing digital signal above 3.3V, like 5V, it is recommended to use series resistor. Without these the protection circuit on the digital-io lines will drain several mA which could cause voltage drop on the signal.

image.png.642c172c9dd5c79312864703cdc8733a.png
image.png.92fd00f3d6a738c50919cc25a931e43f.png

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...