1
\$\begingroup\$

I'm currently working to port some Arduino sketches from Intel Galileo that use SPI (using a prototype Arduino Breakout board).

I haven't been able to get it to work so far - but I have used an oscilloscope to have a look at what the SPI is actually doing.

I have observed that the SPI clock signals from the Galileo and Edison are a different shape and are also a different voltage (note the scales on the top of the display). I have also noticed that the Galileo's clock is on the whole time whereas the Edison's switches off and on every few seconds.

oscilloscope

The top one is the Edison, and the bottom one is the Galileo.

As a software guy I don't really know what's going on here - does anyone know what could be causing this? Is this something I can change in software or is it definitely a hardware thing? And would this be caused by the Edison itself or the breakout board?

Thanks - any help or guidance is appreciated!

Edit - More information

Below are some more images of the clocks running at different frequencies - NOTE: The Galileo (desired behaviour) is now at the top, and the Edison is at the bottom. The scales have been adjusted to be the same.

125khz

Imgur

1Mhz

Imgur

4Mhz

Imgur

It looks like the clock is becoming more and more distorted on the Edison as we increase the frequency - could this be what is causing our problems? Now the overshoot is so dominant that it appears to be at a higher logic level.

\$\endgroup\$
  • \$\begingroup\$ Are those scope probes, or random BNC cables? If the latter, half your problem may be right there. \$\endgroup\$ – Chris Stratton Oct 27 '14 at 18:59
1
\$\begingroup\$

You really need to determine whether all of that overshoot and ringing displayed on the scope is real, or just an artifact caused by how you're probing the circuit. I suspect it's the latter, so make sure you have a solid ground connection, your probes are properly compensated, and/or borrow/buy some better ones.

In general (ignoring the ringing and focusing on the underlying shape of the waveform), it looks like the Edison has a weaker clock driver than the Galileo, and in fact, it's so weak at 4 MHz that the overall amplitude is seriously reduced. If you're driving a relatively long or heavily-loaded bus, the Edison may need external buffers for the clock and MOSI lines.

\$\endgroup\$
  • \$\begingroup\$ Using a different breakout the clock signal is fine - so I'm fairly certain it's not to do with how we're probing it \$\endgroup\$ – Karl Sep 27 '14 at 22:18
  • \$\begingroup\$ Sorry, I don't know what "breakout" means in this context. But if you believe that ringing is real, then you definitely need to get rid of it, probably by using some combination of terminators at one or both ends of your bus. Such ringing will look like extra clock edges to the SPI slaves, leaving them out of sync with respect to the master. \$\endgroup\$ – Dave Tweed Sep 27 '14 at 22:24
0
\$\begingroup\$

SPI by itself doesn't specify a voltage level (can be 1V, can be 100V even if that's not very common). If you want your devices to behave the same you will need a voltage translator (they are also called level translators or level shifters). You'll probably won't be able to change this in software.

The "slow rising signal" you see could come from some capacitance on your data lines, this would be typical for I2C where only a weak pull-up takes care of a high signal and the line is only driven low.

I don't see what frequency you're driving your signal at - could you specify this.

For SPI it doesn't matter if the clock is always on or only when there is some communication taking place. Communication is valid only when the CS line is active, everything else should be ignored.

The overshoot or the slow rise you see could also come from your scope probe. Make sure that your probe is matched to your scope.

\$\endgroup\$
  • \$\begingroup\$ Ok - so will the difference in signal affect whether or not the communication is successful? The Galileo (bottom) works as desired, will I need some hardware to make the Edison Clock have a slow rising signal in order for this to work? \$\endgroup\$ – Karl Sep 27 '14 at 15:52
  • \$\begingroup\$ Also I think I was driving this at 0.125 Mhz just so that I could see the shape of the clock signals on the scope. (In reality we'll be driving it a lot faster) \$\endgroup\$ – Karl Sep 27 '14 at 15:53
  • \$\begingroup\$ Yes it will affect communication (especially the different voltage levels). You need to take care that you do not exceed the voltage levels specified in the datasheet at any given moment. The slow rising signal is actually bad, what you would usually want would be (ideally) a rectangle. Except for the overshoot in the top signal it seems ok, yet the voltage level is higher than what your attached device might be able to handle. \$\endgroup\$ – Tom L. Sep 27 '14 at 15:54
  • \$\begingroup\$ You would need to pay attention to the signal quality once you ramp up the speed. 125kHz is pretty low. Once you go up, your signal will look different. Make sure that the moment the signal is sampled (typically rising or falling edge of SCK) your data lines (MISO/MOSI) have taken on the desired value. \$\endgroup\$ – Tom L. Sep 27 '14 at 15:56
  • \$\begingroup\$ So do you think the overshoot on the edison might be breaking things? I've connected it up again (This time the Galileo is on the top, Edison is on the bottom) Here is 0.125khz again, and also [1mhz]() \$\endgroup\$ – Karl Sep 27 '14 at 17:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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