How to choose the base time and frequency for SPI visualizing using ADALM2000

Hello All,

in this example https://wiki.analog.com/university/courses/electronics/m2k-spi-debug,

The editor used this: "Set the Time Base of the Logic Analyzer instrument to 10us and the Trigger Position at 35us and run a Single sweep"

My SPI bus is running with 1.4026Mhz how to chose the correct Timebase for good capture,

I am using the logic analyzer of the ADALM2000 with scopy.

Thank you in advance,

S.Tarik,

  • 0
    •  Analog Employees 
    on Oct 18, 2020 3:01 PM 1 month ago

    Hi Tarik,

    Note that sample rate and timebase setting are not the same thing.

    Look toward the top of Figure 5 of the exercise you're referring to, the sample rate is 33MHz. This is adequate for analyzing a 1.4026MHz bus.

    In general, you'll want a sample rate at least 4 or 5 times greater than your clock rate, in order to properly see the edge relationships between clock, data, and CS lines.

    It also looks like that exercise needs updating (I didn't write it, but I did hel review it), Scopy now allows you to enter in the sample rate and number of samples directly, with the horizontal axis timescale calculated for you. Once you've captured a trace, you can pan and zoom with your mouse, and right-clicking will bring you to the previous zoom level.

    The best way to get a feel for the logic analyzer is just to practice - write some test code for your microcontroller that generates some known traffic on the SPI bus, then try to capture it and interpret it with the SPI decoder. Once you're confident in the setup, you can debug unknown situations.

    -Mark

  • Hello Mark,

    Thank you for your answer and helpful comments and recommendations Slight smile.

    Look toward the top of Figure 5 of the exercise you're referring to, the sample rate is 33MHz. This is adequate for analyzing a 1.4026MHz bus.

    I think I have the latest version of scopy (1.1.2), in my scopy the value of sampling is 50Mhz/20ns.

    Your idea is, if my bus frequency is less than 50Mhz, it should work and spy the bus correctly?

    It also looks like that exercise needs updating (I didn't write it, but I did hel review it), Scopy now allows you to enter in the sample rate and number of samples directly, with the horizontal axis timescale calculated for you. Once you've captured a trace, you can pan and zoom with your mouse, and right-clicking will bring you to the previous zoom level.

    Yes, I get your idea, I am practicing this strategy to get familiar with the software and have the ability to use it effectively.

    Regards,

    S.Tarik

  • +1
    •  Analog Employees 
    on Oct 18, 2020 9:33 PM 1 month ago in reply to tairk

    Yup, 50MHz is more than adequate for your bus speed of 1.4MHz. But regarding:

    "if my bus frequency is less than 50Mhz, it should work and spy the bus correctly?

    That is generally NOT the case, you will want to oversample by some factor - I mentioned 4 or 5 as a minimum, somewhat arbitrarily, there is no set rule, it depends on how precisely you need to measure the relationship between different signals on the bus. For your situation, a sample rate of 7Msps (or 10Msps) should be adequate.

    It looks like you're off to a good start.

    -Mark

  • It looks like you're off to a good start.

    Thank you Mark,

    It look like I will never get the correct data MOSI and MISO,

    The sending DATA is CAFE x16bytes, and the scope shows me this result,

    I d like to find the correct way?