Jump to content
  • 0

SPI Measurement with analog discovery 2


xuezhi

Question

Hi all , I am new to analog discovery but I have watched the tutorial videos. 

I am trying to see the SPI signal from nrf52840 board

When I use the "Protocal" , I can see the data sent 

image.thumb.png.ee9ec57f80ce09cd31370f2f3d5fb70d.png

When i use the logic analyzer * Trying to see the signal graph , below is what I get 

image.thumb.png.fb398b4231c64fcb34f41698041835e7.png

 

But should I get something similar to this ? 

image.thumb.png.ef1d6102d32b489c190eb38a946cbf19.png

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

Hi @xuezhi

The timing does not look ideal. You should zoom in to see if those spikes are bit or byte transfers...
What is the SPI clock frequency ? The Logic Analyze capture rate should be more than double of this.

Link to comment
Share on other sites

  • 0
2 minutes ago, attila said:

Hi @xuezhi

The timing does not look ideal. You should zoom in to see if those spikes are bit or byte transfers...
What is the SPI clock frequency ? The Logic Analyze capture rate should be more than double of this.

Thank you for the reply! The frequency is 8M , I will double the capturing rate tmr when I reach the lab.

but for the 2nd last line , is actually the clk signal, but it does not look like it, it should not be just spikes , does the capturing frequency affect this? 

Link to comment
Share on other sites

  • 0
3 minutes ago, xuezhi said:

The Logic Analyze capture rate should be more than double of this.

The Protocol/Spy only stores the relevant bits. The frequency setting is used for data sending and reception glitch filter when this is checked.

Link to comment
Share on other sites

  • 0
On 8/1/2024 at 6:29 PM, attila said:

The Protocol/Spy only stores the relevant bits. The frequency setting is used for data sending and reception glitch filter when this is checked.

I am using an Adafruit SPI FLASH Breakouts W25Q16 to test my SPI message. 

When I connect the discovery 2 directly to the nrf52840 development board  for SPI connection, i can see the SPI message using Protocol - SPI - Spy 

When I connect the discovery 2 with the nrf52840 development board together with the W25Q16, I cannot receive any message 

May I ask if there is any potential reason for this or do I need to change any settings? 

Link to comment
Share on other sites

  • 0

Update: 
1722857469370.thumb.png.a77040274b3e3d58a048b891bf096b24.png

The select pin looks very weird to me 

And when i zoom in to the spike of clk and data (MOSI)

image.thumb.png.5485101ccebe9c70141cab25068d7d91.png

image.png.859f590ea163d8863c7cb9db327d8788.png

 

I am double checking the code , but it is weird why it can read out the data 0x9Fh and dummy data 0xFFh

 

Link to comment
Share on other sites

  • 0
16 hours ago, attila said:

Hi @xuezhi

This looks like 0xFF, 0xFF since MOSI is high all the way.

image.png

Yes ,  I am sending 0x9F 0xFF(Dummy) 

But my concern 

1. Why in this case, my clock signal is not as normal , which should be a up and down square wave?  

2. When I connect the discovery 2 directly to the nrf52840 development board  for SPI connection, i can see the SPI message using Protocol - SPI - Spy 

When I connect the discovery 2 with the nrf52840 development board together with the W25Q16, I cannot receive any message 

Link to comment
Share on other sites

  • 0

Hi @xuezhi

You should expect the EFBB21 on MISO and not on the MOSI.

1. The slopes indicate sampling points. Increase sampling rate or change Logic Edge option to Vertical if you want to see square transitions.
2. Make sure you have proper ground connection between devices and use the Oscilloscope channels to see the voltages levels, transitions.

image.png

Link to comment
Share on other sites

  • 0
On 8/7/2024 at 5:54 PM, attila said:

Hi @xuezhi

You should expect the EFBB21 on MISO and not on the MOSI.

1. The slopes indicate sampling points. Increase sampling rate or change Logic Edge option to Vertical if you want to see square transitions.
2. Make sure you have proper ground connection between devices and use the Oscilloscope channels to see the voltages levels, transitions.

image.png

Great Thanks to Attila !!!

 

I manage to capture the message sent from the development board (MOSI) after modifying the options as what you told me 

image.thumb.png.aa1522c59ca9d24ed685771f402d88ae.png

 

but my issue is , this is when the sensor is not powered, I can capture the message sent out. 

But once the sensor is plugged in, the logic analyzer failed to read . I am not sure if this is because of my code or the connection ( i changed the sensor , cables but still the same ) . 

 

Any help or insight is appreciated

image.thumb.png.5f697769c0a66ce613e625a1b336f0ae.png

 

image.thumb.png.486d0205e748b1efeaf4c2ed089d0a31.png

 

Link to comment
Share on other sites

  • 0

Hi @xuezhi

Make sure you are not driving the SPI lines by two controllers, from your devices and AD2/Protocol/SPI/Master

On 8/7/2024 at 12:54 PM, attila said:

2. Make sure you have proper ground connection between devices and use the Oscilloscope channels to see the voltages levels, transitions.

 

Link to comment
Share on other sites

  • 0
On 8/12/2024 at 10:01 PM, attila said:

Hi @xuezhi

Make sure you are not driving the SPI lines by two controllers, from your devices and AD2/Protocol/SPI/Master

 

Hi attila, thank you for your help!! 
After a few days of testing and resolder, I think is the poor connection of jumper cable from the sensor to the dev kit 

Ya but thanks for your help , i manage to understand how to use the analyzer better. Appreciate it!!! 

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...