7
\$\begingroup\$

I'm trying to connect my beagle board xm rev. C to an external SPI device. Before doing this, I want to study SPI signal coming out from SIMO pin when running the spidev_test program (included in the Linux kernel source tree under Documentation/spi/spidev_test.c).

The problem is that I cannot see any signal coming out from pin 19 (McSPI3_SIMO), although spidev_test is working fine. In fact, if I short-circuit pin 19 and pin 17 (McSPI3_SOMI), I can see a bunch of bytes going out and coming back. I'm new to oscilloscope so I'm doing something wrong for sure in setting the scope.

My scope is a Siglent SDS1000DL. It is new and it is working fine, since I tested it with other simple signals.

Reading the BB xm rev. C SRM (http://beagleboard.org/static/BBxMSRM_latest.pdf) I know the voltage levels on the expansion header are 1.8V. From what I understood this means that when I transmit an hex digit on the wire, for example '0xA' (in binary it is '1010', decimal '10'), I should see on the scope an impulse whose amplitude is 1.8V (the first logical '1'), then the signal should fall down to 0V (the second binary '0'), then again an impulse at 1.8V (the third logical '1') and in conclusion the last '0'.

For this reason, I set the Volt/div parameter to 1.8V, in order to have a logical '1' on the wire displayed as high as a single screen vertical division.

Regarding Sec/div parameter, it don't know the best value to set. The clock frequency of the SPI test signal is 500 kHz. I know this because it is an information printed on stdout when running the spidev_test program. 500 kHz is a period of 2 µs. I am wondering if setting sec/div to 2 µs has sense. My screen has 15 horizontal divisions.

For the physical setup I hooked up the probe to pin 19 (SIMO) and the probe alligator clip to pin 27 (GND). You can read which signals come out from which pin on the bb xm SRM, page 108.

Finally, I don't know what's the best probe setting, 1X or 10X (I have only these two options).

So I would like to ask to who already tried this kind of measurements; What are the best scope settings in order to capture and display SPI signals?

\$\endgroup\$
1
  • 1
    \$\begingroup\$ At which voltage is the trigger level set? Also which trigger settings are you using? If it's not edge triggering, try setting it to that option. Make sure that the scope and probe are both set to 10x attenuation. Try experimenting with single trigger and normal trigger options too, to be sure that the signal stays on the screen once it's caught. \$\endgroup\$
    – AndrejaKo
    Commented Aug 3, 2012 at 10:31

2 Answers 2

5
\$\begingroup\$

It looks like the test is designed to be done as a loopback test (i.e. with the SIMO/SOMI pin shorted)
If you don't have them shorted, you won't see anything on the SIMO line unless you have a signal input from elsewhere.
SIMO = Slave In Master Out
SOMI = Slave Out Master In
I'm assuming the beagleboard sets itself up as a SPI slave, hence the pin names (more commonly MISO and MOSI)

As far as the scope settings go, x10 for the probe is best as it adds the lowest capacitance load to the line under test (means you can see higher frequencies)

For the timebase and Vdiv, just set things up as needed on the fly. 2us and 1V/div sounds fine to start with. You would often set the Vdiv to a sensible value for the bus voltage to get the signal to fill a large portion of the screen.

Then adjust the timebase in/out when you want to focus on different things, e.g. smaller if you want to check the risetime of the signal, ringing or transients, larger if you want to see more than one byte or stuff like power supply interference.
You will quickly find you are twiddling the knobs constantly when debugging, so don't worry too much about initial settings.

\$\endgroup\$
2
  • \$\begingroup\$ Thank you. spidev_test.c is indeed designed for loopback test and when I short-circuit SIMO and SOMI directly on the beagle board it works great. I expect to see the signal coming out from SIMO, since the beagle board is the SPI master, not the slave. By the way, I slightly modified spidev_test.c to transmit only a single hex digit, maybe is it too fast for the scope? \$\endgroup\$
    – Daniele
    Commented Aug 3, 2012 at 7:38
  • \$\begingroup\$ Do you have a slave attached then? The scope will be plenty fast enough to see anything the SPI can send. \$\endgroup\$
    – Oli Glaser
    Commented Aug 3, 2012 at 7:46
3
\$\begingroup\$

Try modifying the test to run repeatedly as fast as possible. Back in the day of analog scopes, we had to do this in order to be able to see anything.

With a digital storage scope you should not need that, but if you do not have the trigger settings right, you might be missing the actual transmission. Having it repeat increases the chances you will see it flash by.

Also see if your trigger is in an automatic mode; if it is, this can cause it to trigger off of noise if there's too much of a gap between signals of interest. If your trigger light is flashing or the screen updating even when you aren't sending any data, such spurious triggering is probably your problem.

With the test running as a rapid repeat, you can play with the various trigger settings to get a stable picture of the signal and learn a lot about how they work; then you can tackle making single-shot measurements and really leverage the power of a digital scope.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.